diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2009-05-30 20:39:07 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2009-05-30 20:39:07 +0200 |
commit | ba3359722cbf8aa7b0ed39e1f81d1d74ec88fecd (patch) | |
tree | 10c726d162bc0ded85eb7aeacf8f246bd39ad63a /mk/package.mk | |
parent | bbd610f15a71b27c955175cb98392b114717fd47 (diff) |
optimize ipkg package management
- generate ipkg control file from PKG_* variables
- automatically install init scripts from ./files/*.init
set #PKG pkgname to set the binary package
- rename FWINIT -> INIT
- move postinst and conffiles meta data to ./files
- update the packages to the latest upstream version
- remove some unready or unused package (strongswan,..)
more cleanups needed after allmodconfig
Diffstat (limited to 'mk/package.mk')
-rw-r--r-- | mk/package.mk | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mk/package.mk b/mk/package.mk index 03e07e2ed..b635d6a40 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -106,9 +106,11 @@ build-all-ipkgs: ${_IPKGS_COOKIE} # there are some parameters to the PKG_template function # 1.) Config.in identifier ADK_PACKAGE_$(1) # 2.) name of the package, for single package mostly $(PKG_NAME) -# 3.) package version (upstream version) and package revision (adk revision), -# always $(PKG_VERSION)-$(PKG_REVISION) +# 3.) package version (upstream version) and package release (adk version), +# always $(PKG_VERSION)-$(PKG_RELEASE) # 4.) dependencies to other packages, $(PKG_DEPENDS) +# 5.) description for the package, $(PKG_DESCR) +# 6.) section of the package, $(PKG_SECTION) # # should be package format independent and modular in the future define PKG_template @@ -127,8 +129,11 @@ endif IDEPEND_$(1):= $$(strip $(4)) _ALL_CONTROLS+= $$(IDIR_$(1))/CONTROL/control -ICONTROL_$(1)?= ipkg/$(2).control +ICONTROL_$(1)?= $(WRKDIR)/.$(2).control $$(IDIR_$(1))/CONTROL/control: ${_PATCH_COOKIE} + @echo "Package: $(2)" > $(WRKDIR)/.$(2).control + @echo "Section: $(6)" >> $(WRKDIR)/.$(2).control + @echo "Description: $(5)" >> $(WRKDIR)/.$(2).control ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $${IDIR_$(1)} $${ICONTROL_$(1)} $(3) ${CPU_ARCH} @adeps='$$(strip $${IDEPEND_$(1)})'; if [[ -n $$$$adeps ]]; then \ comma=; \ @@ -146,7 +151,7 @@ $$(IDIR_$(1))/CONTROL/control: ${_PATCH_COOKIE} echo "Depends: $$$$deps" >>$${IDIR_$(1)}/CONTROL/control; \ fi @for file in conffiles preinst postinst prerm postrm; do \ - [ ! -f ./ipkg/$(2).$$$$file ] || cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \ + [ ! -f ./files/$(2).$$$$file ] || cp ./files/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \ done # FIXME: special case for device dependent base-files package ifneq ($(strip $${ICONTROL_ADDON_$(1)}),) @@ -157,6 +162,13 @@ $$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $${_FAKE_COOKIE} ifeq ($(ADK_DEBUG),) $${RSTRIP} $${IDIR_$(1)} $(MAKE_TRACE) endif + @for file in $$$$(ls ./files/*.init 2>/dev/null); do \ + fname=$$$$(echo $$$$file| sed -e "s#.*/##" -e "s#.init##"); \ + check=$$$$(grep PKG $$$$file|cut -d ' ' -f 2); \ + if [ "$$$$check" == $(2) ];then \ + mkdir -p $$(IDIR_$(1))/etc/init.d && cp $$$$file $$(IDIR_$(1))/etc/init.d/$$$$fname; \ + fi; \ + done @cd $${IDIR_$(1)}; for script in etc/init.d/*; do \ [[ -e $$$$script ]] || continue; \ chmod 0755 "$$$$script"; \ |