1 # invoke ipkg with configuration in $(STAGING_DIR)/etc/ipkg.conf
2 IPKG
:= IPKG_INSTROOT
=$(TARGET_DIR
) IPKG_CONF_DIR
=$(IPKG_CONF
) $(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
3 IPKG_STATE_DIR
:= $(TARGET_DIR
)/usr
/lib
/ipkg
11 IPKG_
$(1):=$(PACKAGE_DIR
)/$(2)_
$(3)_
$(4).ipk
12 IDIR_
$(1):=$(PKG_BUILD_DIR
)/ipkg
/$(2)
13 INFO_
$(1):=$(IPKG_STATE_DIR
)/info/$(2).list
15 ifneq ($(BR2_PACKAGE_
$(1)),)
16 compile-targets
: $$(IPKG_
$(1))
19 compile-targets
: $$(IPKG_
$(1))
21 ifeq ($(BR2_PACKAGE_
$(1)),y
)
22 install-targets
: $$(INFO_
$(1))
25 IDEPEND_
$(1):=$$(strip $(5))
27 $$(IDIR_
$(1))/CONTROL
/control
: $(PKG_BUILD_DIR
)/.prepared
28 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(IDIR_
$(1)) .
/ipkg
/$(2).control
$(3) $(4)
29 if
[ "$$(IDEPEND_$(1))" != "" ]; then echo
"Depends: $$(IDEPEND_$(1))" >> $$(IDIR_
$(1))/CONTROL
/control
; fi
30 for file in conffiles preinst postinst prerm postrm
; do \
31 [ -f .
/ipkg
/$(2).
$$$$file ] && cp .
/ipkg
/$(2).
$$$$file $$(IDIR_
$(1))/CONTROL
/$$$$file || true
; \
34 $$(IPKG_
$(1)): $$(IDIR_
$(1))/CONTROL
/control
$(PKG_BUILD_DIR
)/.built
$(PACKAGE_DIR
)
36 $$(INFO_
$(1)): $$(IPKG_
$(1))
37 $(IPKG
) install $$(IPKG_
$(1))
41 clean-targets
: $(2)-clean
45 ifneq ($(strip $(PKG_SOURCE
)),)
46 $(DL_DIR
)/$(PKG_SOURCE
):
47 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL
)
50 ifneq ($(strip $(PKG_CAT
)),)
51 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
52 rm -rf
$(PKG_BUILD_DIR
)
53 mkdir
-p
$(PKG_BUILD_DIR
)
54 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(PKG_BUILD_DIR
)/..
$(TAR_OPTIONS
)
55 if
[ -d .
/patches
]; then \
56 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
; \
58 touch
$(PKG_BUILD_DIR
)/.prepared
67 source
: $(DL_DIR
)/$(PKG_SOURCE
)
68 prepare
: $(PKG_BUILD_DIR
)/.prepared
69 compile
: compile-targets
70 install: install-targets
74 if
[ -f
$(PKG_BUILD_DIR
)/.built
]; then \
79 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
80 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
86 rm -rf
$(PKG_BUILD_DIR
)
88 .PHONY
: all source prepare compile
install clean