1 # invoke ipkg with configuration in $(STAGING_DIR)/etc/ipkg.conf
4 IPKG_
$(1):=$(PACKAGE_DIR
)/$(2)_
$(3)_
$(4).ipk
5 IDIR_
$(1):=$(PKG_BUILD_DIR
)/ipkg
/$(2)
6 INFO_
$(1):=$(IPKG_STATE_DIR
)/info/$(2).list
8 ifneq ($(BR2_PACKAGE_
$(1)),)
9 compile-targets
: $$(IPKG_
$(1))
12 compile-targets
: $$(IPKG_
$(1))
14 ifeq ($(BR2_PACKAGE_
$(1)),y
)
15 install-targets
: $$(INFO_
$(1))
18 IDEPEND_
$(1):=$$(strip $(5))
20 $$(IDIR_
$(1))/CONTROL
/control
: $(PKG_BUILD_DIR
)/.prepared
21 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(IDIR_
$(1)) .
/ipkg
/$(2).control
$(3) $(4)
22 if
[ "$$(IDEPEND_$(1))" != "" ]; then echo
"Depends: $$(IDEPEND_$(1))" >> $$(IDIR_
$(1))/CONTROL
/control
; fi
23 for file in conffiles preinst postinst prerm postrm
; do \
24 [ -f .
/ipkg
/$(2).
$$$$file ] && cp .
/ipkg
/$(2).
$$$$file $$(IDIR_
$(1))/CONTROL
/$$$$file || true
; \
27 $$(IPKG_
$(1)): $$(IDIR_
$(1))/CONTROL
/control
$(PKG_BUILD_DIR
)/.built
$(PACKAGE_DIR
)
29 $$(INFO_
$(1)): $$(IPKG_
$(1))
30 $(IPKG
) install $$(IPKG_
$(1))
38 ifneq ($(strip $(PKG_SOURCE
)),)
39 $(DL_DIR
)/$(PKG_SOURCE
):
40 @
$(CMD_TRACE
) "downloading... "
41 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL
) $(MAKE_TRACE
)
44 ifneq ($(strip $(PKG_CAT
)),)
45 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
46 rm -rf
$(PKG_BUILD_DIR
)
47 mkdir
-p
$(PKG_BUILD_DIR
)
48 if
[ "$(PKG_CAT)" = "unzip" ]; then \
49 unzip
-d
$(PKG_BUILD_DIR
) $(DL_DIR
)/$(PKG_SOURCE
) ; \
51 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(PKG_BUILD_DIR
)/..
$(TAR_OPTIONS
) - ; \
53 if
[ -d .
/patches
]; then \
54 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
; \
56 touch
$(PKG_BUILD_DIR
)/.prepared
61 source
: $(DL_DIR
)/$(PKG_SOURCE
)
63 @
[ -f
$(PKG_BUILD_DIR
)/.prepared
] ||
{ \
64 $(CMD_TRACE
) "preparing... "; \
65 $(MAKE
) $(PKG_BUILD_DIR
)/.prepared
$(MAKE_TRACE
); \
69 @
[ -f
$(PKG_BUILD_DIR
)/.configured
] ||
{ \
70 $(CMD_TRACE
) "configuring... "; \
71 $(MAKE
) $(PKG_BUILD_DIR
)/.configured
$(MAKE_TRACE
); \
76 @
$(CMD_TRACE
) "compiling... "
77 @
$(MAKE
) compile-targets
$(MAKE_TRACE
)
81 @
$(CMD_TRACE
) "installing... "
82 @
$(MAKE
) install-targets
$(MAKE_TRACE
)
86 $(CMD_TRACE
) "rebuilding... "
87 @
-$(MAKE
) mostlyclean 2>&1 >/dev
/null
88 if
[ -f
$(PKG_BUILD_DIR
)/.built
]; then \
89 $(MAKE
) clean $(MAKE_TRACE
); \
91 $(MAKE
) compile
$(MAKE_TRACE
)
93 $(PKG_BUILD_DIR
)/.configured
:
94 $(PKG_BUILD_DIR
)/.built
:
101 @
$(CMD_TRACE
) "cleaning... "
102 @
$(MAKE
) clean-targets
$(MAKE_TRACE
)
103 rm -rf
$(PKG_BUILD_DIR
)
105 .PHONY
: all source prepare compile
install clean