xref: /freebsd/release/scripts/make-pkg-package.sh (revision 74d9553e43cfafc29448d0bb836916aa21dea0de)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# Simulate the build environment.
7eval $(make -C ${SRCDIR} TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} buildenvvars)
8export WRKDIRPREFIX=/tmp/ports.${TARGET}
9export WSTAGEDIR=${WSTAGEDIR}
10export REPODIR=${REPODIR}
11export PKG_CMD=${PKG_CMD}
12export PKG_VERSION=${PKG_VERSION}
13export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR)
14
15make -C ${PORTSDIR}/ports-mgmt/pkg TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
16	CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \
17	stage create-manifest
18
19${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \
20	create -v -m ${WRKDIR}/.metadir/ \
21	-r ${WRKDIR}/stage \
22	-p ${WRKDIR}/.PLIST.mktmp \
23	-o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
24mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/
25cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \
26	ln -s ../pkg-*.txz
27