Subject: pkg/6901: there is no easy way how to handle bzip2ped archives
To: None <>
From: Jaromir Dolecek <>
List: netbsd-bugs
Date: 01/28/1999 16:52:52
>Number:         6901
>Category:       pkg
>Synopsis:       there is no easy way how to handle bzip2ped archives
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 28 08:05:02 1999
>Originator:     Jaromir Dolecek
ICS MU, Brno, Czech Republic
>Release:        NetBSD-19991207
System: NetBSD 1.3I NetBSD 1.3I (JDOLECEK) #38: Wed Jan 20 00:15:24 MET 1999 i386

	Some packages (KDE 1.1 at least) use tar archive compressed
	by bzip2 instead of "standard" tar.gz. We might assume
	there will be more such packages in future, as bzip2
	compression is generally better than gzip one. There should
	be some standard way how to handle such packages, so it
	won't be necessary to hack each one separately.
	Try to make package for KDE 1.1pre2.
	Here is a hack, which does what I need. It adds variable
	EXTRACT_BZIP2 -- if it's set in pkg's Makefile, the
	extracting process is adjusted so that the pkg doesn't
	need any additional magic. The patch assumes bunzip2
	is in $PATH, if it's available; when it's not found,
	it builds bunzip2 from pkg collection.

---	Thu Jan 28 15:11:16 1999
+++	Thu Jan 28 15:33:01 1999
@@ -244,7 +244,11 @@
 .if exists(/bin/pax) && (${OPSYS} != "NetBSD")
 EXTRACT_CMD?=		/bin/pax
+.if defined(EXTRACT_BZIP2)
 .if exists(/bin/tar)
 EXTRACT_CMD?=		/bin/tar
@@ -255,10 +259,29 @@
 .if defined(EXTRACT_ARGS)
+.if defined(EXTRACT_BZIP2)
+.if defined(EXTRACT_BZIP2)
+EXTRACT_SUFX?=		.tar.bz2
 EXTRACT_SUFX?=		.tar.gz
+.if defined(EXTRACT_BZIP2)
+# set up all EXTRACT_* variables so we will DTRT in do-extract target
+# for bzip2ped archives
+.if !defined(EXTRACT_AFTER_ARGS)
+EXTRACT_CMD=		bunzip2
+BUILD_DEPENDS+=		bunzip2:../../archivers/bzip2
 # Figure out where the local mtree file is
 .if !defined(MTREE_FILE)
--- packages.7.orig	Thu Jan 28 16:29:18 1999
+++ packages.7	Thu Jan 28 16:36:25 1999
@@ -395,6 +395,10 @@
 Arguments to
 following the filename argument.  There is no default.
+If defined, the package is assumed to be compressed by
+bzip2(1) instead of gzip(1) and extract process
+is appropriately adjusted.
 Full path to ftp/http command if not in
 .Dv $PATH .