diff options
author | Mark Linimon <linimon@FreeBSD.org> | 2007-08-10 23:33:02 +0000 |
---|---|---|
committer | Mark Linimon <linimon@FreeBSD.org> | 2007-08-10 23:33:02 +0000 |
commit | 60c62198eb262d50df0f68813ee09f74156a7a82 (patch) | |
tree | 20e229c9b206d2bb4f7f2efdec22d8f07ec3c3d5 /ports-mgmt | |
parent | 1e918f114b0ae3bdb696e7eea2bd93076f37c1f7 (diff) |
Notes
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/portmk/Mk/bsd.port.subdir.mk | 128 |
1 files changed, 61 insertions, 67 deletions
diff --git a/ports-mgmt/portmk/Mk/bsd.port.subdir.mk b/ports-mgmt/portmk/Mk/bsd.port.subdir.mk index 062e6e1e7063..e2db90df3197 100644 --- a/ports-mgmt/portmk/Mk/bsd.port.subdir.mk +++ b/ports-mgmt/portmk/Mk/bsd.port.subdir.mk @@ -15,9 +15,6 @@ # own install script so that the entire system can be made # stripped/not-stripped using a single knob. [-s] # -# ECHO_MSG - Used to print all the '===>' style prompts - override this -# to turn them off [echo]. -# # OPSYS - Get the operating system type [`uname -s`] # # SUBDIR - A list of subdirectories that should be built as well. @@ -34,7 +31,8 @@ # clean-for-cdrom, clean-restricted, # clean-for-cdrom-list, clean-restricted-list, # configure, deinstall, -# depend, depends, describe, extract, fetch, fetch-list, ignorelist, +# depend, depends, describe, extract, fetch, fetch-list, +# ignorelist, ignorelist-verbose, # install, maintainer, makesum, package, readmes, realinstall, reinstall, # tags # @@ -42,6 +40,27 @@ # Search for ports using either 'make search key=<keyword>' # or 'make search name=<keyword>'. +PORTSDIR?= /usr/ports +DEVELPORTSDIR?= ${PORTSDIR}/ports-mgmt/portmk +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 + +.if exists(${DEVELPORTSDIR}/Mk/bsd.commands.mk) +.include "${DEVELPORTSDIR}/Mk/bsd.commands.mk" +.else +.include "${PORTSDIR}/Mk/bsd.commands.mk" +.endif .MAIN: all @@ -51,37 +70,37 @@ STRIP?= -s .if !defined(NOPRECIOUSMAKEVARS) .if !defined(ARCH) -ARCH!= ${DESTDIR}/usr/bin/uname -p +ARCH!= ${UNAME} -p .endif .if !defined(OSREL) -OSREL!= ${DESTDIR}/usr/bin/uname -r | sed -e 's/[-(].*//' +OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//' .endif .if !defined(OSVERSION) -.if exists(/sbin/sysctl) -OSVERSION!= /sbin/sysctl -n kern.osreldate +.if exists(/usr/include/sys/param.h) +OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h +.elif exists(/usr/src/sys/sys/param.h) +OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < /usr/src/sys/sys/param.h .else -OSVERSION!= /usr/sbin/sysctl -n kern.osreldate +OSVERSION!= ${SYSCTL} -n kern.osreldate .endif .endif .endif -ID?= ${DESTDIR}/usr/bin/id +INDEXDIR?= ${PORTSDIR} +INDEXFILE?= INDEX-${OSVERSION:C/([0-9]).*/\1/} + UID!= ${ID} -u -LOCALBASE?= ${DESTDIR}${LOCALBASE_REL} .if exists(${LOCALBASE}/sbin/pkg_info) PKG_INFO?= ${LOCALBASE}/sbin/pkg_info .else -PKG_INFO?= ${DESTDIR}/usr/sbin/pkg_info +PKG_INFO?= /usr/sbin/pkg_info .endif -SED?= ${DESTDIR}/usr/bin/sed PKGINSTALLVER!= ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //' .if !defined(OPSYS) -OPSYS!= ${DESTDIR}/usr/bin/uname -s +OPSYS!= ${UNAME} -s .endif -ECHO_MSG?= echo - # local customization of the ports tree .if exists(${.CURDIR}/Makefile.local) .include "${.CURDIR}/Makefile.local" @@ -104,6 +123,7 @@ TARGETS+= extract TARGETS+= fetch TARGETS+= fetch-list TARGETS+= ignorelist +TARGETS+= ignorelist-verbose TARGETS+= makesum TARGETS+= maintainer TARGETS+= package @@ -191,13 +211,13 @@ checksubdir: fi; \ done; \ if [ $$found = 0 ]; then \ - ${ECHO} "Warning: directory $$d not in SUBDIR"; \ + ${ECHO_MSG} "Warning: directory $$d not in SUBDIR"; \ fi; \ fi; \ done @for s in ${SUBDIR}; do \ if ! [ -d ${.CURDIR}/$$s ]; then \ - ${ECHO} "Warning: directory $$s in SUBDIR does not exist"; \ + ${ECHO_MSG} "Warning: directory $$s in SUBDIR does not exist"; \ fi \ done .endif @@ -223,11 +243,11 @@ describe: ${SUBDIR:S/^/_/:S/$/.describe/} .else describe: @for sub in ${SUBDIR}; do \ - if test -d ${.CURDIR}/$${sub}; then \ + if ${TEST} -d ${.CURDIR}/$${sub}; then \ ${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \ cd ${.CURDIR}/$${sub}; \ ${MAKE} -B describe || \ - (echo "===> ${DIRPRFX}$${sub} failed" >&2; \ + (${ECHO_CMD} "===> ${DIRPRFX}$${sub} failed" >&2; \ exit 1) ;\ else \ ${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ @@ -240,7 +260,7 @@ describe: .if defined(PORTSTOP) readmes: readme ${SUBDIR:S/^/_/:S/$/.readmes/} @${ECHO_MSG} "===> Creating README.html for all ports" - @perl ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} + @${PERL} ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} .else readmes: readme .endif @@ -248,67 +268,41 @@ readmes: readme .if !target(readme) readme: - @rm -f README.html - @make README.html + @${RM} -f README.html + @${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/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' +HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' package-name: - @echo ${.CURDIR} | sed -e 's^.*/^^' + @${ECHO_CMD} ${.CURDIR} | ${SED} -e 's^.*/^^' README.html: - @echo "===> Creating README.html" + @${ECHO_CMD} "===> Creating README.html" @> $@.tmp .for entry in ${SUBDIR} .if exists(${entry}) .if defined(PORTSTOP) - @echo -n '<a href="'${entry}/README.html'">'"`echo ${entry} | ${HTMLIFY}`"'</a>: ' >> $@.tmp + @${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`${ECHO_CMD} ${entry} | ${HTMLIFY}`"'</a>: ' >> $@.tmp .else - @echo -n '<a href="'${entry}/README.html'">'"`cd ${entry}; make package-name | ${HTMLIFY}`</a>: " >> $@.tmp + @${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`</a>: " >> $@.tmp .endif - @echo `cd ${entry}; make -V COMMENT` | ${HTMLIFY} >> $@.tmp + @${ECHO_CMD} `cd ${entry}; ${MAKE} -V COMMENT` | ${HTMLIFY} >> $@.tmp .endif .endfor - @sort -t '>' +1 -2 $@.tmp > $@.tmp2 + @${SORT} -t '>' +1 -2 $@.tmp > $@.tmp2 .if exists(${DESCR}) @${HTMLIFY} ${DESCR} > $@.tmp3 .else @> $@.tmp3 .endif .if defined(COMMENT) - @echo "${COMMENT}" | ${HTMLIFY} > $@.tmp4 -.else -.if exists(${COMMENTFILE}) - @${HTMLIFY} ${COMMENTFILE} > $@.tmp4 + @${ECHO_CMD} "${COMMENT}" | ${HTMLIFY} > $@.tmp4 .else @> $@.tmp4 .endif -.endif - @cat ${README} | \ - sed -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \ + @${CAT} ${README} | \ + ${SED} -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \ -e '/%%COMMENT%%/r$@.tmp4' \ -e '/%%COMMENT%%/d' \ -e '/%%DESCR%%/r$@.tmp3' \ @@ -316,7 +310,7 @@ README.html: -e '/%%SUBDIR%%/r$@.tmp2' \ -e '/%%SUBDIR%%/d' \ > $@ - @rm -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 + @${RM} -f $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 .if !defined(NOPRECIOUSMAKEVARS) .MAKEFLAGS: \ @@ -337,7 +331,7 @@ PORTSEARCH_MOVED?=1 _PORTSEARCH= \ here=${.CURDIR}; \ if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \ - echo "The ${.TARGET} target requires ${INDEXFILE}. Please run make index or make fetchindex."; \ + ${ECHO_MSG} "The ${.TARGET} target requires ${INDEXFILE}. Please run make index or make fetchindex."; \ else \ cd ${PORTSDIR}; \ if [ -z "$$key" -a -z "$$xkey" -a \ @@ -350,12 +344,12 @@ _PORTSEARCH= \ -z "$$rdeps" -a -z "$$xrdeps" -a \ -z "$$www" -a -z "$$xwww" ]; \ then \ - echo "The ${.TARGET} target requires a keyword parameter or name parameter,"; \ - echo "e.g.: \"make ${.TARGET} key=somekeyword\""; \ - echo "or \"make ${.TARGET} name=somekeyword\""; \ + ${ECHO_MSG} "The ${.TARGET} target requires a keyword parameter or name parameter,"; \ + ${ECHO_MSG} "e.g.: \"make ${.TARGET} key=somekeyword\""; \ + ${ECHO_MSG} "or \"make ${.TARGET} name=somekeyword\""; \ exit; \ fi; \ - awk -F\| -v there="$$here/" -v top="$$(pwd -P)" \ + ${AWK} -F\| -v there="$$here/" -v top="$$(pwd -P)" \ -v key="$$key" -v xkey="$$xkey" \ -v name="$$name" -v xname="$$xname" \ -v path="$$path" -v xpath="$$xpath" \ @@ -418,7 +412,7 @@ _PORTSEARCH= \ break; \ }\ } \ - if (toprint == 1 ) disp[fields[d[i]]] = 1; \ + if (toprint == 1 ) disp[fields[d[i]]] = 1; \ } \ } \ { \ @@ -449,7 +443,7 @@ _PORTSEARCH= \ }' ${INDEXDIR}/${INDEXFILE}; \ if [ "$$name" -o "$$xname" ] && [ ${PORTSEARCH_MOVED} -gt 0 ]; \ then \ - awk -F\| -v name="$$name" -v xname="$$xname" \ + ${AWK} -F\| -v name="$$name" -v xname="$$xname" \ -v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \ 'BEGIN { \ if (icase) { \ |