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
:=8d6d78ce60ca52350ec04fcbd711ce9b
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
26 PKG_CONFIG_DEPENDS
:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519
28 include $(INCLUDE_DIR
)/package.mk
31 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell $(SH_FUNC
) echo
$(CONFIG_TARGET_INIT_PATH
) | md5s
)
34 define Package
/dropbear
/Default
35 URL
:=http
://matt.ucc.asn.au
/dropbear
/
38 define Package
/dropbear
/config
39 source
"$(SOURCE)/Config.in"
42 define Package
/dropbear
43 $(call Package
/dropbear
/Default
)
46 TITLE
:=Small SSH2 client
/server
49 define Package
/dropbear
/description
50 A small SSH2 server
/client designed for small memory environments.
53 define Package
/dropbear
/conffiles
54 /etc
/dropbear
/dropbear_rsa_host_key
58 define Package
/dropbearconvert
59 $(call Package
/dropbear
/Default
)
62 TITLE
:=Utility for converting SSH keys
69 $(if
$(CONFIG_SHADOW_PASSWORDS
),,--disable-shadow
) \
72 $(if
$(CONFIG_DROPBEAR_UTMP
),,--disable-utmp
) \
76 $(if
$(CONFIG_DROPBEAR_PUTUTLINE
),,--disable-pututline
) \
77 --disable-pututxline \
79 --enable-bundled-libtom
81 TARGET_CFLAGS
+= -DDEFAULT_PATH
=\\\"$(CONFIG_TARGET_INIT_PATH
)\\\" -DARGTYPE
=3 -ffunction-sections
-fdata-sections
82 TARGET_LDFLAGS
+= -Wl
,--gc-sections
84 define Build
/Configure
85 $(Build
/Configure
/Default
)
87 $(SED
) 's,^#define DEFAULT_PATH .*$$$$,#define DEFAULT_PATH "$(CONFIG_TARGET_INIT_PATH)",g' \
88 $(PKG_BUILD_DIR
)/options.h
90 awk
'BEGIN { rc = 1 } \
91 /'DROPBEAR_CURVE25519
'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_CURVE25519),,// )#define 'DROPBEAR_CURVE25519
'"; rc = 0 } \
93 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
94 >$(PKG_BUILD_DIR
)/options.h.new
&& \
95 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h
97 # Enforce that all replacements are made, otherwise options.h has changed
98 # format and this logic is broken.
99 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH
; do \
100 awk
'BEGIN { rc = 1 } \
101 /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
103 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
104 >$(PKG_BUILD_DIR
)/options.h.new
&& \
105 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h || exit
1; \
108 # Enforce rebuild of svr-chansession.c
109 rm -f
$(PKG_BUILD_DIR
)/svr-chansession.o
113 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
114 $(TARGET_CONFIGURE_OPTS
) \
115 PROGRAMS
="dropbear dbclient dropbearkey scp" \
116 MULTI
=1 SCPPROGRESS
=1
117 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
118 $(TARGET_CONFIGURE_OPTS
) \
119 PROGRAMS
="dropbearconvert"
122 define Package
/dropbear
/install
123 $(INSTALL_DIR
) $(1)/usr
/sbin
124 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
125 $(INSTALL_DIR
) $(1)/usr
/bin
126 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/scp
127 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/ssh
128 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
129 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
130 $(INSTALL_DIR
) $(1)/etc
/config
131 $(INSTALL_DATA
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
132 $(INSTALL_DIR
) $(1)/etc
/init.d
133 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
134 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
135 $(INSTALL_DIR
) $(1)/etc
/dropbear
136 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
139 define Package
/dropbearconvert
/install
140 $(INSTALL_DIR
) $(1)/usr
/bin
141 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
144 $(eval
$(call BuildPackage
,dropbear
))
145 $(eval
$(call BuildPackage
,dropbearconvert
))