From owner-freebsd-ports Mon Feb 1 22:08:33 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA17065 for freebsd-ports-outgoing; Mon, 1 Feb 1999 22:08:33 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA17060 for ; Mon, 1 Feb 1999 22:08:32 -0800 (PST) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca7-245.ix.netcom.com [209.109.235.245]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id WAA15732; Mon, 1 Feb 1999 22:07:45 -0800 (PST) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.1/8.6.9) id WAA05408; Mon, 1 Feb 1999 22:07:41 -0800 (PST) Date: Mon, 1 Feb 1999 22:07:41 -0800 (PST) Message-Id: <199902020607.WAA05408@silvia.hip.berkeley.edu> To: sada@rr.iij4u.or.jp CC: kkennawa@physics.adelaide.edu.au, ports@FreeBSD.ORG In-reply-to: <19990201102231.10200.sada@rr.iij4u.or.jp> Subject: Re: USE_BZIP2 From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * I agree. For example, `automatic sensing' would be realized as below, * but I can't imagine how to auto-depend to ${PORTSDIR}/archivers/bzip2. Let's not make it too complicated. A USE_BZIP2 variable suits us just fine, I think. What about something like this? === Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.303 diff -u -r1.303 bsd.port.mk --- bsd.port.mk 1999/01/26 03:58:58 1.303 +++ bsd.port.mk 1999/02/02 05:54:26 @@ -52,8 +52,9 @@ # DISTFILES - Name(s) of archive file(s) containing distribution # (default: ${DISTNAME}${EXTRACT_SUFX}). Set this to # an empty string if the port doesn't require it. -# EXTRACT_SUFX - Suffix for archive names (default: .tar.gz). You -# never have to set both DISTFILES and EXTRACT_SUFX. +# EXTRACT_SUFX - Suffix for archive names (default: .tar.bz2 if USE_BZIP2 +# is set, .tar.gz otherwise). You never have to set both +# DISTFILES and EXTRACT_SUFX. # MASTER_SITES - Primary location(s) for distribution files if not found # locally. # PATCHFILES - Name(s) of additional files that contain distribution @@ -111,6 +112,8 @@ # # Use these if your port uses some of the common software packages. # +# USE_BZIP2 - Says that the port tarballs use bzip2, not gzip, for +# compression. # USE_GMAKE - Says that the port uses gmake. # GMAKE - Set to path of GNU make if not in $PATH (default: gmake). # USE_AUTOCONF - Says that the port uses autoconf. Implies GNU_CONFIGURE. @@ -311,13 +314,14 @@ # # For extract: # -# EXTRACT_CMD - Command for extracting archive (default: tar). +# EXTRACT_CMD - Command for extracting archive (default: "bzip2" if +# USE_BZIP2 is set, "gzip" if not). # EXTRACT_BEFORE_ARGS - # Arguments to ${EXTRACT_CMD} before filename -# (default: -xzf). +# (default: "-dc"). # EXTRACT_AFTER_ARGS - # Arguments to ${EXTRACT_CMD} following filename -# (default: none). +# (default: "| tar -xf -"). # # For configure: # @@ -456,7 +460,11 @@ X11BASE?= ${DESTDIR}/usr/X11R6 DISTDIR?= ${PORTSDIR}/distfiles _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR} -EXTRACT_SUFX?= .tar.gz +.if defined(USE_BZIP2) +EXTRACT_SUFX?= .tar.bz2 +.else +EXTRACT_SUFX?= .tar.gz +.endif PACKAGES?= ${PORTSDIR}/packages TEMPLATES?= ${PORTSDIR}/Templates @@ -547,6 +555,9 @@ MANCOMPRESSED?= no .endif +.if defined(USE_BZIP2) +BUILD_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2 +.endif .if defined(USE_GMAKE) BUILD_DEPENDS+= gmake:${PORTSDIR}/devel/gmake .endif @@ -661,15 +672,18 @@ .endif .if exists(/bin/tar) -EXTRACT_CMD?= /bin/tar +TAR?= /bin/tar .else -EXTRACT_CMD?= /usr/bin/tar +TAR?= /usr/bin/tar .endif -# Backwards compatability. -.if defined(EXTRACT_ARGS) -EXTRACT_BEFORE_ARGS?= ${EXTRACT_ARGS} + +# EXTRACT_SUFX is defined in .pre.mk section +EXTRACT_BEFORE_ARGS?= -dc +EXTRACT_AFTER_ARGS?= | ${TAR} -xf - +.if defined(USE_BZIP2) +EXTRACT_CMD?= bzip2 .else -EXTRACT_BEFORE_ARGS?= -xzf +EXTRACT_CMD?= ${GZIP_CMD} .endif # Figure out where the local mtree file is === (Warning: hasn't been tested for bzip2.) I changed defaults EXTRACT_{BEFORE,AFTER}_ARGS so .tar.gz and .tar.bz2 can be handled almost identically. We will have to go through the tree and make sure existing ports that use those two variables are fixed properly. One snag is that since gzip or bzip2 spits out nothing to stdout when the input format is invalid, the extract pipeline actually returns a success (tar gets an empty file and happily exits normally without doing anything) so the make will fail a few more steps down the road, instead of right in the extract command. But I think it's still easy enough to debug, the error message from gzip or bzip2 is right there in the log. === ===> Extracting for oneko-1.2 >> Checksum OK for oneko-1.2.tar.gz. ===> oneko-1.2 depends on executable: bzip2 - found ===> oneko-1.2 depends on shared library: X11.6 - found bzip2: Input file name /i/ports/distfiles//oneko-1.2.tar.gz doesn't end in `.bz2', skipping. ===> Patching for oneko-1.2 ===> Configuring for oneko-1.2 cannot create /i/ports/games/oneko/work/oneko-1.2/Imakefile: directory nonexistent *** Error code 2 Stop. *** Error code 1 === Satoshi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message