2 # Copyright (C) 2006-2012 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
:=7066bb9a2da708f3ed06314fdc9c47fd
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
25 PKG_CONFIG_DEPENDS
:=CONFIG_DROPBEAR_ECC
27 include $(INCLUDE_DIR
)/package.mk
29 define Package
/dropbear
/Default
30 URL
:=http
://matt.ucc.asn.au
/dropbear
/
33 define Package
/dropbear
/config
34 source
"$(SOURCE)/Config.in"
37 define Package
/dropbear
38 $(call Package
/dropbear
/Default
)
41 TITLE
:=Small SSH2 client
/server
44 define Package
/dropbear
/description
45 A small SSH2 server
/client designed for small memory environments.
48 define Package
/dropbear
/conffiles
49 /etc
/dropbear
/dropbear_rsa_host_key
50 /etc
/dropbear
/dropbear_dss_host_key
54 define Package
/dropbearconvert
55 $(call Package
/dropbear
/Default
)
58 TITLE
:=Utility for converting SSH keys
65 $(if
$(CONFIG_SHADOW_PASSWORDS
),,--disable-shadow
) \
73 --disable-pututxline \
75 --enable-bundled-libtom
77 TARGET_CFLAGS
+= -DARGTYPE
=3 -ffunction-sections
-fdata-sections
78 TARGET_LDFLAGS
+= -Wl
,--gc-sections
80 define Build
/Configure
81 $(Build
/Configure
/Default
)
83 # Enforce that all replacements are made, otherwise options.h has changed
84 # format and this logic is broken.
85 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH DROPBEAR_CURVE25519
; do \
86 awk
'BEGIN { rc = 1 } \
87 /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
89 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
90 >$(PKG_BUILD_DIR
)/options.h.new
&& \
91 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h || exit
1; \
96 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
97 $(TARGET_CONFIGURE_OPTS
) \
98 PROGRAMS
="dropbear dbclient dropbearkey scp" \
100 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
101 $(TARGET_CONFIGURE_OPTS
) \
102 PROGRAMS
="dropbearconvert"
105 define Package
/dropbear
/install
106 $(INSTALL_DIR
) $(1)/usr
/sbin
107 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
108 $(INSTALL_DIR
) $(1)/usr
/bin
109 ln
-sf ..
/sbin
/dropbear
$(1)/usr
/bin
/scp
110 ln
-sf ..
/sbin
/dropbear
$(1)/usr
/bin
/ssh
111 ln
-sf ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
112 ln
-sf ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
113 $(INSTALL_DIR
) $(1)/etc
/config
114 $(INSTALL_DATA
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
115 $(INSTALL_DIR
) $(1)/etc
/init.d
116 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
117 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
118 $(INSTALL_DIR
) $(1)/etc
/dropbear
119 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
120 touch
$(1)/etc
/dropbear
/dropbear_dss_host_key
123 define Package
/dropbearconvert
/install
124 $(INSTALL_DIR
) $(1)/usr
/bin
125 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
128 $(eval
$(call BuildPackage
,dropbear
))
129 $(eval
$(call BuildPackage
,dropbearconvert
))