Uniformize package Makefile
[openwrt.git] / package / haserl / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := haserl
6 PKG_VERSION := 0.8.0
7 PKG_RELEASE := 1
8 PKG_MD5SUM := bd9195d086566f56634c0bcbbbcbebea
9
10 PKG_SOURCE_URL := @SF/haserl
11 PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
13 PKG_CAT := zcat
14 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
15 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
16 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
17
18 $(DL_DIR)/$(PKG_SOURCE):
19 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
20
21 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
22 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
23 touch $(PKG_BUILD_DIR)/.unpacked
24
25 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
26 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
27 $(TARGET_CONFIGURE_OPTS) \
28 CFLAGS="$(TARGET_CFLAGS) -DMAX_UPLOAD_KB=8192" \
29 ./configure \
30 --target=$(GNU_TARGET_NAME) \
31 --host=$(GNU_TARGET_NAME) \
32 --build=$(GNU_HOST_NAME) \
33 --program-prefix="" \
34 --program-suffix="" \
35 --prefix=/usr \
36 --exec-prefix=/usr \
37 --bindir=/usr/bin \
38 --datadir=/usr/share \
39 --includedir=/usr/include \
40 --infodir=/usr/share/info \
41 --libdir=/usr/lib \
42 --libexecdir=/usr/lib \
43 --localstatedir=/var \
44 --mandir=/usr/share/man \
45 --sbindir=/usr/sbin \
46 --sysconfdir=/etc \
47 $(DISABLE_LARGEFILE) \
48 $(DISABLE_NLS) \
49 )
50 touch $(PKG_BUILD_DIR)/.configured
51
52 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
53 $(MAKE) -C $(PKG_BUILD_DIR)
54 touch $(PKG_BUILD_DIR)/.built
55
56 $(PKG_INSTALL_DIR)/usr/bin/haserl: $(PKG_BUILD_DIR)/.built
57 mkdir -p $(PKG_INSTALL_DIR)
58 $(MAKE) -C $(PKG_BUILD_DIR) \
59 DESTDIR="$(PKG_INSTALL_DIR)" \
60 install
61
62 $(PKG_IPK): $(PKG_INSTALL_DIR)/usr/bin/haserl
63 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
64 mkdir -p $(PKG_IPK_DIR)/usr/bin
65 cp -fp $(PKG_INSTALL_DIR)/usr/bin/haserl $(PKG_IPK_DIR)/usr/bin/
66 $(STRIP) $(PKG_IPK_DIR)/usr/bin/*
67 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
68
69 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
70 $(IPKG) install $(PKG_IPK)
71
72 source: $(DL_DIR)/$(PKG_SOURCE)
73 prepare: $(PKG_BUILD_DIR)/.unpacked
74 compile: $(PKG_IPK)
75 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
76
77 clean:
78 rm -rf $(PKG_BUILD_DIR)
79 rm -f $(PKG_IPK)
80
This page took 0.041105 seconds and 5 git commands to generate.