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