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
:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c
21 PKG_LICENSE_FILES
:=LICENSE libtomcrypt
/LICENSE libtommath
/LICENSE
22 PKG_CPE
=cpe
:/a
:matt_johnston
:dropbear_ssh_server
27 PKG_CONFIG_DEPENDS
:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB
29 include $(INCLUDE_DIR
)/package.mk
32 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell echo
$(CONFIG_TARGET_INIT_PATH
) | mkhash md5
)
35 define Package
/dropbear
/Default
36 URL
:=http
://matt.ucc.asn.au
/dropbear
/
39 define Package
/dropbear
/config
40 source
"$(SOURCE)/Config.in"
43 define Package
/dropbear
44 $(call Package
/dropbear
/Default
)
47 TITLE
:=Small SSH2 client
/server
48 DEPENDS
:= +DROPBEAR_ZLIB
:zlib
51 define Package
/dropbear
/description
52 A small SSH2 server
/client designed for small memory environments.
55 define Package
/dropbear
/conffiles
56 /etc
/dropbear
/dropbear_rsa_host_key
60 define Package
/dropbearconvert
61 $(call Package
/dropbear
/Default
)
64 TITLE
:=Utility for converting SSH keys
73 $(if
$(CONFIG_DROPBEAR_UTMP
),,--disable-utmp
) \
77 $(if
$(CONFIG_DROPBEAR_PUTUTLINE
),,--disable-pututline
) \
78 --disable-pututxline \
79 $(if
$(CONFIG_DROPBEAR_ZLIB
),,--disable-zlib
) \
80 --enable-bundled-libtom
82 TARGET_CFLAGS
+= -DARGTYPE
=3 -ffunction-sections
-fdata-sections
83 TARGET_LDFLAGS
+= -Wl
,--gc-sections
85 define Build
/Configure
86 $(Build
/Configure
/Default
)
88 $(SED
) 's,^#define DEFAULT_PATH .*$$$$,#define DEFAULT_PATH "$(TARGET_INIT_PATH)",g' \
89 $(PKG_BUILD_DIR
)/options.h
91 awk
'BEGIN { rc = 1 } \
92 /'DROPBEAR_CURVE25519
'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_CURVE25519),,// )#define 'DROPBEAR_CURVE25519
'"; rc = 0 } \
94 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
95 >$(PKG_BUILD_DIR
)/options.h.new
&& \
96 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h
98 # Enforce that all replacements are made, otherwise options.h has changed
99 # format and this logic is broken.
100 for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH
; do \
101 awk
'BEGIN { rc = 1 } \
102 /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
104 END { exit(rc) }' $(PKG_BUILD_DIR
)/options.h \
105 >$(PKG_BUILD_DIR
)/options.h.new
&& \
106 mv
$(PKG_BUILD_DIR
)/options.h.new
$(PKG_BUILD_DIR
)/options.h || exit
1; \
109 # remove protocol idented software version number
110 $(SED
) 's,^#define LOCAL_IDENT .*$$$$,#define LOCAL_IDENT "SSH-2.0-dropbear",g' \
111 $(PKG_BUILD_DIR
)/sysoptions.h
113 # Enforce rebuild of svr-chansession.c
114 rm -f
$(PKG_BUILD_DIR
)/svr-chansession.o
118 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
119 $(TARGET_CONFIGURE_OPTS
) \
120 PROGRAMS
="dropbear dbclient dropbearkey scp" \
121 MULTI
=1 SCPPROGRESS
=1
122 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
123 $(TARGET_CONFIGURE_OPTS
) \
124 PROGRAMS
="dropbearconvert"
127 define Package
/dropbear
/install
128 $(INSTALL_DIR
) $(1)/usr
/sbin
129 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearmulti
$(1)/usr
/sbin
/dropbear
130 $(INSTALL_DIR
) $(1)/usr
/bin
131 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/scp
132 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/ssh
133 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dbclient
134 $(LN
) ..
/sbin
/dropbear
$(1)/usr
/bin
/dropbearkey
135 $(INSTALL_DIR
) $(1)/etc
/config
136 $(INSTALL_DATA
) .
/files
/dropbear.config
$(1)/etc
/config
/dropbear
137 $(INSTALL_DIR
) $(1)/etc
/init.d
138 $(INSTALL_BIN
) .
/files
/dropbear.init
$(1)/etc
/init.d
/dropbear
139 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
/info
140 $(INSTALL_DIR
) $(1)/etc
/dropbear
141 touch
$(1)/etc
/dropbear
/dropbear_rsa_host_key
144 define Package
/dropbearconvert
/install
145 $(INSTALL_DIR
) $(1)/usr
/bin
146 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/dropbearconvert
$(1)/usr
/bin
/dropbearconvert
149 $(eval
$(call BuildPackage
,dropbear
))
150 $(eval
$(call BuildPackage
,dropbearconvert
))