aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk92
1 files changed, 62 insertions, 30 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index e36454bb6e24..1715acaa2f28 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1241,14 +1241,13 @@ UNIQUENAME?= ${LATEST_LINK}
UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
.endif
OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options
-_OPTIONSFILE!= ${ECHO_CMD} "${OPTIONSFILE}"
.if defined(OPTIONS)
# include OPTIONSFILE first if exists
-. if exists(${_OPTIONSFILE}) && !make(rmconfig)
-. include "${_OPTIONSFILE}"
+. if exists(${OPTIONSFILE}) && !make(rmconfig)
+. include "${OPTIONSFILE}"
. endif
-. if exists(${_OPTIONSFILE}.local)
-. include "${_OPTIONSFILE}.local"
+. if exists(${OPTIONSFILE}.local)
+. include "${OPTIONSFILE}.local"
. endif
WITHOUT:=
WITH:=
@@ -1654,7 +1653,7 @@ PATCH_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
HAVE_COMPAT_IA32_LIBS?= YES
.endif
.if !defined(HAVE_COMPAT_IA32_KERN)
-HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -a compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi
+HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi
.endif
.endif
@@ -3283,8 +3282,8 @@ options-message:
.endif
.if defined(_OPTIONS_READ)
@${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
-.if ${OPTIONSFILE} != ${_OPTIONSFILE}
- @${ECHO_MSG} "===> *** CAUTION *** Using wrong configuration file ${_OPTIONSFILE}"
+.if ${OPTIONSFILE} != ${OPTIONSFILE}
+ @${ECHO_MSG} "===> *** CAUTION *** Using wrong configuration file ${OPTIONSFILE}"
.endif
.endif
@@ -5300,14 +5299,46 @@ missing:
# If this ever changes, portmgr should contact the portsnap maintainer
# first to avoid gratuitous breakage.
-.if !target(describe)
+# XXX Older versions do not support the :u make modifier. The .else
+# clause can be removed once 6.3-RELEASE is no longer supported.
+.if ${OSVERSION} >= 603104
+. if !target(describe)
+_EXTRACT_DEPENDS=${EXTRACT_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
+_PATCH_DEPENDS=${PATCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
+_FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
+_LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u}
+_BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
+_RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :]+)(:[^ :]+)?/\1/:O:u} ${_LIB_DEPENDS}
+. if exists(${DESCR})
+_DESCR=${DESCR}
+. else
+_DESCR=/dev/null
+. endif
+
+describe:
+ @${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
+ ${ECHO_CMD} -n ${COMMENT:Q}; \
+ ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \
+ while read one two discard; do \
+ case "$$one" in \
+ WWW:) case "$$two" in \
+ https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \
+ *) ${ECHO_CMD} -n "http://$$two" ;; \
+ esac; \
+ break; \
+ ;; \
+ esac; \
+ done < ${DESCR}; ${ECHO_CMD}
+. endif
+.else
+. if !target(describe)
describe:
@${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"
-.if defined(COMMENT)
+. if defined(COMMENT)
@${ECHO_CMD} -n ${COMMENT:Q}
-.else
+. else
@${ECHO_CMD} -n '** No Description'
-.endif
+. endif
@perl -e ' \
if ( -f q{${DESCR}} ) { \
print q{|${DESCR}}; \
@@ -5362,6 +5393,7 @@ describe:
} \
} \
print qq{\n};'
+. endif
.endif
www-site:
@@ -5786,23 +5818,23 @@ config:
.if !defined(OPTIONS)
@${ECHO_MSG} "===> No options to configure"
.else
-.if ${OPTIONSFILE} != ${_OPTIONSFILE}
- @${ECHO_MSG} "===> Using wrong configuration file ${_OPTIONSFILE}"
+.if ${OPTIONSFILE} != ${OPTIONSFILE}
+ @${ECHO_MSG} "===> Using wrong configuration file ${OPTIONSFILE}"
@exit 1
.endif
.if ${UID} != 0 && !defined(INSTALL_AS_USER)
- @optionsdir=${_OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
+ @optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
(${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
${ECHO_MSG} "===> Returning to user credentials"
.else
- @(optionsdir=${_OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
+ @(optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
${MKDIR} $${optionsdir} 2> /dev/null) || \
(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
.endif
- -@if [ -e ${_OPTIONSFILE} ]; then \
- . ${_OPTIONSFILE}; \
+ -@if [ -e ${OPTIONSFILE} ]; then \
+ . ${OPTIONSFILE}; \
fi; \
set -- ${OPTIONS} XXX; \
while [ $$# -gt 3 ]; do \
@@ -5852,11 +5884,11 @@ config:
fi; \
done; \
if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
- ${ECHO_MSG} "===> Switching to root credentials to write ${_OPTIONSFILE}"; \
- ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${_OPTIONSFILE}"; \
+ ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONSFILE}"; \
+ ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}"; \
${ECHO_MSG} "===> Returning to user credentials"; \
else \
- ${CAT} $${TMPOPTIONSFILE} > ${_OPTIONSFILE}; \
+ ${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}; \
fi; \
${RM} -f $${TMPOPTIONSFILE}
.endif
@@ -5873,9 +5905,9 @@ config-recursive:
.if !target(config-conditional)
config-conditional:
.if defined(OPTIONS)
-.if exists(${_OPTIONSFILE})
+.if exists(${OPTIONSFILE})
# scan saved options and invalidate them, if the set of options does not match
- @. ${_OPTIONSFILE}; \
+ @. ${OPTIONSFILE}; \
set ${OPTIONS} XXX; \
while [ $$# -gt 3 ]; do \
withvar=WITH_$$1; \
@@ -5907,8 +5939,8 @@ config-conditional:
showconfig:
.if defined(OPTIONS)
@${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}:"
- -@if [ -e ${_OPTIONSFILE} ]; then \
- . ${_OPTIONSFILE}; \
+ -@if [ -e ${OPTIONSFILE} ]; then \
+ . ${OPTIONSFILE}; \
fi; \
set -- ${OPTIONS} XXX; \
while [ $$# -gt 3 ]; do \
@@ -5933,16 +5965,16 @@ showconfig:
.if !target(rmconfig)
rmconfig:
-.if defined(OPTIONS) && exists(${_OPTIONSFILE})
+.if defined(OPTIONS) && exists(${OPTIONSFILE})
-@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
- optionsdir=${_OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
+ optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
- ${ECHO_MSG} "===> Switching to root credentials to remove ${_OPTIONSFILE} and $${optionsdir}"; \
- ${SU_CMD} "${RM} -f ${_OPTIONSFILE} ; \
+ ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \
+ ${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \
${RMDIR} $${optionsdir}"; \
${ECHO_MSG} "===> Returning to user credentials"; \
else \
- ${RM} -f ${_OPTIONSFILE}; \
+ ${RM} -f ${OPTIONSFILE}; \
${RMDIR} $${optionsdir}; \
fi
.else