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