From owner-freebsd-ports Wed May 2 10:50:49 2001 Delivered-To: freebsd-ports@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 3B1C837B440; Wed, 2 May 2001 10:50:40 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 33E244E31B; Thu, 3 May 2001 02:50:35 +0900 (JST) Date: Thu, 03 May 2001 02:50:35 +0900 Message-ID: <86zocvmyhg.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: ports@FreeBSD.org, portmgr@FreeBSD.org Subject: Re: call for review: a patch against bsd.port.mk In-Reply-To: <86zod07qm2.wl@archon.local.idaemons.org> References: <861yqc95z2.wl@archon.local.idaemons.org> <86zod07qm2.wl@archon.local.idaemons.org> User-Agent: Wanderlust/2.5.4 (Smooth) SEMI/1.14.2 (=?ISO-8859-1?Q?Daish=F2?= =?ISO-8859-1?Q?ji?=) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.2 - =?ISO-8859-1?Q?=22Daish=F2ji=22?=) Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org . o O (come on, portmgr's...) Now, I have added STRIP_CMD, and set ECHO, TRUE and FALSE to shell builtin commands. Summary of the Changes: 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\" 4. Use shell builtin commands for echo, true and false as NetBSD does. -- / /__ __ 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 -r1.366 bsd.port.mk --- bsd.port.mk 2001/04/22 16:47:55 1.366 +++ bsd.port.mk 2001/05/02 15:24:31 @@ -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 -ECHO?= /bin/echo +CUT?= /usr/bin/cut +DC?= /usr/bin/dc +ECHO?= echo # Shell builtin +EGREP?= /usr/bin/egrep EXPR?= /bin/expr -FALSE?= /usr/bin/false +FALSE?= false # Shell builtin +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,15 @@ SED?= /usr/bin/sed SETENV?= /usr/bin/env SH?= /bin/sh +STRIP_CMD?= /usr/bin/strip +SU?= /usr/bin/su +TAIL?= /usr/bin/tail +TEST?= test # Shell builtin TR?= /usr/bin/tr -TRUE?= /usr/bin/true +TRUE?= true # Shell builtin 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 +781,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 +1020,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 +1755,9 @@ *.Z|*.gz) \ ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \ ;; \ + *.bz2) \ + ${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