Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2008 23:43:41 GMT
From:      bf <bf2006a@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/121413: [PATCH]:introduce USE_LZMA for lzma-compressed tarball distfiles
Message-ID:  <200803052343.m25Nhfg1007274@www.freebsd.org>
Resent-Message-ID: <200803052350.m25No19d020073@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         121413
>Category:       ports
>Synopsis:       [PATCH]:introduce USE_LZMA for lzma-compressed tarball distfiles
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 05 23:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     bf
>Release:        7-STABLE i386
>Organization:
>Environment:
>Description:
An increasing number of projects have started to distribute tarballs using LZMA compression, which offers improvements in compression ratio and decompression time over bzip2. Some have in fact announced that they will no longer use bzipped tarballs, only LZMA-compressed tarballs.  It now seems worthwhile to add to bsd.port.mk to take advantage of these changes.  I realize that we're trying to streamline bsd.port.mk, and that this suggested change runs counter to the recent trend of attempts to consolidate different archivers and compression in bsdtar/libarchive/..., rather than having external EXTRACT_DEPENDS, but it seems worthwhile to make the change until this compression method (or a better one) is added to bsdtar/libarchive/..., as many people are now beginning to use it.  Note that there are two commonly-used, incompatible implementations of LZMA compression: one that is used by archivers/p7zip, and one that is used by archivers/lzma.  Most of the tarballs that have app
 eared are based upon the latter format (in fact, the GNU people are recommending the use of lzma-utils, from

http://tukaani.org/lzma/

which is a port of an earlier version of archivers/lzma).



>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN Mk.orig/bsd.commands.mk Mk/bsd.commands.mk
--- Mk.orig/bsd.commands.mk	2008-03-05 13:29:25.546145288 -0500
+++ Mk/bsd.commands.mk	2008-03-05 18:06:16.925577310 -0500
@@ -53,6 +53,7 @@
 LDCONFIG?=	/sbin/ldconfig
 LN?=		/bin/ln
 LS?=		/bin/ls
+LZMA_CMD?=	${LOCALBASE}/bin/lzma
 MKDIR?=		/bin/mkdir -p
 MKTEMP?=	/usr/bin/mktemp
 MOUNT?=		/sbin/mount
diff -ruN Mk.orig/bsd.port.mk Mk/bsd.port.mk
--- Mk.orig/bsd.port.mk	2008-03-05 13:29:25.686153586 -0500
+++ Mk/bsd.port.mk	2008-03-05 18:06:16.925577310 -0500
@@ -94,7 +94,8 @@
 # EXTRACT_SUFX	- Suffix for archive names
 #				  You never have to set both DISTFILES and EXTRACT_SUFX.
 #				  Default: .tar.bz2 if USE_BZIP2 is set, .zip if USE_ZIP is
-#				  set, .run if USE_MAKESELF is set, .tar.gz otherwise).
+#				  set, .run if USE_MAKESELF is set, .tar.lzma if USE_LZMA is
+#                                 set, .tar.gz otherwise).
 # MASTER_SITES	- Primary location(s) for distribution files if not found
 #				  locally.  See bsd.sites.mk for common choices for
 #				  MASTER_SITES.
@@ -294,15 +295,17 @@
 #                         the compiler by setting DEBUG_FLAGS. It is set to
 #                         "-g" at default.
 #
-# USE_BZIP2		- If set, this port tarballs use bzip2, not gzip, for
+# USE_BZIP2		- If set, this port tarball uses bzip2, not gzip, for
+#				  compression.
+# USE_LZMA              - If set, this port tarball uses lzma, not gzip, for
 #				  compression.
 # USE_ZIP		- If set, this port distfile uses zip, not tar w/[bg]zip
 #				  for compression.
 # USE_MAKESELF		- If set, this port distfile uses makeself, not tar w/[bg]zip
 #				  for compression.
-# USE_DOS2UNIX	- If set to "YES", remove the ^M from all files
-#				  under ${WRKSRC}. If set to a string, remove in all
-#				  files under ${WRKSRC} with one of these names the ^Ms.
+# USE_DOS2UNIX		- If set to "YES", remove the ^Ms from all files
+#				  under ${WRKSRC}. If set to a string, remove the ^Ms
+#				  in all files under ${WRKSRC} with one of these names.
 # DOS2UNIX_REGEX
 #				- Limit the ^M removal to files which name matches
 #				  the regular expression.
@@ -813,7 +816,8 @@
 #
 # EXTRACT_CMD	- Command for extracting archive: "bzip2" if USE_BZIP2
 #				  is set, "unzip" if USE_ZIP is set, "unmakeself" if
-#				  USE_MAKESELF if set, "gzip" otherwise.
+#				  USE_MAKESELF is set, "lzma" if USE_LZMA is set, 
+#				  "gzip" otherwise.
 # EXTRACT_BEFORE_ARGS
 #				- Arguments to ${EXTRACT_CMD} before filename.
 #				  Default: "-dc"
@@ -1341,6 +1345,8 @@
 
 .if defined(USE_BZIP2)
 EXTRACT_SUFX?=			.tar.bz2
+.elif defined(USE_LZMA)
+EXTRACT_SUFX?=                  .tar.lzma
 .elif defined(USE_ZIP)
 EXTRACT_SUFX?=			.zip
 .elif defined(USE_MAKESELF)
@@ -1660,6 +1666,9 @@
 .if defined(USE_ZIP)
 EXTRACT_DEPENDS+=	unzip:${PORTSDIR}/archivers/unzip
 .endif
+.if defined(USE_LZMA)
+EXTRACT_DEPENDS+=       lzma:${PORTSDIR}/archivers/lzma
+.endif
 .if defined(USE_MAKESELF)
 EXTRACT_DEPENDS+=	unmakeself:${PORTSDIR}/archivers/unmakeself
 .endif
@@ -2219,16 +2228,20 @@
 EXTRACT_BEFORE_ARGS?=
 EXTRACT_AFTER_ARGS?=
 .else
-EXTRACT_BEFORE_ARGS?=	-dc
 .if defined(EXTRACT_PRESERVE_OWNERSHIP)
 EXTRACT_AFTER_ARGS?=	| ${TAR} -xf - --no-same-owner
 .else
 EXTRACT_AFTER_ARGS?=	| ${TAR} -xf -
 .endif
 .if defined(USE_BZIP2)
-EXTRACT_CMD?=			${BZIP2_CMD}
+EXTRACT_CMD?=		${BZIP2_CMD}
+EXTRACT_BEFORE_ARGS?=	-dc
+.elif defined(USE_LZMA)
+EXTRACT_CMD?=		${LZMA_CMD}
+EXTRACT_BEFORE_ARGS?=	d -so
 .else
-EXTRACT_CMD?=			${GZIP_CMD}
+EXTRACT_CMD?=		${GZIP_CMD}
+EXTRACT_BEFORE_ARGS?=	-dc
 .endif
 .endif
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803052343.m25Nhfg1007274>