2 # Copyright (C) 2006,2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # where to build (and put) .ipk packages
10 IPKG_TMP
=$(TMP_DIR
)/ipkg \
11 IPKG_INSTROOT
=$(TARGET_DIR
) \
12 IPKG_CONF_DIR
=$(STAGING_DIR
)/etc \
13 IPKG_OFFLINE_ROOT
=$(TARGET_DIR
) \
14 $(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
16 # invoke ipkg-build with some default options
18 ipkg-build
-c
-o
0 -g
0
20 define BuildIPKGVariable
21 $(call shexport
,Package
/$(1)/$(2))
22 $(1)_COMMANDS
+= var2file
"$(call shvar,Package/$(1)/$(2))" $(2);
27 IPKG_
$(1):=$(PACKAGE_DIR
)/$(1)_
$(VERSION
)_
$(PKGARCH
).ipk
28 IDIR_
$(1):=$(PKG_BUILD_DIR
)/ipkg
/$(1)
29 INFO_
$(1):=$(IPKG_STATE_DIR
)/info/$(1).list
31 ifdef Package
/$(1)/install
32 ifneq ($(CONFIG_PACKAGE_
$(1))$(SDK
)$(DEVELOPER
),)
33 compile
: $$(IPKG_
$(1))
35 ifeq ($(CONFIG_PACKAGE_
$(1)),y
)
36 install: $$(INFO_
$(1))
39 compile
: $(1)-disabled
41 @echo
"WARNING: skipping $(1) -- package not selected"
45 IDEPEND_
$(1):=$$(strip $$(DEPENDS
))
47 $(eval
$(call BuildIPKGVariable
,$(1),conffiles
))
48 $(eval
$(call BuildIPKGVariable
,$(1),preinst
))
49 $(eval
$(call BuildIPKGVariable
,$(1),postinst
))
50 $(eval
$(call BuildIPKGVariable
,$(1),prerm
))
51 $(eval
$(call BuildIPKGVariable
,$(1),postrm
))
52 $$(IDIR_
$(1))/CONTROL
/control
: $(PKG_BUILD_DIR
)/.version-
$(1)_
$(VERSION
)_
$(PKGARCH
)
53 @
rm -f
$(PACKAGE_DIR
)/$(1)_
*
54 mkdir
-p
$$(IDIR_
$(1))/CONTROL
55 echo
"Package: $(1)" > $$(IDIR_
$(1))/CONTROL
/control
56 echo
"Version: $(VERSION)" >> $$(IDIR_
$(1))/CONTROL
/control
58 DEPENDS
='$(EXTRA_DEPENDS)'; \
59 for depend in
$$(filter-out @
%,$$(IDEPEND_
$(1))); do \
60 DEPENDS
=$$$${DEPENDS
:+$$$$DEPENDS, }$$$${depend
##+}; \
62 echo
"Depends: $$$$DEPENDS"; \
63 echo
"Source: $(SOURCE)"; \
64 echo
"Section: $(SECTION)"; \
65 echo
"Priority: $(PRIORITY)"; \
66 echo
"Maintainer: $(MAINTAINER)"; \
67 echo
"Architecture: $(PKGARCH)"; \
68 echo
-n
"Description: "; getvar
$(call shvar
,Package
/$(1)/description
) | sed
-e
's,^[[:space:]]*, ,g'; \
69 ) >> $$(IDIR_
$(1))/CONTROL
/control
70 chmod
644 $$(IDIR_
$(1))/CONTROL
/control
71 (cd
$$(IDIR_
$(1))/CONTROL
; \
75 $$(IPKG_
$(1)): $(STAGING_DIR
)/etc
/ipkg.conf
$(PKG_BUILD_DIR
)/.built
$$(IDIR_
$(1))/CONTROL
/control
76 $(call Package
/$(1)/install,$$(IDIR_
$(1)))
77 mkdir
-p
$(PACKAGE_DIR
)
78 -find
$$(IDIR_
$(1)) -name
'CVS' -o
-name
'.svn' -o
-name
'.#*' |
$(XARGS
) rm -rf
79 $(RSTRIP
) $$(IDIR_
$(1))
80 $(IPKG_BUILD
) $$(IDIR_
$(1)) $(PACKAGE_DIR
)
81 @
[ -f
$$(IPKG_
$(1)) ] || false
83 $$(INFO_
$(1)): $$(IPKG_
$(1))
84 $(IPKG
) install $$(IPKG_
$(1))
87 rm -f
$(PACKAGE_DIR
)/$(1)_
*
91 $(PKG_BUILD_DIR
)/.version-
$(1)_
$(VERSION
)_
$(PKGARCH
): $(STAMP_PREPARED
)
92 -@
rm -f
$(PKG_BUILD_DIR
)/.version-
$(1)_
* 2>/dev
/null
95 $$(eval
$$(call Build
/DefaultTargets
,$(1)))
99 $(STAGING_DIR
)/etc
/ipkg.conf
:
100 mkdir
-p
$(STAGING_DIR
)/etc
101 echo
"dest root /" > $(STAGING_DIR
)/etc
/ipkg.conf
102 echo
"option offline_root $(TARGET_DIR)" >> $(STAGING_DIR
)/etc
/ipkg.conf
This page took 0.051639 seconds and 5 git commands to generate.