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