Skip to content

Commit

Permalink
Rewrite the extraction commands to be more intuitive.
Browse files Browse the repository at this point in the history
In the vast majority of cases, nothing has changed (i.e. .tgz, .tar.gz,
and .tar.bz2).

EXTRACT_USING_PAX can be set as before.

For custom extractions, instead of using EXTRACT_BEFORE_ARGS,
EXTRACT_AFTER_ARGS and EXTRACT_CMD, simply set EXTRACT_CMD to be the
command needed to decompress and extract the lements from the archive.
${DOWNLOADED_DISTFILE} can be used to reference the distfile(s).
e.g. for compressed shars, where previously there was:

EXTRACT_CMD=           ${GZCAT}
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS=    |sh

now use:

EXTRACT_CMD=           ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}
  • Loading branch information
agc committed Apr 1, 1999
1 parent cedce59 commit 171e025
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 95 deletions.
6 changes: 2 additions & 4 deletions archivers/macutil/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1998/11/12 15:19:59 agc Exp $
# $NetBSD: Makefile,v 1.8 1999/04/01 14:07:52 agc Exp $

DISTNAME= macutil2.0b3
PKGNAME= macutil-2.0b3
Expand All @@ -9,9 +9,7 @@ EXTRACT_SUFX= .shar.Z
MAINTAINER= [email protected]

MAKEFILE= makefile
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}

WRKSRC= ${WRKDIR}/macutil

Expand Down
5 changes: 2 additions & 3 deletions archivers/rar/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 1999/03/28 15:34:24 hubertf Exp $
# $NetBSD: Makefile,v 1.13 1999/04/01 14:07:52 agc Exp $
# FreeBSD Id: Makefile,v 1.7 1997/08/10 22:31:27 fenner Exp
#

Expand All @@ -15,8 +15,7 @@ MAINTAINER= [email protected]
NO_PACKAGE= Only unmodified original package can be distributed

NO_WRKSUBDIR= yes
EXTRACT_CMD=
EXTRACT_BEFORE_ARGS=
EXTRACT_CMD= ${DOWNLOADED_DISTFILE}

pre-extract:
chmod a+x ${DISTDIR}/${DISTFILES}
Expand Down
5 changes: 2 additions & 3 deletions archivers/zip1/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 1998/08/20 15:16:38 tsarna Exp $
# $NetBSD: Makefile,v 1.5 1999/04/01 14:07:52 agc Exp $
#

DISTNAME= zip1-1.1
Expand All @@ -12,8 +12,7 @@ HOMEPAGE= http://www.cdrom.com/pub/infozip/

BUILD_DEPENDS= unzip:../../archivers/unzip

EXTRACT_CMD= unzip
EXTRACT_BEFORE_ARGS= -qo
EXTRACT_CMD= unzip -qo ${DOWNLOADED_DISTFILE}

MAKEFILE= makefile
MAKE_FLAGS= CFLAGS="${CFLAGS} -DDIRENT" LFLAGS2="-lcompat"
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/hint/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 1999/02/10 18:49:17 explorer Exp $
# $NetBSD: Makefile,v 1.7 1999/04/01 14:07:52 agc Exp $
# FreeBSD: Makefile,v 1.1.1.1 1998/06/15 18:09:43 ghelmer Exp
#

Expand All @@ -11,7 +11,7 @@ EXTRACT_SUFX= .tar
MAINTAINER= [email protected]
HOMEPAGE= http://www.scl.ameslab.gov/Projects/HINT/

EXTRACT_BEFORE_ARGS=-xf
EXTRACT_CMD= ${GTAR} -xf ${DOWNLOADED_DISTFILE}
WRKSRC= ${WRKDIR}/unix
ALL_TARGET= DOUBLE INT

Expand Down
6 changes: 2 additions & 4 deletions benchmarks/paranoia/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 1999/03/16 08:53:43 agc Exp $
# $NetBSD: Makefile,v 1.6 1999/04/01 14:07:53 agc Exp $

DISTNAME= paranoia
PKGNAME= paranoia-960101
Expand All @@ -9,9 +9,7 @@ EXTRACT_SUFX= .c
MAINTAINER= [email protected]

NO_WRKSUBDIR= yes
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= #empty
EXTRACT_AFTER_ARGS= ${WRKSRC}
EXTRACT_CMD= ${CP} ${DOWNLOADED_DISTFILE} ${WRKSRC}

do-build:
(cd ${WRKSRC} ; ${CC} -ffloat-store -o paranoia paranoia.c -lm)
Expand Down
6 changes: 2 additions & 4 deletions benchmarks/whetstone/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 1999/03/16 09:02:27 agc Exp $
# $NetBSD: Makefile,v 1.6 1999/04/01 14:07:53 agc Exp $

DISTNAME= whetstone
PKGNAME= whetstone-1.2
Expand All @@ -9,9 +9,7 @@ EXTRACT_SUFX= .c
MAINTAINER= [email protected]

NO_WRKSUBDIR= yes
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= #empty
EXTRACT_AFTER_ARGS= ${WRKSRC}
EXTRACT_CMD= ${CP} ${DOWNLOADED_DISTFILE} ${WRKSRC}

do-build:
(cd ${WRKSRC} ; ${CC} -O2 -o whetstone whetstone.c -lm)
Expand Down
5 changes: 2 additions & 3 deletions comms/binkd/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1.1.1 1998/11/22 20:47:13 tv Exp $
# $NetBSD: Makefile,v 1.2 1999/04/01 14:07:53 agc Exp $
#

DISTNAME= binkd-0.9.2
Expand All @@ -12,8 +12,7 @@ HOMEPAGE= http://www.corbina.net/~maloff/binkd/
BUILD_DEPENDS= unzip:../../archivers/unzip

GNU_CONFIGURE= yes
EXTRACT_CMD= unzip
EXTRACT_BEFORE_ARGS= -qo
EXTRACT_CMD= unzip -qo ${DOWNLOADED_DISTFILE}

NO_CDROM= "extremely limited usefulness to the general public"

Expand Down
9 changes: 7 additions & 2 deletions cross/binutils/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1999/02/18 13:46:33 tv Exp $
# $NetBSD: Makefile,v 1.8 1999/04/01 14:07:53 agc Exp $
#
# GNU binutils configured to hold `as many targets as the cross system is
# capable of using'. Configures and builds everything except gas, which
Expand Down Expand Up @@ -60,4 +60,9 @@ do-install:
.include "../../mk/bsd.pkg.mk"

ENABLE_TARGETS_LIST!= ${ECHO} "${ENABLE_TARGETS}" | ${SED} "s/[ ][ ]*/,/g;s/^,*//"
EXTRACT_BEFORE_ARGS:= -X ${FILESDIR}/exclude ${EXTRACT_BEFORE_ARGS}

.if defined(EXTRACT_USING_PAX)
EXTRACT_ELEMENTS= '-s|${FILESDIR}/exclude||'
.else
EXTRACT_ELEMENTS= -X ${FILESDIR}/exclude
.endif
4 changes: 2 additions & 2 deletions databases/p5-gdbm/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1.1.1 1999/03/03 00:06:53 kim Exp $
# $NetBSD: Makefile,v 1.2 1999/04/01 14:07:53 agc Exp $

DISTNAME= perl5.004_04
PKGNAME= p5-gdbm-5.4.4
Expand All @@ -11,7 +11,7 @@ MAINTAINER= [email protected]
USE_PERL5= YES
DEPENDS+= gdbm-1.7.3:../../databases/gdbm

EXTRACT_AFTER_ARGS= perl5.004_04/ext/GDBM_File
EXTRACT_ELEMENTS= perl5.004_04/ext/GDBM_File
WRKSRC= ${WRKDIR}/${EXTRACT_AFTER_ARGS}

do-configure:
Expand Down
4 changes: 2 additions & 2 deletions databases/py-gdbm/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1998/12/18 00:42:39 tsarna Exp $
# $NetBSD: Makefile,v 1.8 1999/04/01 14:07:53 agc Exp $
#

DISTNAME= pyth151
Expand All @@ -18,7 +18,7 @@ DIST_SUBDIR= python

ALL_TARGET= default

EXTRACT_AFTER_ARGS= Python-1.5.1/Modules/gdbmmodule.c
EXTRACT_ELEMENTS= Python-1.5.1/Modules/gdbmmodule.c

PYTHON_CONFIGDIR= ${LOCALBASE}/lib/python1.5/config/

Expand Down
5 changes: 2 additions & 3 deletions devel/rdp/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 1998/08/20 15:16:50 tsarna Exp $
# $NetBSD: Makefile,v 1.4 1999/04/01 14:07:53 agc Exp $

DISTNAME= rdp1_5
PKGNAME= rdp-1.5
Expand All @@ -11,8 +11,7 @@ HOMEPAGE= http://www.dcs.rhbnc.ac.uk/research/languages/rdp.shtml

BUILD_DEPENDS= unzip:../../archivers/unzip

EXTRACT_CMD= unzip
EXTRACT_BEFORE_ARGS= -Laqo
EXTRACT_CMD= unzip -Laqo ${DOWNLOADED_DISTFILE}

WRKSRC= ${WRKDIR}/rdp
MAKEFILE= makefile
Expand Down
6 changes: 2 additions & 4 deletions editors/sam/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 1999/02/04 18:54:35 agc Exp $
# $NetBSD: Makefile,v 1.9 1999/04/01 14:07:56 agc Exp $
# FreeBSD Id: Makefile,v 1.3 1996/11/12 02:19:40 obrien Exp
#

Expand All @@ -11,9 +11,7 @@ EXTRACT_SUFX= .msg.gz
MAINTAINER= [email protected]

NO_WRKSUBDIR= yes
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}

OPSYS!= uname -s
.if (${OPSYS} == "NetBSD")
Expand Down
6 changes: 2 additions & 4 deletions games/svb/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 1998/09/07 03:23:09 garbled Exp $
# $NetBSD: Makefile,v 1.2 1999/04/01 14:07:53 agc Exp $

DISTNAME= svb
PKGNAME= svb-1.0
Expand All @@ -10,9 +10,7 @@ MAINTAINER= [email protected]

USE_IMAKE= yes
NO_WRKSUBDIR= yes
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS= #empty
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}
NO_INSTALL_MANPAGES= yes

post-install:
Expand Down
5 changes: 2 additions & 3 deletions games/xdoom/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1999/01/30 23:18:49 agc Exp $
# $NetBSD: Makefile,v 1.8 1999/04/01 14:07:54 agc Exp $

DISTNAME= linuxdoom-1.10
PKGNAME= xdoom-1.10
Expand All @@ -15,9 +15,8 @@ BUILD_DEPENDS= unzip:../../archivers/unzip

LICENSE= shareware

EXTRACT_CMD= unzip
EXTRACT_BEFORE_ARGS= -qo
EXTRACT_ONLY= doomsrc.zip
EXTRACT_CMD= unzip -qo ${EXTRACT_ONLY}
USE_X11BASE= yes
USE_GMAKE= yes

Expand Down
8 changes: 2 additions & 6 deletions lang/py-html-docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 1998/08/20 15:17:08 tsarna Exp $
# $NetBSD: Makefile,v 1.3 1999/04/01 14:07:54 agc Exp $
#

DISTNAME= html-1.5.1
Expand All @@ -10,7 +10,6 @@ EXTRACT_SUFX= .tgz
MAINTAINER= [email protected]
HOMEPAGE= http://www.python.org/doc/

EXTRACT_ONLY=
NO_CONFIGURE= yes
NO_BUILD= yes

Expand All @@ -20,10 +19,7 @@ PLIST_SRC= ${WRKDIR}/.PLIST_SRC
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/${HTMLDIR}
${CAT} ${PKGDIR}/PLIST.pre >${PLIST_SRC}
(cd ${PREFIX}/${HTMLDIR}; \
${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} \
${_DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
${EXTRACT_AFTER_ARGS})
(cd ${WRKSRC}; pax -r -w -v -p -e . ${PREFIX}/${HTMLDIR})
(cd ${PREFIX}; find ${HTMLDIR} -type f -print >>${PLIST_SRC})
(cd ${PREFIX}; find -d ${HTMLDIR} -type d -print | \
${SED} -e "s/^/@dirrm /" >>${PLIST_SRC})
Expand Down
4 changes: 2 additions & 2 deletions misc/py-readline/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1998/12/18 00:42:40 tsarna Exp $
# $NetBSD: Makefile,v 1.8 1999/04/01 14:07:54 agc Exp $
#

DISTNAME= pyth151
Expand All @@ -16,7 +16,7 @@ DEPENDS+= readline-2.2:../../devel/readline

DIST_SUBDIR= python
ALL_TARGET= default
EXTRACT_AFTER_ARGS= Python-1.5.1/Modules/readline.c
EXTRACT_ELEMENTS= Python-1.5.1/Modules/readline.c

PYTHON_CONFIGDIR= ${LOCALBASE}/lib/python1.5/config

Expand Down
32 changes: 19 additions & 13 deletions mk/bsd.pkg.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.239 1999/04/01 07:29:14 agc Exp $
# $NetBSD: bsd.pkg.mk,v 1.240 1999/04/01 14:07:55 agc Exp $
#
# This file is in the public domain.
#
Expand Down Expand Up @@ -266,31 +266,35 @@ PATCH_ARGS+= -C
PATCH_DIST_ARGS+= -C
.endif

# New decompress and extract definitions

# If the archive has a .bz2 suffix, use bzip2 to extract information
# If EXTRACT_USING_PAX is defined, use pax in preference to (GNU) tar,
# and append 2 tar blocks of zero bytes on the end, in case the archive
# was written with a buggy version of GNU tar.

EXTRACT_SUFX?= .tar.gz
.if (${EXTRACT_SUFX} == ".tar.bz2")

.if ${EXTRACT_SUFX} == ".tar.bz2"
.if exists(/usr/bin/bzcat)
BZCAT= /usr/bin/bzcat
.else
BZCAT= ${LOCALBASE}/bin/bzcat
BUILD_DEPENDS+= ${BZCAT}:${PKGSRCDIR}/archivers/bzip2
.endif # !exists bzcat
EXTRACT_CMD?= ${EXTRACT_SUBSHELL_OPEN} ${BZCAT}
EXTRACT_BEFORE_ARGS?= <
.else # suffix != .tar.bz2
EXTRACT_CMD?= ${EXTRACT_SUBSHELL_OPEN} ${GZCAT}
EXTRACT_BEFORE_ARGS?= <
DECOMPRESS_CMD?= ${BZCAT}
.else
DECOMPRESS_CMD?= ${GZCAT}
.endif

# If this is empty, then everything gets extracted.
EXTRACT_ELEMENTS?=

.if defined(EXTRACT_USING_PAX)
EXTRACT_SUBSHELL_OPEN= (
EXTRACT_AFTER_ARGS?= ; dd if=/dev/zero bs=10k count=2 ) | ${PAX} -r
EXTRACT_CMD?= (${DECOMPRESS_CMD} ${DOWNLOADED_DISTFILE} ; dd if=/dev/zero bs=10k count=2) | ${PAX} -r ${EXTRACT_ELEMENTS}
.else
EXTRACT_AFTER_ARGS?= | /usr/bin/tar -xf -
.endif # !pax
.endif # suffix != .tar.bz2
EXTRACT_CMD?= ${DECOMPRESS_CMD} ${DOWNLOADED_DISTFILE} | /usr/bin/tar xf - ${EXTRACT_ELEMENTS}
.endif

# Figure out where the local mtree file is
.if !defined(MTREE_FILE)
Expand Down Expand Up @@ -1020,6 +1024,8 @@ mirror-distfiles:

# Extract

DOWNLOADED_DISTFILE= ${_DISTDIR}/$$file

.if !target(do-extract)
do-extract:
.ifndef NO_WRKDIR
Expand All @@ -1036,7 +1042,7 @@ do-extract:
${_PKG_SILENT}${_PKG_DEBUG} \
for file in "" ${EXTRACT_ONLY}; do \
if [ "X$$file" = X"" ]; then continue; fi; \
(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS}); \
(cd ${WRKDIR} && ${EXTRACT_CMD}); \
done
.endif

Expand Down
6 changes: 2 additions & 4 deletions plan9/9menu/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 1999/02/04 18:54:35 agc Exp $
# $NetBSD: Makefile,v 1.9 1999/04/01 14:07:55 agc Exp $
# FreeBSD Id: Makefile,v 1.4 1997/09/08 12:23:55 tg Exp
#

Expand All @@ -16,9 +16,7 @@ MANCOMPRESSED= yes
.endif

NO_WRKSUBDIR= yes
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}

USE_X11= yes

Expand Down
6 changes: 2 additions & 4 deletions plan9/9wm/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 1998/08/20 15:17:23 tsarna Exp $
# $NetBSD: Makefile,v 1.10 1999/04/01 14:07:55 agc Exp $
# FreeBSD Id: Makefile,v 1.4 1997/05/28 06:18:20 fenner Exp
#

Expand All @@ -11,9 +11,7 @@ MAINTAINER= [email protected]
HOMEPAGE= http://dhog.g7.org/dhog/9wm.html

NO_WRKSUBDIR= yes
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}
USE_IMAKE= yes

.include "../../mk/bsd.pkg.mk"
6 changes: 2 additions & 4 deletions plan9/sam/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 1999/02/04 18:54:35 agc Exp $
# $NetBSD: Makefile,v 1.9 1999/04/01 14:07:56 agc Exp $
# FreeBSD Id: Makefile,v 1.3 1996/11/12 02:19:40 obrien Exp
#

Expand All @@ -11,9 +11,7 @@ EXTRACT_SUFX= .msg.gz
MAINTAINER= [email protected]

NO_WRKSUBDIR= yes
EXTRACT_CMD= zcat
EXTRACT_BEFORE_ARGS=
EXTRACT_AFTER_ARGS= |sh
EXTRACT_CMD= ${GZCAT} ${DOWNLOADED_DISTFILE} | ${SH}

OPSYS!= uname -s
.if (${OPSYS} == "NetBSD")
Expand Down
Loading

0 comments on commit 171e025

Please sign in to comment.