switch to a more reliable mechanism for running firstboot
[openwrt.git] / openwrt / package / rules.mk
1 define PKG_template
2 IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
3 IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(2)
4 INFO_$(1):=$(IPKG_STATE_DIR)/info/$(2).list
5
6 ifneq ($(BR2_PACKAGE_$(1)),)
7 compile: $$(IPKG_$(1))
8 endif
9 ifneq ($(DEVELOPER),)
10 compile: $$(IPKG_$(1))
11 endif
12 ifeq ($(BR2_PACKAGE_$(1)),y)
13 install: $$(INFO_$(1))
14 endif
15
16 $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
17 $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
18 for file in conffiles preinst postinst prerm postrm; do \
19 [ -f ./ipkg/$(2).$$$$file ] && cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file || true; \
20 done
21
22 $$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $(PKG_BUILD_DIR)/.built $(PACKAGE_DIR)
23
24 $$(INFO_$(1)): $$(IPKG_$(1))
25 $(IPKG) install $$(IPKG_$(1))
26
27 $(2)-clean:
28 rm -f $$(IPKG_$(1))
29 clean: $(2)-clean
30
31 endef
32
33 ifneq ($(strip $(PKG_SOURCE)),)
34 $(DL_DIR)/$(PKG_SOURCE):
35 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
36 endif
37
38 ifneq ($(strip $(PKG_CAT)),)
39 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
40 rm -rf $(PKG_BUILD_DIR)
41 mkdir -p $(PKG_BUILD_DIR)
42 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -
43 if [ -d ./patches ]; then \
44 $(PATCH) $(PKG_BUILD_DIR) ./patches ; \
45 fi
46 touch $(PKG_BUILD_DIR)/.prepared
47 endif
48
49 all: compile
50
51 source: $(DL_DIR)/$(PKG_SOURCE)
52 prepare: $(PKG_BUILD_DIR)/.prepared
53 compile:
54 install:
55
56 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
57 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
58
59 $(PACKAGE_DIR):
60 mkdir -p $@
61
62
63 clean:
64 rm -rf $(PKG_BUILD_DIR)
65
66 .PHONY: all source prepare compile install clean
This page took 0.049156 seconds and 5 git commands to generate.