Date: Sun, 29 Apr 2001 04:31:13 +0900 From: "Akinori MUSHA" <knu@iDaemons.org> To: ports@FreeBSD.org, portmgr@FreeBSD.org Subject: call for review: a patch against bsd.port.mk Message-ID: <861yqc95z2.wl@archon.local.idaemons.org>
next in thread | raw e-mail | index | archive | help
Please review the attached patch, which makes bsd.port.mk: 1. Support bzip2'ed distributed patches; automatically add bzip2 as dependency when PATCHFILES include *.bz2. 2. Add a bunch of command macros for convenience, mostly from NetBSD pkgsrc. 3. Allow the third field of *_DEPENDS to include make options. e.g.: BUILD_DEPENDS= foo:catX/foo:patch,-DWITH_BAA,-DWITH_BAR \ bar:catY/bar:build,EXTRAOPTIONS=\"baz,boo\" -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.366 diff -u -u -r1.366 bsd.port.mk --- bsd.port.mk 2001/04/22 16:47:55 1.366 +++ bsd.port.mk 2001/04/28 19:25:26 @@ -66,7 +66,7 @@ # patches (default: none). make will look for them at # PATCH_SITES (see below). They will automatically be # uncompressed before patching if the names end with -# ".gz" or ".Z". +# ".gz", ".bz2" or ".Z". # PATCH_SITES - Primary location(s) for distribution patch files # if not found locally. # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} @@ -485,20 +485,32 @@ AWK?= /usr/bin/awk BASENAME?= /usr/bin/basename +BZCAT?= ${LOCALBASE}/bin/bzcat +BZIP2_CMD?= ${LOCALBASE}/bin/bzip2 CAT?= /bin/cat +CHGRP?= /usr/bin/chgrp CHMOD?= /bin/chmod CHOWN?= /usr/sbin/chown CP?= /bin/cp +CUT?= /usr/bin/cut +DC?= /usr/bin/dc ECHO?= /bin/echo +EGREP?= /usr/bin/egrep EXPR?= /bin/expr FALSE?= /usr/bin/false +FILE?= /usr/bin/file +FIND?= /usr/bin/find GREP?= /usr/bin/grep GUNZIP_CMD?= /usr/bin/gunzip -f GZCAT?= /usr/bin/gzcat GZIP?= -9 GZIP_CMD?= /usr/bin/gzip -nf ${GZIP} +HEAD?= /usr/bin/head +ID?= /usr/bin/id +IDENT?= /usr/bin/ident LDCONFIG?= /sbin/ldconfig LN?= /bin/ln +LS?= /bin/ls MKDIR?= /bin/mkdir -p MV?= /bin/mv RM?= /bin/rm @@ -506,10 +518,14 @@ SED?= /usr/bin/sed SETENV?= /usr/bin/env SH?= /bin/sh +SU?= /usr/bin/su +TAIL?= /usr/bin/tail +TEST?= /bin/test TR?= /usr/bin/tr TRUE?= /usr/bin/true UNAME?= /usr/bin/uname WHICH?= /usr/bin/which +XARGS?= /usr/bin/xargs # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} @@ -764,7 +780,13 @@ MANCOMPRESSED?= no .endif -.if defined(USE_BZIP2) +.if defined(PATCHFILES) +.if ${PATCHFILES:M*.bz2}x != x +USE_BZIP2_PATCH= yes +.endif +.endif + +.if defined(USE_BZIP2) || defined(USE_BZIP2_PATCH) BUILD_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2 .endif .if defined(USE_ZIP) @@ -997,7 +1019,7 @@ EXTRACT_BEFORE_ARGS?= -dc EXTRACT_AFTER_ARGS?= | ${TAR} -xf - .if defined(USE_BZIP2) -EXTRACT_CMD?= bzip2 +EXTRACT_CMD?= ${BZIP2_CMD} .else EXTRACT_CMD?= ${GZIP_CMD} .endif @@ -1732,6 +1754,10 @@ *.Z|*.gz) \ ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \ ;; \ + *.bz2) \ + pwd ; echo ${BZCAT} $$i ! ${PATCH} ${PATCH_DIST_ARGS}; \ + ${BZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \ + ;; \ *) \ ${PATCH} ${PATCH_DIST_ARGS} < $$i; \ ;; \ @@ -2078,7 +2104,7 @@ @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-install # Scan PLIST for setugid files and startup scripts -@for i in `${GREP} -v '^@' ${TMPPLIST}`; do \ - /usr/bin/find ${PREFIX}/$$i -prune -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) -ls 2>/dev/null; \ + ${FIND} ${PREFIX}/$$i -prune -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) -ls 2>/dev/null; \ done > ${WRKDIR}/.PLIST.setuid; \ ${GREP} '^etc/rc.d/' ${TMPPLIST} > ${WRKDIR}/.PLIST.startup; \ if [ -s ${WRKDIR}/.PLIST.setuid -o -s ${WRKDIR}/.PLIST.startup ]; then \ @@ -2474,7 +2500,7 @@ prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \ dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \ if ${EXPR} "$$dir" : '.*:' > /dev/null; then \ - target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \ + target=`${ECHO} $$dir | ${SED} -e 's/.*://' -e 's/,/ /g'`; \ dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \ else \ target="${DEPENDS_TARGET}"; \ @@ -2512,7 +2538,7 @@ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} " >> No directory for $$prog. Skipping.."; \ else \ - (cd $$dir; ${MAKE} $$target $$depends_args) ; \ + (cd $$dir; eval ${MAKE} $$target $$depends_args) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi; \ @@ -2797,7 +2823,7 @@ www-site: .if exists(${DESCR}) - @${GREP} '^WWW:[ ]' ${DESCR} | ${AWK} '{print $$2}' | head -1 + @${GREP} '^WWW:[ ]' ${DESCR} | ${AWK} '{print $$2}' | ${HEAD} -1 .else @${ECHO} .endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?861yqc95z2.wl>