update dropbear to 0.45
[openwrt.git] / openwrt / package / dropbear / Makefile
1 #############################################################
2 #
3 # dropbear
4 #
5 #############################################################
6 include $(TOPDIR)/rules.mk
7
8 DROPBEAR_VERSION:=0.45
9 DROPBEAR_SOURCE:=dropbear-$(DROPBEAR_VERSION).tar.bz2
10 DROPBEAR_SITE:=http://matt.ucc.asn.au/dropbear/releases/
11 DROPBEAR_DIR:=$(BUILD_DIR)/dropbear-$(DROPBEAR_VERSION)
12 DROPBEAR_CAT:=bzcat
13 DROPBEAR_BINARY:=dropbearmulti
14 DROPBEAR_TARGET_BINARY:=usr/sbin/dropbear
15 DROPBEAR_IPK:=dropbear_$(DROPBEAR_VERSION)-1_$(ARCH).ipk
16 DROPBEAR_IPK_DIR:=$(DROPBEAR_DIR)/ipkg
17
18 $(DL_DIR)/$(DROPBEAR_SOURCE):
19 $(WGET) -P $(DL_DIR) $(DROPBEAR_SITE)/$(DROPBEAR_SOURCE)
20
21 $(DROPBEAR_DIR)/.patched: $(DL_DIR)/$(DROPBEAR_SOURCE)
22 $(DROPBEAR_CAT) $(DL_DIR)/$(DROPBEAR_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
23 $(PATCH) $(DROPBEAR_DIR) ./patches \*.patch
24 $(SED) 's,^/\* #define DROPBEAR_MULTI.*,#define DROPBEAR_MULTI,g' $(DROPBEAR_DIR)/options.h
25 touch $(DROPBEAR_DIR)/.patched
26
27 $(DROPBEAR_DIR)/.configured: $(DROPBEAR_DIR)/.patched
28 (cd $(DROPBEAR_DIR); rm -rf config.cache; \
29 autoconf; \
30 $(TARGET_CONFIGURE_OPTS) \
31 CFLAGS="$(TARGET_CFLAGS)" \
32 ./configure \
33 --target=$(GNU_TARGET_NAME) \
34 --host=$(GNU_TARGET_NAME) \
35 --build=$(GNU_HOST_NAME) \
36 --prefix=/usr \
37 --exec-prefix=/usr \
38 --bindir=/usr/bin \
39 --sbindir=/usr/sbin \
40 --libexecdir=/usr/lib \
41 --sysconfdir=/etc \
42 --datadir=/usr/share \
43 --localstatedir=/var \
44 --mandir=/usr/man \
45 --infodir=/usr/info \
46 $(DISABLE_NLS) \
47 --with-shared \
48 );
49 touch $(DROPBEAR_DIR)/.configured
50
51 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY): $(DROPBEAR_DIR)/.configured
52 $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) \
53 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" \
54 MULTI=1 SCPPROGRESS=1 -C $(DROPBEAR_DIR)
55
56 $(PACKAGE_DIR)/$(DROPBEAR_IPK): $(DROPBEAR_DIR)/$(DROPBEAR_BINARY)
57 $(SCRIPT_DIR)/make-ipkg-dir.sh $(DROPBEAR_IPK_DIR) dropbear.control $(DROPBEAR_VERSION)-1 $(ARCH)
58 cp dropbear.conffiles $(DROPBEAR_IPK_DIR)/CONTROL/conffiles
59 mkdir -p $(DROPBEAR_IPK_DIR)/usr/bin
60 mkdir -p $(DROPBEAR_IPK_DIR)/usr/sbin
61 install -m 755 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY) \
62 $(DROPBEAR_IPK_DIR)/$(DROPBEAR_TARGET_BINARY)
63 $(STRIP) $(DROPBEAR_IPK_DIR)/usr/sbin/dropbear
64 ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/scp
65 ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/ssh
66 ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/dropbearkey
67 ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/dropbearconvert
68 mkdir -p $(DROPBEAR_IPK_DIR)/etc/init.d
69 cp ./files/passwd $(DROPBEAR_IPK_DIR)/etc
70 cp ./files/S50dropbear $(DROPBEAR_IPK_DIR)/etc/init.d/
71 chmod a+x $(DROPBEAR_IPK_DIR)/etc/init.d/S50dropbear
72 $(IPKG_BUILD) $(DROPBEAR_IPK_DIR) $(PACKAGE_DIR)
73
74 $(IPKG_STATE_DIR)/info/dropbear.list: $(PACKAGE_DIR)/$(DROPBEAR_IPK)
75 $(IPKG) install $(PACKAGE_DIR)/$(DROPBEAR_IPK)
76
77 source: $(DL_DIR)/$(DROPBEAR_SOURCE)
78 prepare: $(DROPBEAR_DIR)/.patched
79 compile: $(PACKAGE_DIR)/$(DROPBEAR_IPK)
80 install: $(IPKG_STATE_DIR)/info/dropbear.list
81
82 clean:
83 rm -rf $(DROPBEAR_DIR)
84 rm -f $(PACKAGE_DIR)/$(DROPBEAR_IPK)
85
This page took 0.042552 seconds and 5 git commands to generate.