2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 http
://matt.ucc.asn.au
/dropbear
/releases
/ \
17 https
://dropbear.nl
/mirror
/releases
/
18 PKG_MD5SUM
:=1918604238817385a156840fa2c39490
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
26 PKG_CONFIG_DEPENDS
:=CONFIG_DROPBEAR_ECC
28 include $(INCLUDE_DIR
)/package.mk
30 define Package
/dropbear
/Default
31 URL
:=http
://matt.ucc.asn.au
/dropbear
/
34 define Package
/dropbear
/config
35 source
"$(SOURCE)/Config.in"
38 define Package
/dropbear
39 $(call Package
/dropbear
/Default
)
42 TITLE
:=Small SSH2 client
/server
45 define Package
/dropbear
/description
46 A small SSH2 server
/client designed for small memory environments.
49 define Package
/dropbear
/conffiles
50 /etc
/dropbear
/dropbear_rsa_host_key
51 /etc
/dropbear
/dropbear_dss_host_key
55 define Package
/dropbearconvert
56 $(call Package
/dropbear
/Default
)
59 TITLE
:=Utility for converting SSH keys
66 $(if
$(CONFIG_SHADOW_PASSWORDS
),,--disable-shadow
) \
74 --disable-pututxline \
76 --enable-bundled-libtom
78 TARGET_CFLAGS
+= -DARGTYPE
=3 -ffunction-sections
-fdata-sections
79 TARGET_LDFLAGS
+= -Wl
,--gc-sections
81 define Build
/Configure
82 $(Build
/Configure
/Default
)
84 # Enforce that all replacements are made, otherwise options.h has changed
85 # format and this logic is broken.
86 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH DROPBEAR_CURVE25519
; do \
87 awk
'BEGIN { rc = 1 } \
88 /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
90 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
91 >$(PKG_BUILD_DIR
)/options.h.new
&& \
92 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h || exit
1; \
97 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
98 $(TARGET_CONFIGURE_OPTS
) \
99 PROGRAMS
="dropbear dbclient dropbearkey scp" \
100 MULTI
=1 SCPPROGRESS
=1
101 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
102 $(TARGET_CONFIGURE_OPTS
) \
103 PROGRAMS
="dropbearconvert"
106 define Package
/dropbear
/install
107 $(INSTALL_DIR
) $(1)/usr
/sbin
108 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
109 $(INSTALL_DIR
) $(1)/usr
/bin
110 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/scp
111 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/ssh
112 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
113 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
114 $(INSTALL_DIR
) $(1)/etc
/config
115 $(INSTALL_DATA
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
116 $(INSTALL_DIR
) $(1)/etc
/init.d
117 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
118 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
119 $(INSTALL_DIR
) $(1)/etc
/dropbear
120 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
121 touch
$(1)/etc
/dropbear
/dropbear_dss_host_key
124 define Package
/dropbearconvert
/install
125 $(INSTALL_DIR
) $(1)/usr
/bin
126 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
129 $(eval
$(call BuildPackage
,dropbear
))
130 $(eval
$(call BuildPackage
,dropbearconvert
))