Add an rscript shell script to recursively find strippable binaries and strip unstrip...
[openwrt.git] / openwrt / package / dhcp-forwarder / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := dhcp-forwarder
6 PKG_VERSION := 0.7
7 PKG_RELEASE := 4
8 PKG_MD5SUM := e7f876e615ebc3f96418f6477b4451e2
9
10 PKG_SOURCE_URL := http://savannah.nongnu.org/download/dhcp-fwd/ \
11 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
12 PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
14 PKG_CAT := bzcat
15 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
16 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 $(DL_DIR)/$(PKG_SOURCE):
20 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
21
22 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
23 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
24 touch $(PKG_BUILD_DIR)/.unpacked
25
26 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
27 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS)" \
30 ac_cv_func_malloc_0_nonnull="yes" \
31 ./configure \
32 --target=$(GNU_TARGET_NAME) \
33 --host=$(GNU_TARGET_NAME) \
34 --build=$(GNU_HOST_NAME) \
35 --program-prefix="" \
36 --program-suffix="" \
37 --prefix=/usr \
38 --exec-prefix=/usr \
39 --bindir=/usr/bin \
40 --datadir=/usr/share \
41 --includedir=/usr/include \
42 --infodir=/usr/share/info \
43 --libdir=/usr/lib \
44 --libexecdir=/usr/lib \
45 --localstatedir=/var \
46 --mandir=/usr/share/man \
47 --sbindir=/usr/sbin \
48 --sysconfdir=/etc \
49 $(DISABLE_LARGEFILE) \
50 $(DISABLE_NLS) \
51 )
52 touch $(PKG_BUILD_DIR)/.configured
53
54 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
55 $(MAKE) -C $(PKG_BUILD_DIR) \
56 cfg_filename="/etc/dhcp-fwd.conf"
57 touch $(PKG_BUILD_DIR)/.built
58
59 $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd: $(PKG_BUILD_DIR)/.built
60 mkdir -p $(PKG_INSTALL_DIR)
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 DESTDIR="$(PKG_INSTALL_DIR)" \
63 install
64
65 $(PKG_IPK): $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd
66 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
67 cp -fp $(PKG_NAME).conffiles $(PKG_IPK_DIR)/CONTROL/conffiles
68 chmod 0644 $(PKG_IPK_DIR)/CONTROL/conffiles
69 mkdir -p $(PKG_IPK_DIR)/etc
70 cp -fp $(PKG_BUILD_DIR)/contrib/dhcp-fwd.conf $(PKG_IPK_DIR)/etc/
71 chmod 0644 $(PKG_IPK_DIR)/etc/dhcp-fwd.conf
72 mkdir -p $(PKG_IPK_DIR)/etc/init.d
73 cp -fp $(PKG_NAME).init $(PKG_IPK_DIR)/etc/init.d/dhcp-fwd
74 chmod 0755 $(PKG_IPK_DIR)/etc/init.d/dhcp-fwd
75 mkdir -p $(PKG_IPK_DIR)/usr/bin
76 cp -fp $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd $(PKG_IPK_DIR)/usr/bin/
77 $(STRIP) $(PKG_IPK_DIR)/usr/bin/*
78 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
79
80 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
81 $(IPKG) install $(PKG_IPK)
82
83 source: $(DL_DIR)/$(PKG_SOURCE)
84 prepare: $(PKG_BUILD_DIR)/.unpacked
85 compile: $(PKG_IPK)
86 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
87
88 clean:
89 rm -rf $(PKG_BUILD_DIR)
90 rm -f $(PKG_IPK)
91
This page took 0.0485 seconds and 5 git commands to generate.