From ba3359722cbf8aa7b0ed39e1f81d1d74ec88fecd Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 30 May 2009 20:39:07 +0200 Subject: 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 --- mk/buildhlp.mk | 2 +- mk/fetch.mk | 2 +- mk/linux.mk | 2 +- mk/package.mk | 20 ++++++++++++++++---- mk/pkg-bottom.mk | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) (limited to 'mk') diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk index 128f3a54c..386fbbec4 100644 --- a/mk/buildhlp.mk +++ b/mk/buildhlp.mk @@ -3,7 +3,7 @@ # This file is part of the OpenADK project. OpenADK is copyrighted # material, please see the LICENCE file in the top-level directory. -ifneq ($(strip ${MASTER_SITES}),) +ifneq ($(strip ${PKG_SITES}),) ifeq ($(strip ${DISTFILES}),) DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz endif diff --git a/mk/fetch.mk b/mk/fetch.mk index c4625ccee..dc593be0b 100644 --- a/mk/fetch.mk +++ b/mk/fetch.mk @@ -69,7 +69,7 @@ $(1): fi; \ mkdir -p "$$$${fullname%%/$$$$filename}"; \ cd "$$$${fullname%%/$$$$filename}"; \ - for site in $${MASTER_SITES} $${MASTER_SITE_BACKUP}; do \ + for site in $${PKG_SITES} $${MASTER_SITE_BACKUP}; do \ : echo "$${FETCH_CMD} $$$$site$$$$filename"; \ rm -f "$$$$filename"; \ if $${FETCH_CMD} $$$$site$$$$filename; then \ diff --git a/mk/linux.mk b/mk/linux.mk index e9d17e231..c2b226bc7 100644 --- a/mk/linux.mk +++ b/mk/linux.mk @@ -7,5 +7,5 @@ PKG_NAME:= linux PKG_VERSION:= $(KERNEL_VERSION) PKG_RELEASE:= $(KERNEL_RELEASE) PKG_MD5SUM= $(KERNEL_MD5SUM) +PKG_SITES= ${MASTER_SITE_KERNEL:=kernel/v2.6/} DISTFILES= $(PKG_NAME)-$(PKG_VERSION).tar.bz2 -MASTER_SITES= ${MASTER_SITE_KERNEL:=kernel/v2.6/} 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"; \ diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk index 1f366ab53..e1c7d2e53 100644 --- a/mk/pkg-bottom.mk +++ b/mk/pkg-bottom.mk @@ -116,7 +116,7 @@ else @exit 1 endif ifneq ($(filter confprog,${INSTALL_STYLE}),) - for a in ${WRKINST}/usr/{bin/*-config,lib/pkgconfig/*.pc}; do \ + @for a in ${WRKINST}/usr/{bin/*-config,lib/pkgconfig/*.pc}; do \ [[ -e $$a ]] || continue; \ $(SED) "s,^prefix=.*,prefix=${STAGING_DIR}/usr," $$a; \ done -- cgit v1.2.3