xref: /freebsd/release/scripts/make-pkg-package.sh (revision bf115203bb8a61bd03ba23931ff0b5bf931b7d1b)
1#!/bin/sh
2
3# Simulate the build environment.  Note that we need to unset some variables
4# which are set in the src tree since they have different (unwanted) effects
5# in the ports tree.
6SRC_PKG_VERSION=${PKG_VERSION}
7PKG_ABI=$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)
8unset PKG_VERSION
9unset MAKEFLAGS
10unset PKGBASE
11export WRKDIRPREFIX=/tmp/ports.${TARGET}
12export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR)
13
14make -C ${PORTSDIR}/ports-mgmt/pkg TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
15	CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \
16	BATCH=YES stage create-manifest
17
18${PKG_CMD} -o ABI=${PKG_ABI} \
19	create -v -m ${WRKDIR}/.metadir.pkg/ \
20	-r ${WRKDIR}/stage \
21	-p ${WRKDIR}/.PLIST.mktmp \
22	-o ${REPODIR}/${PKG_ABI}/${SRC_PKG_VERSION}
23