Root/package/dropbear/Makefile

1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=dropbear
11PKG_VERSION:=0.53.1
12PKG_RELEASE:=3
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:= \
16    http://matt.ucc.asn.au/dropbear/releases/ \
17    http://www.mirrors.wiretapped.net/security/cryptography/apps/ssh/dropbear/
18PKG_MD5SUM:=6b8d901859d9b8a18e2f6bfe0a892a03
19
20PKG_BUILD_PARALLEL:=1
21
22include $(INCLUDE_DIR)/package.mk
23
24define Package/dropbear/Default
25  URL:=http://matt.ucc.asn.au/dropbear/
26endef
27
28define Package/dropbear
29  $(call Package/dropbear/Default)
30  SECTION:=net
31  CATEGORY:=Base system
32  TITLE:=Small SSH2 client/server
33endef
34
35define Package/dropbear/description
36 A small SSH2 server/client designed for small memory environments.
37endef
38
39define Package/dropbear/conffiles
40/etc/dropbear/dropbear_rsa_host_key
41/etc/dropbear/dropbear_dss_host_key
42/etc/config/dropbear
43endef
44
45define Package/dropbearconvert
46  $(call Package/dropbear/Default)
47  SECTION:=utils
48  CATEGORY:=Utilities
49  TITLE:=Utility for converting SSH keys
50endef
51
52CONFIGURE_ARGS += \
53    --with-shared \
54    --disable-pam \
55    --enable-openpty \
56    --enable-syslog \
57    $(if $(CONFIG_SHADOW_PASSWORDS),,--disable-shadow) \
58    --disable-lastlog \
59    --disable-utmp \
60    --disable-utmpx \
61    --disable-wtmp \
62    --disable-wtmpx \
63    --disable-loginfunc \
64    --disable-pututline \
65    --disable-pututxline \
66    --disable-zlib \
67    --enable-bundled-libtom
68
69TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections
70TARGET_LDFLAGS += -Wl,--gc-sections
71
72define Build/Configure
73    $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
74    $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
75    $(call Build/Configure/Default)
76endef
77
78define Build/Compile
79    $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
80        $(TARGET_CONFIGURE_OPTS) \
81        LD="$(TARGET_CC)" \
82        PROGRAMS="dropbear dbclient dropbearkey scp" \
83        MULTI=1 SCPPROGRESS=1
84    $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
85        $(TARGET_CONFIGURE_OPTS) \
86        LD="$(TARGET_CC)" \
87        PROGRAMS="dropbearconvert"
88endef
89
90define Package/dropbear/install
91    $(INSTALL_DIR) $(1)/usr/sbin
92    $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear
93    $(INSTALL_DIR) $(1)/usr/bin
94    ln -sf ../sbin/dropbear $(1)/usr/bin/scp
95    ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
96    ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
97    ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
98    $(INSTALL_DIR) $(1)/etc/config
99    $(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
100    $(INSTALL_DIR) $(1)/etc/init.d
101    $(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
102    $(INSTALL_DIR) $(1)/usr/lib/opkg/info
103    $(INSTALL_DIR) $(1)/etc/dropbear
104    touch $(1)/etc/dropbear/dropbear_rsa_host_key
105    touch $(1)/etc/dropbear/dropbear_dss_host_key
106endef
107
108define Package/dropbearconvert/install
109    $(INSTALL_DIR) $(1)/usr/bin
110    $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearconvert $(1)/usr/bin/dropbearconvert
111endef
112
113$(eval $(call BuildPackage,dropbear))
114$(eval $(call BuildPackage,dropbearconvert))
115

Archive Download this file



interactive