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
This commit is contained in:
Baptiste Daroussin 2015-03-05 00:13:42 +00:00
parent eed8bc1862
commit ca0abefb74
6 changed files with 84 additions and 1 deletions

View File

@ -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}

View File

@ -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"; \

View File

@ -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 = <<EOD
%DESC%
EOD

View File

@ -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 = <<EOD
%DESC%
EOD

View File

@ -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 = <<EOD
%DESC%
EOD

View File

@ -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 = <<EOD
%DESC%
EOD