86c802289c34d38556a6360243657cac18ca5043
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 define BuildIPKGVariable
9 $(call shexport
,Package
/$(1)/$(2))
10 $(1)_COMMANDS
+= var2file
"$(call shvar,Package/$(1)/$(2))" $(2);
15 IPKG_
$(1):=$(PACKAGE_DIR
)/$(1)_
$(VERSION
)_
$(PKGARCH
).ipk
16 IDIR_
$(1):=$(PKG_BUILD_DIR
)/ipkg
/$(1)
17 INFO_
$(1):=$(IPKG_STATE_DIR
)/info/$(1).list
19 ifdef Package
/$(1)/install
20 ifneq ($(CONFIG_PACKAGE_
$(1))$(SDK
)$(DEVELOPER
),)
21 compile
: $$(IPKG_
$(1))
23 ifeq ($(CONFIG_PACKAGE_
$(1)),y
)
24 install: $$(INFO_
$(1))
27 ifneq ($(MAKECMDGOALS
),prereq
)
28 ifneq ($$(shell $(SCRIPT_DIR
)/timestamp.pl
-p
-x ipkg
-x ipkg-install
'$$(IPKG_$(1))' '$(PKG_BUILD_DIR)'),$$(IPKG_
$(1)))
29 $(PKG_BUILD_DIR
)/.built
: package-rebuild
30 $$(info Rebuilding
$(subst $(TOPDIR
)/,,$$(IPKG_
$(1))))
35 compile
: $(1)-disabled
37 @echo
"WARNING: skipping $(1) -- package not selected"
41 IDEPEND_
$(1):=$$(strip $$(DEPENDS
))
43 $(eval
$(call BuildIPKGVariable
,$(1),conffiles
))
44 $(eval
$(call BuildIPKGVariable
,$(1),preinst
))
45 $(eval
$(call BuildIPKGVariable
,$(1),postinst
))
46 $(eval
$(call BuildIPKGVariable
,$(1),prerm
))
47 $(eval
$(call BuildIPKGVariable
,$(1),postrm
))
48 $$(IDIR_
$(1))/CONTROL
/control
: $(PKG_BUILD_DIR
)/.version-
$(1)_
$(VERSION
)_
$(PKGARCH
)
49 @
rm -f
$(PACKAGE_DIR
)/$(1)_
*
50 mkdir
-p
$$(IDIR_
$(1))/CONTROL
51 echo
"Package: $(1)" > $$(IDIR_
$(1))/CONTROL
/control
52 echo
"Version: $(VERSION)" >> $$(IDIR_
$(1))/CONTROL
/control
54 DEPENDS
='$(EXTRA_DEPENDS)'; \
55 for depend in
$$(filter-out @
%,$$(IDEPEND_
$(1))); do \
56 DEPENDS
=$$$${DEPENDS
:+$$$$DEPENDS, }$$$${depend
##+}; \
58 echo
"Depends: $$$$DEPENDS"; \
59 echo
"Source: $(SOURCE)"; \
60 echo
"Section: $(SECTION)"; \
61 echo
"Priority: $(PRIORITY)"; \
62 echo
"Maintainer: $(MAINTAINER)"; \
63 echo
"Architecture: $(PKGARCH)"; \
64 echo
-n
"Description: "; getvar
$(call shvar
,Package
/$(1)/description
) | sed
-e
's,^[[:space:]]*, ,g'; \
65 ) >> $$(IDIR_
$(1))/CONTROL
/control
66 chmod
644 $$(IDIR_
$(1))/CONTROL
/control
67 (cd
$$(IDIR_
$(1))/CONTROL
; \
71 $$(IPKG_
$(1)): $(PKG_BUILD_DIR
)/.built
$$(IDIR_
$(1))/CONTROL
/control
72 $(call Package
/$(1)/install,$$(IDIR_
$(1)))
73 mkdir
-p
$(PACKAGE_DIR
)
74 -find
$$(IDIR_
$(1)) -name CVS | xargs
-r
rm -rf
75 -find
$$(IDIR_
$(1)) -name .svn | xargs
-r
rm -rf
76 -find
$$(IDIR_
$(1)) -name
'.#*' | xargs
-r
rm -f
77 $(RSTRIP
) $$(IDIR_
$(1))
78 $(IPKG_BUILD
) $$(IDIR_
$(1)) $(PACKAGE_DIR
)
79 @
[ -f
$$(IPKG_
$(1)) ] || false
81 $$(INFO_
$(1)): $$(IPKG_
$(1))
82 $(IPKG
) install $$(IPKG_
$(1))
85 rm -f
$(PACKAGE_DIR
)/$(1)_
*
89 $(PKG_BUILD_DIR
)/.version-
$(1)_
$(VERSION
)_
$(PKGARCH
): $(PKG_BUILD_DIR
)/.prepared
90 -@
rm -f
$(PKG_BUILD_DIR
)/.version-
$(1)_
* 2>/dev
/null
93 $$(eval
$$(call Build
/DefaultTargets
,$(1)))
This page took 0.041894 seconds and 3 git commands to generate.