summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2004-06-10 07:30:19 +0000
committerkris <kris@FreeBSD.org>2004-06-10 07:30:19 +0000
commit453218e41f02f458f11592cf52bd616b798315ab (patch)
treeb29216fc3282ee24a0a3bfbe3dbcf7144df56acb
parentdce0385ce6cfa933f9e3e44650770c064db59a79 (diff)
downloadFreeBSD-ports-453218e41f02f458f11592cf52bd616b798315ab.zip
FreeBSD-ports-453218e41f02f458f11592cf52bd616b798315ab.tar.gz
* Support verbose index builds with INDEX_VERBOSE [1]
* Don't assume root is using /bin/sh when switching credentials to configure OPTIONS. [2] * Support glob expressions in USE_GETTEXT to allow more flexibility in the face of future gratuitous library version bumps by the gettext developers [3]: USE_GETTEXT=yEs # Works as before (case-insensitive) USE_GETTEXT=[5-7] # Accepts any of those libintl.so.x versions # in the LIB_DEPENDS * Correctly register dependencies when a non-system perl port is used on 4.x [4] * Extend 'make search' support to allow much more flexible searching. Syntax will be documented in CHANGES for brevity. [5] * Reorder the post-install-script target to before add-plist-info for consistency [6] * Various fixes to support port operations when a port directory exists under /usr/obj [7] * Extend USE_PERL5_BUILD and USE_PERL5 to add EXTRACT and PATCH dependencies since many ports require perl in those stages [8] * Move info file deregistration later in the deinstallation process so it works properly. [9] * Improve wording in EXPIRATION_DATE message. [10] * Fix dependencies for XFREE86_VERSION==3 (obtain imake from x11/XFree86 now that the former port is gone) [11] * While building index, treat non-existent dependencies as fatal. Previously the error was being hidden by the stderr redirection. [12] * Don't always retry BROKEN ports when package building (it is taking too much time to continually rebuild ports that are usually going to really be broken). Set TRYBROKEN if you want to attempt a build of a BROKEN port. [12] * Revert incorrect change from 1.487 relating to ALL-DEPENDS-LIST [13] PR: 24214 [1], 67529 [2], 63937 [3], 65554 [4], 40699 [5], 59162 [6], 63372 66567 [7], 63394 [8], 65304 [9], 65931 [10], 66565 [11], 66743 [13] Submitted by: roam [1], will [1], hrs [2], mi [3], ade [4], Roman Neuhauser <roman@bellavista.cz> [5], Sergey Matveychuk <sem@ciam.ru> [6], gad [7], adamw [8], kris [8][12], dinoex [9], Alexey Dokuchaev <danfe@regency.nsu.ru> [10], eik [11][13]
-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 6dabf07..785f21b 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 c34331b..ca6feed 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 dd04f94..8c79699 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}
OpenPOWER on IntegriCloud