1 # invoke ipkg with configuration in $(STAGING_DIR)/etc/ipkg.conf
2 IPKG
:= IPKG_INSTROOT
=$(TARGET_DIR
) IPKG_CONF_DIR
=$(STAGING_DIR
)/etc
$(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
3 IPKG_STATE_DIR
:= $(TARGET_DIR
)/usr
/lib
/ipkg
5 # invoke ipkg-build with some default options
6 IPKG_BUILD
:= PATH
="$(TARGET_PATH)" ipkg-build
-c
-o root
-g root
8 # where to build (and put) .ipk packages
9 IPKG_TARGET_DIR
:= $(PACKAGE_DIR
)
17 IPKG_
$(1):=$(PACKAGE_DIR
)/$(2)_
$(3)_
$(4).ipk
18 IDIR_
$(1):=$(PKG_BUILD_DIR
)/ipkg
/$(2)
19 INFO_
$(1):=$(IPKG_STATE_DIR
)/info/$(2).list
21 ifneq ($(BR2_PACKAGE_
$(1)),)
22 compile-targets
: $$(IPKG_
$(1))
24 ifneq ($(DEVELOPER
)$(SDK
),)
25 compile-targets
: $$(IPKG_
$(1))
27 ifeq ($(BR2_PACKAGE_
$(1)),y
)
28 install-targets
: $$(INFO_
$(1))
31 IDEPEND_
$(1):=$$(strip $(5))
33 $$(IDIR_
$(1))/CONTROL
/control
: $(PKG_BUILD_DIR
)/.prepared
34 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(IDIR_
$(1)) .
/ipkg
/$(2).control
$(3) $(4)
35 if
[ "$$(IDEPEND_$(1))" != "" ]; then echo
"Depends: $$(IDEPEND_$(1))" >> $$(IDIR_
$(1))/CONTROL
/control
; fi
36 for file in conffiles preinst postinst prerm postrm
; do \
37 [ -f .
/ipkg
/$(2).
$$$$file ] && cp .
/ipkg
/$(2).
$$$$file $$(IDIR_
$(1))/CONTROL
/$$$$file || true
; \
40 $$(IPKG_
$(1)): $$(IDIR_
$(1))/CONTROL
/control
$(PKG_BUILD_DIR
)/.built
$(PACKAGE_DIR
)
42 $$(INFO_
$(1)): $$(IPKG_
$(1))
43 $(IPKG
) install $$(IPKG_
$(1))
47 clean-targets
: $(2)-clean
51 ifneq ($(strip $(PKG_SOURCE
)),)
52 $(DL_DIR
)/$(PKG_SOURCE
):
53 $(SCRIPT_DIR
)/download.pl
"$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL
)
56 ifneq ($(strip $(PKG_CAT
)),)
57 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
58 rm -rf
$(PKG_BUILD_DIR
)
59 mkdir
-p
$(PKG_BUILD_DIR
)
60 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(PKG_BUILD_DIR
)/..
$(TAR_OPTIONS
)
61 if
[ -d .
/patches
]; then \
62 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
; \
64 touch
$(PKG_BUILD_DIR
)/.prepared
73 source
: $(DL_DIR
)/$(PKG_SOURCE
)
74 prepare
: $(PKG_BUILD_DIR
)/.prepared
75 compile
: compile-targets
76 install: install-targets
80 if
[ -f
$(PKG_BUILD_DIR
)/.built
]; then \
85 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
86 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
92 rm -rf
$(PKG_BUILD_DIR
)
94 .PHONY
: all source prepare compile
install clean