pkg: "make upgrade" can be difficult in dev situations

Auto-detect PHP if possible, change FLAVOUR behaviour while at it.
This commit is contained in:
Franco Fichtner 2020-04-11 10:52:18 +02:00
parent d24a546a78
commit 5db335e02e
2 changed files with 23 additions and 6 deletions

View File

@ -54,12 +54,12 @@ CORE_SYSLOGD?= # empty
CORE_SYSLOGNG?= 3.25
CORE_UPDATE?= # empty
.if "${FLAVOUR}" == OpenSSL || "${FLAVOUR}" == ""
.if "${CORE_FLAVOUR}" == OpenSSL
CORE_REPOSITORY?= ${CORE_ABI}/latest
.elif "${FLAVOUR}" == LibreSSL
.elif "${CORE_FLAVOUR}" == LibreSSL
CORE_REPOSITORY?= ${CORE_ABI}/libressl
.else
CORE_REPOSITORY?= ${FLAVOUR}
CORE_REPOSITORY?= unsupported/${CORE_FLAVOUR:tl}
.endif
CORE_MESSAGE?= Carry on my wayward son
@ -286,10 +286,10 @@ package: plist-check package-check clean-wrksrc
@if ! ${PKG} info ${CORE_DEPEND} > /dev/null; then ${PKG} install -yfA ${CORE_DEPEND}; fi
.endfor
@echo -n ">>> Generating metadata for ${CORE_NAME}-${CORE_PKGVERSION}..."
@${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} metadata
@${MAKE} DESTDIR=${WRKSRC} CORE_FLAVOUR=${CORE_FLAVOUR} metadata
@echo " done"
@echo -n ">>> Staging files for ${CORE_NAME}-${CORE_PKGVERSION}..."
@${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} install
@${MAKE} DESTDIR=${WRKSRC} CORE_FLAVOUR=${CORE_FLAVOUR} install
@echo " done"
@echo ">>> Packaging files for ${CORE_NAME}-${CORE_PKGVERSION}:"
@PORTSDIR=${.CURDIR} ${PKG} create -f ${PKG_FORMAT} -v -m ${WRKSRC} \

View File

@ -28,8 +28,25 @@ PAGER?= less
OPENSSL?= ${LOCALBASE}/bin/openssl
_FLAVOUR!= if [ -f ${OPENSSL} ]; then ${OPENSSL} version; fi
.if exists(${OPENSSL})
_FLAVOUR!= ${OPENSSL} version
FLAVOUR?= ${_FLAVOUR:[1]}
.else
FLAVOUR?= Base # not supported without OpenSSL port
.endif
PHPBIN?= ${LOCALBASE}/bin/php
.if exists(${PHPBIN})
_CORE_PHP!= ${PHPBIN} -v
CORE_PHP?= ${_CORE_PHP:[2]:S/./ /g:[1..2]:tW:S/ //}
.endif
VERSIONBIN?= ${LOCALBASE}/sbin/opnsense-version
.if exists(${VERSIONBIN})
CORE_ABI!= ${VERSIONBIN} -a
.endif
PKG!= which pkg || echo true
GIT!= which git || echo true