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_HASH
:=d91f78ebe633be1d071fd1b7e5535b9693794048b019e9f4bea257e1992b458d
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
22 PKG_CPE_ID
:=cpe
:/a
:matt_johnston
:dropbear_ssh_server
28 PKG_CONFIG_DEPENDS
:= \
29 CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC \
30 CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
31 CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE
33 include $(INCLUDE_DIR
)/package.mk
36 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell echo
$(CONFIG_TARGET_INIT_PATH
) | mkhash md5
)
39 define Package
/dropbear
/Default
40 URL
:=http
://matt.ucc.asn.au
/dropbear
/
43 define Package
/dropbear
/config
44 source
"$(SOURCE)/Config.in"
47 define Package
/dropbear
48 $(call Package
/dropbear
/Default
)
51 TITLE
:=Small SSH2 client
/server
52 DEPENDS
:= +DROPBEAR_ZLIB
:zlib
54 100:/usr
/bin
/ssh
:/usr
/sbin
/dropbear \
55 100:/usr
/bin
/scp
:/usr
/sbin
/dropbear \
59 define Package
/dropbear
/description
60 A small SSH2 server
/client designed for small memory environments.
63 define Package
/dropbear
/conffiles
64 /etc
/dropbear
/dropbear_rsa_host_key
68 define Package
/dropbearconvert
69 $(call Package
/dropbear
/Default
)
72 TITLE
:=Utility for converting SSH keys
81 $(if
$(CONFIG_DROPBEAR_UTMP
),,--disable-utmp
) \
85 $(if
$(CONFIG_DROPBEAR_PUTUTLINE
),,--disable-pututline
) \
86 --disable-pututxline \
87 $(if
$(CONFIG_DROPBEAR_ZLIB
),,--disable-zlib
) \
88 --enable-bundled-libtom
90 TARGET_CFLAGS
+= -DARGTYPE
=3 -ffunction-sections
-fdata-sections
-flto
91 TARGET_LDFLAGS
+= -Wl
,--gc-sections
-flto
=jobserver
93 define Build
/Configure
94 : > $(PKG_BUILD_DIR
)/localoptions.h
96 $(Build
/Configure
/Default
)
98 echo
'#define DEFAULT_PATH "$(TARGET_INIT_PATH)"' >> \
99 $(PKG_BUILD_DIR
)/localoptions.h
101 echo
'#define DROPBEAR_CURVE25519 $(if $(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \
102 $(PKG_BUILD_DIR
)/localoptions.h
104 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH
; do \
105 echo
"#define $$$$OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \
106 $(PKG_BUILD_DIR
)/localoptions.h
; \
109 # remove protocol idented software version number
110 $(ESED
) 's,^(#define LOCAL_IDENT) .*$$$$,\1 "SSH-2.0-dropbear",g' \
111 $(PKG_BUILD_DIR
)/sysoptions.h
113 # disable legacy/unsafe methods and unused functionality
114 for OPTION in INETD_MODE DROPBEAR_CLI_NETCAT \
115 DROPBEAR_3DES DROPBEAR_DSS DROPBEAR_ENABLE_CBC_MODE \
116 DROPBEAR_SHA1_96_HMAC DROPBEAR_USE_PASSWORD_ENV
; do \
117 echo
"#define $$$$OPTION 0" >> \
118 $(PKG_BUILD_DIR
)/localoptions.h
; \
121 # Enforce rebuild of svr-chansession.c
122 rm -f
$(PKG_BUILD_DIR
)/svr-chansession.o
126 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
127 $(TARGET_CONFIGURE_OPTS
) \
128 PROGRAMS
="dropbear dbclient dropbearkey scp" \
129 MULTI
=1 SCPPROGRESS
=1
130 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
131 $(TARGET_CONFIGURE_OPTS
) \
132 PROGRAMS
="dropbearconvert"
135 define Package
/dropbear
/install
136 $(INSTALL_DIR
) $(1)/usr
/sbin
137 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
138 $(INSTALL_DIR
) $(1)/usr
/bin
139 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
140 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
141 $(INSTALL_DIR
) $(1)/etc
/config
142 $(INSTALL_CONF
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
143 $(INSTALL_DIR
) $(1)/etc
/init.d
144 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
145 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
146 $(INSTALL_DIR
) $(1)/etc
/dropbear
147 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
150 define Package
/dropbearconvert
/install
151 $(INSTALL_DIR
) $(1)/usr
/bin
152 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
155 $(eval
$(call BuildPackage
,dropbear
))
156 $(eval
$(call BuildPackage
,dropbearconvert
))