From f9371dca6065f2d700f9f61317cd5b65cb4ba856 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 22 Jan 2016 18:06:09 +0000 Subject: [PATCH] Create a _pkgbootstrap target, and remove the env(1) prefix to pkg(8) commands. Move the resulting packages outside STAGEDIR to minimize pollution. When invoking 'pkg create', include the ABI in the REPODIR path so the correct hierarchy is created for cross-builds. Move the STAGEDIR and REPODIR declarations above the targets that use them to keep things cleaner, and move the packages target. Include '-o ABIFILE=DESTDIR/bin/sh' in pkg(8) invocations in the create-kernel-packages target. Sponsored by: The FreeBSD Foundation --- Makefile.inc1 | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index e29faa2f5f4c..01440027f91b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1357,7 +1357,19 @@ packagekernel: .endif .endif -create-world-packages: +STAGEDIR= ${MAKEOBJDIRPREFIX}${.CURDIR}/stage +REPODIR= ${MAKEOBJDIRPREFIX}${.CURDIR}/repo + +_pkgbootstrap: + @env ASSUME_ALWAYS_YES=YES pkg bootstrap + +packages: _pkgbootstrap + @mkdir -p ${STAGEDIR} ${REPODIR} + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} -DNO_ROOT -B stageworld ; \ + ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} create-world-packages + +create-world-packages: _pkgbootstrap @rm -f ${DESTDIR}/*.plist 2>/dev/null || : @cd ${DESTDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ @@ -1384,21 +1396,13 @@ create-world-packages: /^name/ { printf("===> Creating %s-", $$2); next } \ /^version/ { print $$2; next } \ ' ${DESTDIR}/$${pkgname}.ucl ; \ - env ASSUME_ALWAYS_YES="YES" pkg -o ABI_FILE=${DESTDIR}/bin/sh \ + pkg -o ABI_FILE=${DESTDIR}/bin/sh \ create -M ${DESTDIR}/$${pkgname}.ucl \ -p ${DESTDIR}/$${pkgname}.plist \ - -r ${DESTDIR} -o ${DESTDIR} ; \ + -r ${DESTDIR} -o ${REPODIR}/$$(pkg config ABI)/latest ; \ done -STAGEDIR= ${MAKEOBJDIRPREFIX}${.CURDIR}/stage - -packages: - @mkdir -p ${MAKEOBJDIRPREFIX}${.CURDIR}/stage - ${_+_}@cd ${.CURDIR}; \ - ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} -DNO_ROOT -B stageworld ; \ - ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} create-world-packages - -create-kernel-packages: +create-kernel-packages: _pkgbootstrap @cd ${DESTDIR}/${DISTDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ ${DESTDIR}/${DISTDIR}/kernel.meta @@ -1415,7 +1419,7 @@ create-kernel-packages: ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir/+MANIFEST @awk -F\" '/name/ { printf("===> Creating %s-", $$2) } /version/ {print $$2 }' \ ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir/+MANIFEST - @env ASSUME_ALWAYS_YES="YES" pkg create -m ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir \ + @pkg -o ABI_FILE=${DESTDIR}/bin/sh create -m ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir \ -p ${DESTDIR}/${DISTDIR}/${flavor}.plist \ -r ${DESTDIR}/${DISTDIR}/kernel \ -o ${DESTDIR} @@ -1438,7 +1442,7 @@ create-kernel-packages: ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir/+MANIFEST @awk -F\" '/name/ { printf("===> Creating %s-", $$2) } /version/ {print $$2 }' \ ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir/+MANIFEST - @env ASSUME_ALWAYS_YES="YES" pkg create -m ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir \ + @pkg -o ABI_FILE=${DESTDIR}/bin/sh create -m ${DESTDIR}/${DISTDIR}/${flavor}-manifestdir \ -p ${DESTDIR}/${DISTDIR}/${flavor}.plist \ -r ${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ -o ${DESTDIR}