From ca0abefb746f3a59a0496ff0de157c0e429a8f79 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Thu, 5 Mar 2015 00:13:42 +0000 Subject: [PATCH] Add new create-world-packages target to generated the packages out of world Dynamically figure out the list of targets based on tags passed on the mtrees First sanity check that all packages have existing manifests Generate the packages Please note that for now the mtree needs more work as it has duplicate entries, everything is not yet tagged The packages now have generic entries and needs to be customize --- Makefile | 2 +- Makefile.inc1 | 31 ++++++++++++++++++++++++++ release/packages/development/+MANIFEST | 13 +++++++++++ release/packages/docs/+MANIFEST | 13 +++++++++++ release/packages/profile/+MANIFEST | 13 +++++++++++ release/packages/runtime/+MANIFEST | 13 +++++++++++ 6 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 release/packages/development/+MANIFEST create mode 100644 release/packages/docs/+MANIFEST create mode 100644 release/packages/profile/+MANIFEST create mode 100644 release/packages/runtime/+MANIFEST diff --git a/Makefile b/Makefile index a861005aace5..f9f0f939ad5f 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ - xdev-links native-xtools kernel-pkgs stageworld \ + xdev-links native-xtools kernel-pkgs stageworld create-world-packages TGTS+= ${SUBDIR_TARGETS} diff --git a/Makefile.inc1 b/Makefile.inc1 index dd1363a63628..b76837873fb7 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1195,6 +1195,37 @@ packagekernel: .endfor .endif +create-world-packages: +.if !defined(NO_ROOT) + @echo "ERROR: create-world-package can only be done with -DNO_ROOT"; \ + false +.endif + @cd ${DESTDIR} ; \ + awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ + ${DESTDIR}/METALOG + @for plist in ${DESTDIR}/*.plist; do \ + plist=$${plist##*/} ; \ + test -d ${SRCDIR}/release/packages/$${plist%.plist} || \ + ( echo "Unkown package FreeBSD-$${plist%.plist}" ; false ) ; \ + done + @for plist in ${DESTDIR}/*.plist; do \ + plist=$${plist##*/} ; \ + pkgname=$${plist%.plist} ; \ + rm -rf ${DESTDIR}/$${pkgname}-manifestdir ; \ + cp -r ${SRCDIR}/release/packages/$${pkgname} \ + ${DESTDIR}/$${pkgname}-manifestdir ; \ + sed -i '' -e "s/%VERSION%/${PKG_VERSION}/" \ + -e "s/%PKGNAME%/$${pkgname}/" \ + -e "s/%COMMENT%/Generic comment for $${pkgname}/" \ + -e "s/%DESC%/Generic description for $${pkgname}/" \ + ${DESTDIR}/$${pkgname}-manifestdir/+MANIFEST ; \ + awk -F\" '/name/ { printf("===> Creating %s-", $$2) } /version/ {print $$2 }' \ + ${DESTDIR}/$${pkgname}-manifestdir/+MANIFEST ; \ + pkg create -m ${DESTDIR}/$${pkgname}-manifestdir \ + -p ${DESTDIR}/$${pkgname}.plist \ + -r ${DESTDIR} -o ${DESTDIR} ; \ + done + kernel-pkgs: .if !defined(NO_ROOT) @echo "ERROR: kernel-pkgs can only be done with -DNO_ROOT"; \ diff --git a/release/packages/development/+MANIFEST b/release/packages/development/+MANIFEST new file mode 100644 index 000000000000..862adb1b89d9 --- /dev/null +++ b/release/packages/development/+MANIFEST @@ -0,0 +1,13 @@ +name = "FreeBSD-%PKGNAME%" +origin = "base" +version = "%VERSION%" +comment = "%COMMENT%" +categories = [ base ] +maintainer = "re@FreeBSD.org" +www = "http://www.FreeBSD.org" +prefix = "/" +licenselogic = "single" +licenses = [ BSD2CLAUSE ] +desc = <