aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.subdir.mk
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2007-08-08 11:46:04 +0800
committerkris <kris@FreeBSD.org>2007-08-08 11:46:04 +0800
commit0aed0939f4fd7f64eb185f1fad39d8ab09325fad (patch)
tree5a80fae520fd09a0374ef30d2f451db99a816a48 /Mk/bsd.port.subdir.mk
parent3dbc99ae3bae0d9a381d880afd4569f013158f17 (diff)
downloadfreebsd-ports-gnome-0aed0939f4fd7f64eb185f1fad39d8ab09325fad.tar.gz
freebsd-ports-gnome-0aed0939f4fd7f64eb185f1fad39d8ab09325fad.tar.zst
freebsd-ports-gnome-0aed0939f4fd7f64eb185f1fad39d8ab09325fad.zip
* Shuffle some important variable definitions to early in the file,
notably PORTSDIR. The previous commit introduced a use-before-define with respect to this variable, which broke things like portmaster. * Drop support for COMMENTFILE and a vestigial remnant of NetBSD support.
Diffstat (limited to 'Mk/bsd.port.subdir.mk')
-rw-r--r--Mk/bsd.port.subdir.mk46
1 files changed, 19 insertions, 27 deletions
diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk
index 0a3cecb5a55d..40d0dac65ca7 100644
--- a/Mk/bsd.port.subdir.mk
+++ b/Mk/bsd.port.subdir.mk
@@ -40,6 +40,21 @@
# Search for ports using either 'make search key=<keyword>'
# or 'make search name=<keyword>'.
+PORTSDIR?= /usr/ports
+TEMPLATES?= ${PORTSDIR}/Templates
+.if defined(PORTSTOP)
+README= ${TEMPLATES}/README.top
+.else
+README= ${TEMPLATES}/README.category
+.endif
+MOVEDDIR?= ${PORTSDIR}
+MOVEDFILE?= MOVED
+
+# XXX Are these needed here? DESCR was set wrong for a few years
+MASTERDIR?= ${.CURDIR}
+PKGDIR?= ${MASTERDIR}
+DESCR?= ${PKGDIR}/pkg-descr
+
.include "${PORTSDIR}/Mk/bsd.commands.mk"
.MAIN: all
@@ -66,6 +81,9 @@ OSVERSION!= ${SYSCTL} -n kern.osreldate
.endif
.endif
+INDEXDIR?= ${PORTSDIR}
+INDEXFILE?= INDEX-${OSVERSION:C/([0-9]).*/\1/}
+
UID!= ${ID} -u
.if exists(${LOCALBASE}/sbin/pkg_info)
PKG_INFO?= ${LOCALBASE}/sbin/pkg_info
@@ -249,28 +267,6 @@ readme:
@${MAKE} README.html
.endif
-.if (${OPSYS} == "NetBSD")
-PORTSDIR ?= /usr/opt
-.else
-PORTSDIR ?= /usr/ports
-.endif
-TEMPLATES ?= ${PORTSDIR}/Templates
-.if defined(PORTSTOP)
-README= ${TEMPLATES}/README.top
-.else
-README= ${TEMPLATES}/README.category
-.endif
-COMMENTFILE?= ${.CURDIR}/pkg/COMMENT
-DESCR?= ${.CURDIR}/pkg/DESCR
-INDEXDIR?= ${PORTSDIR}
-.if ${OSVERSION} >= 500036
-INDEXFILE?= INDEX-${OSVERSION:C/([0-9]).*/\1/}
-.else
-INDEXFILE?= INDEX
-.endif
-MOVEDDIR?= ${PORTSDIR}
-MOVEDFILE?= MOVED
-
HTMLIFY= ${SED} -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
package-name:
@@ -298,12 +294,8 @@ README.html:
.if defined(COMMENT)
@${ECHO_CMD} "${COMMENT}" | ${HTMLIFY} > $@.tmp4
.else
-.if exists(${COMMENTFILE})
- @${HTMLIFY} ${COMMENTFILE} > $@.tmp4
-.else
@> $@.tmp4
.endif
-.endif
@${CAT} ${README} | \
${SED} -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \
-e '/%%COMMENT%%/r$@.tmp4' \
@@ -415,7 +407,7 @@ _PORTSEARCH= \
break; \
}\
} \
- if (toprint == 1 ) disp[fields[d[i]]] = 1; \
+ if (toprint == 1 ) disp[fields[d[i]]] = 1; \
} \
} \
{ \