aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--Mk/bsd.port.mk57
-rw-r--r--Mk/bsd.port.subdir.mk97
3 files changed, 121 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 6dabf0719bfe..785f21b93264 100644
--- a/Makefile
+++ b/Makefile
@@ -75,8 +75,16 @@ fetchindex:
INDEX_JOBS?= 2
+.if !defined(INDEX_VERBOSE)
+INDEX_ECHO_MSG= echo > /dev/null
+INDEX_ECHO_1ST= echo -n
+.else
+INDEX_ECHO_MSG= echo 1>&2
+INDEX_ECHO_1ST= echo
+.endif
+
${.CURDIR}/${INDEXFILE}:
- @echo -n "Generating ${INDEXFILE} - please wait.."; \
+ @${INDEX_ECHO_1ST} "Generating ${INDEXFILE} - please wait.."; \
if [ "${INDEX_PRISTINE}" != "" ]; then \
export LOCALBASE=/nonexistentlocal; \
export X11BASE=/nonexistentx; \
@@ -84,7 +92,7 @@ ${.CURDIR}/${INDEXFILE}:
tmpdir=`/usr/bin/mktemp -d -t index` || exit 1; \
trap "rm -rf $${tmpdir}; exit 1" 1 2 3 5 10 13 15; \
( cd ${.CURDIR} && make -j${INDEX_JOBS} INDEX_TMPDIR=$${tmpdir} BUILDING_INDEX=1 \
- ECHO_MSG="echo > /dev/null" describe ) || \
+ ECHO_MSG="${INDEX_ECHO_MSG}" describe ) || \
(rm -rf $${tmpdir} ; \
if [ "${INDEX_QUIET}" = "" ]; then \
echo; \
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index c34331bed764..ca6feedc4992 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -208,8 +208,10 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# USE_ICONV - Says that the port uses libiconv.
# USE_GETTEXT - Says that the port uses GNU gettext (libintl).
##
-# USE_PERL5 - Says that the port uses perl5 for building and running.
-# USE_PERL5_BUILD - Says that the port uses perl5 for building.
+# USE_PERL5 - Says that the port uses perl5 in one or more of the extract,
+# patch, build, install or run phases.
+# USE_PERL5_BUILD - Says that the port uses perl5 in one or more of the extract,
+# patch, build or install phases.
# USE_PERL5_RUN - Says that the port uses perl5 for running.
# PERL5 - Set to full path of perl5, either in the system or
# installed from a port.
@@ -1113,7 +1115,7 @@ PERL_PORT?= perl5
SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
-.if exists(/usr/bin/perl5) && ${OSVERSION} >= 300000 && ${OSVERSION} < 500036
+.if ${PERL_LEVEL} < 500600
PERL5= /usr/bin/perl${PERL_VERSION}
PERL= /usr/bin/perl
.else
@@ -1368,7 +1370,11 @@ LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv
.endif
.if defined(USE_GETTEXT)
-LIB_DEPENDS+= intl.6:${PORTSDIR}/devel/gettext
+. if ${USE_GETTEXT:L} == "yes"
+LIB_DEPENDS+= intl:${PORTSDIR}/devel/gettext
+. else
+LIB_DEPENDS+= intl.${USE_GETTEXT}:${PORTSDIR}/devel/gettext
+. endif
.endif
.if defined(USE_LINUX)
@@ -1392,7 +1398,7 @@ LIB_DEPENDS+= ttf.4:${PORTSDIR}/print/freetype
.if ${XFREE86_VERSION} == 3
.if defined(USE_IMAKE)
-BUILD_DEPENDS+= imake:${PORTSDIR}/devel/imake
+BUILD_DEPENDS+= imake:${PORTSDIR}/x11/XFree86
.endif
.if defined(USE_XPM)
LIB_DEPENDS+= Xpm.4:${PORTSDIR}/graphics/xpm
@@ -1452,15 +1458,10 @@ USE_PERL5= yes
USE_REINPLACE=yes
.endif
-.if exists(/usr/bin/perl5) && ${OSVERSION} >= 300000 && ${OSVERSION} < 500036
-.if !exists(/usr/bin/perl${PERL_VERSION}) && ( defined(USE_PERL5) || \
- defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) )
-check-depends::
- @${ECHO_CMD} "Dependency error: you don't have the right version of perl in /usr/bin."
- @${FALSE}
-.endif
-.else
+.if ${PERL_LEVEL} >= 500600
.if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
+EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
+PATCH_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
BUILD_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
.endif
.if defined(USE_PERL5) || defined(USE_PERL5_RUN)
@@ -2564,10 +2565,7 @@ IGNORE= "may not be placed on a CDROM: ${NO_CDROM}"
.elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
IGNORE= "is restricted: ${RESTRICTED}"
.elif defined(BROKEN)
-.if defined(PARALLEL_PACKAGE_BUILD)
-# try building even if marked BROKEN
-TRYBROKEN= yes
-.else
+.if !defined(TRYBROKEN)
IGNORE= "is marked as broken: ${BROKEN}"
.endif
.elif defined(FORBIDDEN)
@@ -2767,7 +2765,7 @@ check-deprecated:
@${ECHO_MSG} "${DEPRECATED}."
@${ECHO_MSG}
.if defined(EXPIRATION_DATE)
- @${ECHO_MSG} "It is scheduled to be removed ${EXPIRATION_DATE}."
+ @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
@${ECHO_MSG}
.endif
.endif
@@ -3498,9 +3496,9 @@ _INSTALL_SEQ= install-message check-conflicts \
run-depends lib-depends pre-install pre-install-script \
generate-plist check-already-installed
_INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
- pre-su-install-script do-install post-install add-plist-info \
- post-install-script add-plist-docs compress-man run-ldconfig fake-pkg \
- security-check
+ pre-su-install-script do-install post-install \
+ post-install-script add-plist-info add-plist-docs \
+ compress-man run-ldconfig fake-pkg security-check
_PACKAGE_DEP= install
_PACKAGE_SEQ= package-message pre-package pre-package-script \
do-package post-package-script
@@ -4170,7 +4168,7 @@ ALL-DEPENDS-LIST= \
for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
if [ -d $$dir ]; then \
if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
- child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" run-depends-list); \
+ child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" all-depends-list); \
for d in $$child; do ${ECHO_CMD} $$d; done; \
${ECHO_CMD} $$dir; \
checked="$$dir $$child $$checked"; \
@@ -4375,13 +4373,13 @@ package-recursive: package
.if !target(describe)
describe:
- @${ECHO_CMD} -n '${PKGNAME}|${.CURDIR}|${PREFIX}|'
+ @${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"
.if defined(COMMENT)
@${ECHO_CMD} -n ${COMMENT:Q}
.else
@${ECHO_CMD} -n '** No Description'
.endif
- @${ECHO_CMD} "`perl -e ' \
+ @perl -e ' \
if ( -f q{${DESCR}} ) { \
print q{|${DESCR}}; \
} else { \
@@ -4402,6 +4400,7 @@ describe:
push @$$i, $$_; \
} else { \
print STDERR qq{${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete\n}; \
+ exit(1); \
} \
} \
} \
@@ -4421,7 +4420,7 @@ describe:
} \
} \
} \
- print qq{\n};'`"
+ print qq{\n};'
.endif
www-site:
@@ -4539,9 +4538,6 @@ generate-plist:
.for dir in ${PLIST_DIRS}
@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
.endfor
-.if !defined(NO_MTREE)
- @${ECHO_CMD} "@unexec if [ -f %D/info/dir ]; then if sed -e '1,/Menu:/d' %D/info/dir | grep -q '^[*] '; then true; else rm %D/info/dir; fi; fi" >> ${TMPPLIST}
-.endif
.if defined(INSTALLS_SHLIB) && !defined(INSTALL_AS_USER)
@${ECHO_CMD} "@exec ${LDCONFIG} -m ${LDCONFIG_PLIST}" >> ${TMPPLIST}
@${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
@@ -4590,6 +4586,9 @@ add-plist-info:
@${ECHO_CMD} "@exec install-info %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
>> ${TMPPLIST}
.endfor
+.if !defined(NO_MTREE)
+ @${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}
+.endif
# Compress (or uncompress) and symlink manpages.
.if !target(compress-man)
@@ -4716,7 +4715,7 @@ config:
.endif
.if ${UID} != 0 && !defined(INSTALL_AS_USER)
@${ECHO_MSG} "===> Switching to root credentials to create `${DIRNAME} ${_OPTIONSFILE}`"
- @(${SU_CMD} "${MKDIR} `${DIRNAME} ${_OPTIONSFILE}` 2> /dev/null") || \
+ @(${SU_CMD} "${SH} -c \"${MKDIR} `${DIRNAME} ${_OPTIONSFILE}` 2> /dev/null\"") || \
(${ECHO_MSG} "===> Cannot create `${DIRNAME} ${_OPTIONSFILE}`, check permissions"; exit 1)
@${ECHO_MSG} "===> Returning to user credentials"
.else
diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk
index dd04f94d5ff9..8c7969948d9e 100644
--- a/Mk/bsd.port.subdir.mk
+++ b/Mk/bsd.port.subdir.mk
@@ -209,7 +209,7 @@ describe: ${SUBDIR:S/^/describe./}
.for i in ${SUBDIR}
describe.$i:
- @${MAKE} -B ${i:S/^/_/:S/$/.describe/} > ${INDEX_TMPDIR}/${INDEXFILE}.desc.${i}
+ @cd ${.CURDIR}; ${MAKE} -B ${i:S/^/_/:S/$/.describe/} > ${INDEX_TMPDIR}/${INDEXFILE}.desc.${i}
.endfor
.else
describe: ${SUBDIR:S/^/_/:S/$/.describe/}
@@ -220,9 +220,8 @@ describe:
if test -d ${.CURDIR}/$${sub}; then \
${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \
cd ${.CURDIR}/$${sub}; \
- ${MAKE} -B describe 2> /dev/null || \
- (echo "===> ${DIRPRFX}$${sub} failed:" >&2 ; \
- cd ${.CURDIR}/$${sub}; ${MAKE} -B describe >&2; \
+ ${MAKE} -B describe || \
+ (echo "===> ${DIRPRFX}$${sub} failed" >&2; \
exit 1) ;\
else \
${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \
@@ -315,19 +314,89 @@ README.html:
PKGINSTALLVER="${PKGINSTALLVER:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
.endif
-
+PORTSEARCH_DISPLAY_FIELDS?=name,path,info,maint,index,bdeps,rdeps
+PORTSEARCH_KEYLIM?=0
+PORTSEARCH_XKEYLIM?=0
+PORTSEARCH_IGNORECASE?=1
search: ${PORTSDIR}/${INDEXFILE}
- @here=`pwd`; \
+ @here=${.CURDIR}; \
cd ${PORTSDIR}; \
- top=`pwd -P`; \
- there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \
- if [ -n "$$key" ]; then \
- grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "${key}" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'; \
- elif [ $$name ]; then \
- grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "^[^|]*${name}[^|]*|" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'; \
- else \
+ if [ -z "$$key" -a -z "$$xkey" -a \
+ -z "$$name" -a -z "$$xname" -a \
+ -z "$$path" -a -z "$$xpath" -a \
+ -z "$$info" -a -z "$$xinfo" -a \
+ -z "$$maint" -a -z "$$xmaint" -a \
+ -z "$$bdeps" -a -z "$$xbdeps" -a \
+ -z "$$rdeps" -a -z "$$xrdeps" ]; \
+ then \
echo "The search target requires a keyword parameter or name parameter,"; \
echo "e.g.: \"make search key=somekeyword\""; \
echo "or \"make search name=somekeyword\""; \
- fi;
+ exit; \
+ fi; \
+ 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" \
+ -v info="$$info" -v xinfo="$$xinfo" \
+ -v maint="$$maint" -v xmaint="$$xmaint" \
+ -v cat="$$cat" -v xcat="$$xcat" \
+ -v bdeps="$$bdeps" -v xbdeps="$$xbdeps" \
+ -v rdeps="$$rdeps" -v xrdeps="$$xrdeps" \
+ -v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \
+ -v keylim="$${keylim:-${PORTSEARCH_KEYLIM}}" \
+ -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}"\
+ -v display="$${display:-${PORTSEARCH_DISPLAY_FIELDS}}" \
+ 'BEGIN { \
+ sub(top, "${PORTSDIR}", there); \
+ IGNORECASE=icase; \
+ keylen = length(key); keylim = keylim && keylen; \
+ if (!keylim && keylen) \
+ parms[0] = key; \
+ xkeylen = length(xkey); xkeylim = xkeylim && xkeylen; \
+ if (!xkeylim && xkeylen) \
+ xparms[0] = xkey; \
+ if (length(name)) parms[1] = name; if (length(xname)) xparms[1] = xname; \
+ if (length(path)) parms[2] = path; if (length(xpath)) xparms[2] = xpath; \
+ if (length(info)) parms[4] = info; if (length(xinfo)) xparms[4] = xinfo; \
+ if (length(maint)) parms[6] = maint; if (length(xmaint)) xparms[6] = xmaint; \
+ if (length(cat)) parms[7] = cat; if (length(xcat)) xparms[7] = xcat; \
+ if (length(bdeps)) parms[8] = bdeps; if (length(xbdeps)) xparms[8] = xbdeps; \
+ if (length(rdeps)) parms[9] = rdeps; if (length(xrdeps)) xparms[9] = xrdeps; \
+ fields["name"] = 1; names[1] = "Port"; \
+ fields["path"] = 2; names[2] = "Path"; \
+ fields["info"] = 4; names[4] = "Info"; \
+ fields["maint"] = 6; names[6] = "Maint"; \
+ fields["cat"] = 7; names[7] = "Index"; \
+ fields["bdeps"] = 8; names[8] = "B-deps"; \
+ fields["rdeps"] = 9; names[9] = "R-deps"; \
+ split(display, d, /,[ \t]*/); \
+ for (i in d) { \
+ disp[fields[d[i]]] = 1; \
+ } \
+ } \
+ { \
+ if ($$2 !~ there) \
+ next; \
+ for (i in parms) \
+ if ($$i !~ parms[i]) \
+ next; \
+ for (i in xparms) \
+ if ($$i ~ xparms[i]) \
+ next; \
+ found = 0; \
+ for (i = 1; i < 10; i++) \
+ if (i in disp) { \
+ if (xkeylim && $$i ~ xkey) \
+ next; \
+ if (!found && keylim && $$i ~ key) \
+ found = 1; \
+ } \
+ if (keylim && !found) \
+ next; \
+ for (i = 1; i < 10; i++) \
+ if (i in disp) \
+ printf("%s:\t%s\n", names[i], $$i); \
+ print(""); \
+ }' ${PORTSDIR}/${INDEXFILE}