73cc10ef8e642015f49775df7806f3bfd2b13034
[openwrt/staging/chunkeey.git] / openwrt / 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.48.1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://matt.ucc.asn.au/dropbear/releases/
18 PKG_MD5SUM:=ca8e53a766faec831882831364568421
19 PKG_CAT:=zcat
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 DEFAULT:=y
32 TITLE:=Small SSH2 client/server
33 DESCRIPTION:=\
34 A small SSH2 server/client designed for small memory environments.
35 endef
36
37 define Package/dropbearconvert
38 $(call Package/dropbear/Default)
39 SECTION:=utils
40 CATEGORY:=Utilities
41 TITLE:=Utility for converting SSH keys
42 endef
43
44 define Build/Configure
45 $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
46 $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
47 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
48 $(TARGET_CONFIGURE_OPTS) \
49 CFLAGS="$(TARGET_CFLAGS)" \
50 ./configure \
51 --target=$(GNU_TARGET_NAME) \
52 --host=$(GNU_TARGET_NAME) \
53 --build=$(GNU_HOST_NAME) \
54 --program-prefix="" \
55 --program-suffix="" \
56 --prefix=/usr \
57 --exec-prefix=/usr \
58 --bindir=/usr/bin \
59 --datadir=/usr/share \
60 --includedir=/usr/include \
61 --infodir=/usr/share/info \
62 --libdir=/usr/lib \
63 --libexecdir=/usr/lib \
64 --localstatedir=/var \
65 --mandir=/usr/share/man \
66 --sbindir=/usr/sbin \
67 --sysconfdir=/etc \
68 $(DISABLE_LARGEFILE) \
69 $(DISABLE_NLS) \
70 --with-shared \
71 --disable-pam \
72 --enable-openpty \
73 --enable-syslog \
74 --disable-shadow \
75 --disable-lastlog \
76 --disable-utmp \
77 --disable-utmpx \
78 --disable-wtmp \
79 --disable-wtmpx \
80 --disable-loginfunc \
81 --disable-pututline \
82 --disable-pututxline \
83 --disable-zlib \
84 );
85 endef
86
87 define Build/Compile
88 $(MAKE) -C $(PKG_BUILD_DIR) \
89 $(TARGET_CONFIGURE_OPTS) \
90 LD="$(TARGET_CC)" \
91 PROGRAMS="dropbear dbclient dropbearkey scp" \
92 MULTI=1 SCPPROGRESS=1
93 $(MAKE) -C $(PKG_BUILD_DIR) \
94 $(TARGET_CONFIGURE_OPTS) \
95 LD="$(TARGET_CC)" \
96 PROGRAMS="dropbearconvert"
97 endef
98
99 define Package/dropbear/install
100 install -d -m0755 $(1)/usr/sbin
101 install -m0755 $(PKG_BUILD_DIR)/dropbearmulti \
102 $(1)/usr/sbin/dropbear
103 install -d -m0755 $(1)/usr/bin
104 ln -sf ../sbin/dropbear $(1)/usr/bin/scp
105 ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
106 ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
107 ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
108 install -d -m0755 $(1)/etc/init.d
109 install -m0755 ./files/dropbear.init $(1)/etc/init.d/S50dropbear
110 endef
111
112 define Package/dropbearconvert/install
113 install -d -m0755 $(1)/usr/bin
114 install -m0755 $(PKG_BUILD_DIR)/dropbearconvert \
115 $(1)/usr/bin/dropbearconvert
116 endef
117
118 $(eval $(call BuildPackage,dropbear))
119 $(eval $(call BuildPackage,dropbearconvert))