convert bwm to new packaging style
[openwrt.git] / openwrt / package / ipkg / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=ipkg
6 PKG_VERSION:=0.99.145
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=d98799dbcf911f90a7c3c897713cc37a
9
10 PKG_SOURCE_URL:=http://www.handhelds.org/packages/ipkg
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 IPKG_IPKG:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 IDIR_IPKG:=$(PKG_BUILD_DIR)/idir/$(PKG_NAME)
18 INFO_IPKG:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
19
20 $(DL_DIR)/$(PKG_SOURCE):
21 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
22
23 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
24 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
25 $(PATCH) $(PKG_BUILD_DIR) ./patches
26 touch $(PKG_BUILD_DIR)/.prepared
27
28 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
29 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
30 $(TARGET_CONFIGURE_OPTS) \
31 CFLAGS="$(TARGET_CFLAGS)" \
32 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
33 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
34 ./configure \
35 --target=$(GNU_TARGET_NAME) \
36 --host=$(GNU_TARGET_NAME) \
37 --build=$(GNU_HOST_NAME) \
38 --program-prefix="" \
39 --program-suffix="" \
40 --prefix=/usr \
41 --exec-prefix=/usr \
42 --bindir=/usr/bin \
43 --datadir=/usr/share \
44 --includedir=/usr/include \
45 --infodir=/usr/share/info \
46 --libdir=/usr/lib \
47 --libexecdir=/usr/lib \
48 --localstatedir=/var \
49 --mandir=/usr/share/man \
50 --sbindir=/usr/sbin \
51 --sysconfdir=/etc \
52 $(DISABLE_NLS) \
53 $(DISABLE_LARGEFILE) \
54 );
55 touch $(PKG_BUILD_DIR)/.configured
56
57 $(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.configured
58 $(MAKE) -C $(PKG_BUILD_DIR) \
59 CC=$(TARGET_CC)
60
61 $(IPKG_IPKG): $(PKG_BUILD_DIR)/$(PKG_NAME)
62 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_IPKG) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
63 mkdir -p $(IDIR_IPKG)/bin
64 cp -a $(PKG_BUILD_DIR)/.libs/ipkg-cl $(IDIR_IPKG)/bin/ipkg
65 $(STRIP) $(IDIR_IPKG)/bin/*
66 mkdir -p $(IDIR_IPKG)/lib
67 cp -a $(PKG_BUILD_DIR)/.libs/libipkg.so* $(IDIR_IPKG)/lib/
68 $(STRIP) $(IDIR_IPKG)/lib/*
69 mkdir -p $(PACKAGE_DIR)
70 $(IPKG_BUILD) $(IDIR_IPKG) $(PACKAGE_DIR)
71
72 $(INFO_IPKG): $(IPKG_IPKG)
73 $(IPKG) install $(IPKG_IPKG)
74
75 source: $(DL_DIR)/$(PKG_SOURCE)
76 prepare: $(PKG_BUILD_DIR)/.prepared
77 compile: $(IPKG_IPKG)
78 install: $(INFO_IPKG)
79
80 clean:
81 rm -rf $(PKG_BUILD_DIR) $(IPKG_IPKG)
This page took 0.045718 seconds and 5 git commands to generate.