From 6950149bf5d0e2828ecb6b7293b7edf4f6588ac2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jul 2015 07:29:11 +0200 Subject: [PATCH] pkg: fold package configuration code into main Makefile --- +POST_INSTALL | 2 +- +PRE_INSTALL | 2 ++ Makefile | 18 ++++++++---------- pkg/Makefile | 4 ---- .../OPNsense/trusted/pkg.opnsense.org.20150402 | 0 {pkg => src/etc/pkg}/repos/FreeBSD.conf | 0 .../etc/pkg/repos/origin.conf.sample | 2 +- 7 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 +PRE_INSTALL delete mode 100644 pkg/Makefile rename {pkg => src/etc/pkg}/fingerprints/OPNsense/trusted/pkg.opnsense.org.20150402 (100%) rename {pkg => src/etc/pkg}/repos/FreeBSD.conf (100%) rename pkg/repos/origin.conf => src/etc/pkg/repos/origin.conf.sample (71%) diff --git a/+POST_INSTALL b/+POST_INSTALL index 7fa23c1969..0453cf727a 100644 --- a/+POST_INSTALL +++ b/+POST_INSTALL @@ -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 diff --git a/+PRE_INSTALL b/+PRE_INSTALL new file mode 100644 index 0000000000..a65c8af0ca --- /dev/null +++ b/+PRE_INSTALL @@ -0,0 +1,2 @@ +echo "Removing previous package configuration" +rm -f /usr/local/etc/pkg/repos/origin.conf diff --git a/Makefile b/Makefile index 4b02b58950..04ccfaac79 100644 --- a/Makefile +++ b/Makefile @@ -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 | \ diff --git a/pkg/Makefile b/pkg/Makefile deleted file mode 100644 index a111503e0e..0000000000 --- a/pkg/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -ROOT= /usr/local/etc/pkg -TREES= repos fingerprints - -.include "../Mk/tree.mk" diff --git a/pkg/fingerprints/OPNsense/trusted/pkg.opnsense.org.20150402 b/src/etc/pkg/fingerprints/OPNsense/trusted/pkg.opnsense.org.20150402 similarity index 100% rename from pkg/fingerprints/OPNsense/trusted/pkg.opnsense.org.20150402 rename to src/etc/pkg/fingerprints/OPNsense/trusted/pkg.opnsense.org.20150402 diff --git a/pkg/repos/FreeBSD.conf b/src/etc/pkg/repos/FreeBSD.conf similarity index 100% rename from pkg/repos/FreeBSD.conf rename to src/etc/pkg/repos/FreeBSD.conf diff --git a/pkg/repos/origin.conf b/src/etc/pkg/repos/origin.conf.sample similarity index 71% rename from pkg/repos/origin.conf rename to src/etc/pkg/repos/origin.conf.sample index a318fc0fed..b265f24325 100644 --- a/pkg/repos/origin.conf +++ b/src/etc/pkg/repos/origin.conf.sample @@ -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,