add internal package build dependencies to rules.mk to remove duplicate code
[openwrt.git] / openwrt / package / chillispot / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=chillispot
6 PKG_VERSION:=1.0RC3
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=9ad5f4181ae2e9e2d5ccb165c37dfdde
9
10 PKG_SOURCE_URL:= \
11 http://www.chillispot.org/download/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 IPKG_CHILLISPOT:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
20 IDIR_CHILLISPOT:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
21 INFO_CHILLISPOT:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
22
23 $(DL_DIR)/$(PKG_SOURCE):
24 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
25
26 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
27 rm -rf $(PKG_BUILD_DIR)
28 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
29 touch $(PKG_BUILD_DIR)/.prepared
30
31 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
32 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
33 $(TARGET_CONFIGURE_OPTS) \
34 CFLAGS="$(TARGET_CFLAGS)" \
35 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
36 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
37 ac_cv_func_malloc_0_nonnull=yes \
38 ac_cv_func_memcmp_working=yes \
39 ac_cv_func_setvbuf_reversed=no \
40 ./configure \
41 --target=$(GNU_TARGET_NAME) \
42 --host=$(GNU_TARGET_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --infodir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_LARGEFILE) \
59 $(DISABLE_NLS) \
60 );
61 touch $(PKG_BUILD_DIR)/.configured
62
63 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 $(TARGET_CONFIGURE_OPTS)
66 touch $(PKG_BUILD_DIR)/.built
67
68 $(PKG_INSTALL_DIR)/usr/sbin/chilli: $(PKG_BUILD_DIR)/.built
69 mkdir -p $(PKG_INSTALL_DIR)
70 $(MAKE) -C $(PKG_BUILD_DIR) \
71 DESTDIR="$(PKG_INSTALL_DIR)" \
72 install
73
74 $(IPKG_CHILLISPOT): $(PKG_INSTALL_DIR)/usr/sbin/chilli
75 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_CHILLISPOT) ./ipkg/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
76 install -m0644 ./ipkg/$(PKG_NAME).conffiles $(IDIR_CHILLISPOT)/CONTROL/conffiles
77 install -m0755 -d $(IDIR_CHILLISPOT)/etc/init.d
78 install -m0755 ./ipkg/$(PKG_NAME).init $(IDIR_CHILLISPOT)/etc/init.d/chilli
79 install -m0755 -d $(IDIR_CHILLISPOT)/etc
80 install -m0644 $(PKG_BUILD_DIR)/doc/chilli.conf $(IDIR_CHILLISPOT)/etc/
81 install -m0755 -d $(IDIR_CHILLISPOT)/usr/sbin
82 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/chilli $(IDIR_CHILLISPOT)/usr/sbin/
83 $(RSTRIP) $(IDIR_CHILLISPOT)
84 $(IPKG_BUILD) $(IDIR_CHILLISPOT) $(PACKAGE_DIR)
85
86 $(INFO_CHILLISPOT): $(IPKG_CHILLISPOT)
87 $(IPKG) install $(IPKG_CHILLISPOT)
88
89 source: $(DL_DIR)/$(PKG_SOURCE)
90 prepare: $(PKG_BUILD_DIR)/.prepared
91 compile: $(IPKG_CHILLISPOT)
92 install: $(INFO_CHILLISPOT)
93
94 clean:
95 rm -rf $(PKG_BUILD_DIR)
96 rm -rf $(IPKG_CHILLISPOT)
This page took 0.056103 seconds and 5 git commands to generate.