2 # Copyright (C) 2006-2016 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
:=2ccc0a2f3e37ca221db12c5af6a88137
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
26 PKG_CONFIG_DEPENDS
:=CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519
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
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 awk
'BEGIN { rc = 1 } \
84 /'DROPBEAR_CURVE25519
'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_CURVE25519),,// )#define 'DROPBEAR_CURVE25519
'"; rc = 0 } \
86 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
87 >$(PKG_BUILD_DIR
)/options.h.new
&& \
88 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h
90 # Enforce that all replacements are made, otherwise options.h has changed
91 # format and this logic is broken.
92 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH
; do \
93 awk
'BEGIN { rc = 1 } \
94 /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
96 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
97 >$(PKG_BUILD_DIR
)/options.h.new
&& \
98 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h || exit
1; \
103 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
104 $(TARGET_CONFIGURE_OPTS
) \
105 PROGRAMS
="dropbear dbclient dropbearkey scp" \
106 MULTI
=1 SCPPROGRESS
=1
107 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
108 $(TARGET_CONFIGURE_OPTS
) \
109 PROGRAMS
="dropbearconvert"
112 define Package
/dropbear
/install
113 $(INSTALL_DIR
) $(1)/usr
/sbin
114 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
115 $(INSTALL_DIR
) $(1)/usr
/bin
116 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/scp
117 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/ssh
118 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
119 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
120 $(INSTALL_DIR
) $(1)/etc
/config
121 $(INSTALL_DATA
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
122 $(INSTALL_DIR
) $(1)/etc
/init.d
123 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
124 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
125 $(INSTALL_DIR
) $(1)/etc
/dropbear
126 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
129 define Package
/dropbearconvert
/install
130 $(INSTALL_DIR
) $(1)/usr
/bin
131 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
134 $(eval
$(call BuildPackage
,dropbear
))
135 $(eval
$(call BuildPackage
,dropbearconvert
))