pkg: fold package configuration code into main Makefile

This commit is contained in:
Franco Fichtner 2015-07-29 07:29:11 +02:00
parent 653e8a738d
commit 6950149bf5
7 changed files with 12 additions and 16 deletions

View file

@ -18,7 +18,7 @@ EOF
cat /etc/rc.bak >> /etc/rc
rm -f /etc/rc.bak
echo "Writing OPNsense version"
echo "Writing pacakge version"
mkdir -p /usr/local/opnsense/version
if [ -f /usr/local/opnsense/version/opnsense ]; then
mv /usr/local/opnsense/version/opnsense /usr/local/opnsense/version/opnsense.last

2
+PRE_INSTALL Normal file
View file

@ -0,0 +1,2 @@
echo "Removing previous package configuration"
rm -f /usr/local/etc/pkg/repos/origin.conf

View file

@ -19,10 +19,11 @@ CORE_VERSION= ${CORE_COMMIT:C/-.*$//1}
CORE_HASH= ${CORE_COMMIT:C/^.*-//1}
.if "${FLAVOUR}" == LibreSSL
CORE_REPOSITORY=libressl
CORE_REPOSITORY?= libressl
.else
CORE_REPOSITORY=latest
CORE_REPOSITORY?= latest
.endif
CORE_PACKAGESITE?= http://pkg.opnsense.org
CORE_NAME?= opnsense-devel
CORE_ORIGIN?= opnsense/${CORE_NAME}
@ -138,22 +139,21 @@ depends: force
scripts: force
@mkdir -p ${DESTDIR}
@cp -v -- +PRE_DEINSTALL +POST_INSTALL ${DESTDIR}
@cp -v -- +PRE_DEINSTALL +PRE_INSTALL +POST_INSTALL ${DESTDIR}
@sed -i '' -e "s/%%CORE_COMMIT%%/${CORE_COMMIT}/g" \
${DESTDIR}/+POST_INSTALL
install: force
@${MAKE} -C ${.CURDIR}/pkg install DESTDIR=${DESTDIR}
# XXX don't want to pass down, but also don't want clutter
sed -i '' -e "s/%%CORE_REPOSITORY%%/${CORE_REPOSITORY}/g" \
${DESTDIR}/usr/local/etc/pkg/repos/origin.conf
@${MAKE} -C ${.CURDIR}/lang install DESTDIR=${DESTDIR}
@${MAKE} -C ${.CURDIR}/contrib install DESTDIR=${DESTDIR}
@mkdir -p ${DESTDIR}/usr/local
@cp -vr ${.CURDIR}/src/* ${DESTDIR}/usr/local
@sed -i '' -e "s/%%CORE_PACKAGESITE%%/${CORE_PACKAGESITE}/g" \
${DESTDIR}/usr/local/etc/pkg/repos/origin.conf.sample
@sed -i '' -e "s/%%CORE_REPOSITORY%%/${CORE_REPOSITORY}/g" \
${DESTDIR}/usr/local/etc/pkg/repos/origin.conf.sample
plist: force
@${MAKE} -C ${.CURDIR}/pkg plist
@${MAKE} -C ${.CURDIR}/lang plist
@${MAKE} -C ${.CURDIR}/contrib plist
@(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \
@ -176,8 +176,6 @@ sweep: force
find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \
! -name "*.map" -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/pkg -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/lang -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/scripts -type f -print0 | \

View file

@ -1,4 +0,0 @@
ROOT= /usr/local/etc/pkg
TREES= repos fingerprints
.include "../Mk/tree.mk"

View file

@ -1,6 +1,6 @@
OPNsense: {
fingerprints: "/usr/local/etc/pkg/fingerprints/OPNsense",
url: "pkg+http://pkg.opnsense.org/${ABI}/%%CORE_REPOSITORY%%",
url: "pkg+%%CORE_PACKAGESITE%%/${ABI}/%%CORE_REPOSITORY%%",
signature_type: "fingerprints",
mirror_type: "srv",
priority: 11,