Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2013 11:40:37 +0100
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/176187: [PATCH] Add and use USE_LHA to handle lha compressed distfiles
Message-ID:  <E1U6fC9-0005hK-7E@rotluchs.lokal>
Resent-Message-ID: <201302161050.r1GAo02j049861@freefall.freebsd.org>

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

>Number:         176187
>Category:       ports
>Synopsis:       [PATCH] Add and use USE_LHA to handle lha compressed distfiles
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 16 10:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Christoph Mallon
>Release:        
>Organization:
>Environment:


	
>Description:
These two patches add support for lha compressed distfiles.
The first patch adds the knob USE_LHA, the second uses it in the ports, which use lha.
The maintainers of the ports are X-GANTS-Notified.
	
>How-To-Repeat:
	
>Fix:
Please apply these patches.

	

--- 0001-Mk-Add-USE_LHA-to-handle-lha-compressed-distfiles.patch begins here ---
>From 2acf9427f47c26ea74f4c0b9130b353035fd5552 Mon Sep 17 00:00:00 2001
From: Christoph Mallon <christoph.mallon@gmx.de>
Date: Sat, 16 Feb 2013 10:00:45 +0100
Subject: [PATCH 1/2] Mk: Add USE_LHA to handle lha compressed distfiles.

---
 Mk/bsd.commands.mk |  1 +
 Mk/bsd.port.mk     | 18 ++++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk
index d20d718..4b8a4d0 100644
--- a/Mk/bsd.commands.mk
+++ b/Mk/bsd.commands.mk
@@ -54,6 +54,7 @@ ID?=		/usr/bin/id
 IDENT?=		/usr/bin/ident
 JOT?=		/usr/bin/jot
 LDCONFIG?=	/sbin/ldconfig
+LHA_CMD?=	${LOCALBASE}/bin/lha
 LN?=		/bin/ln
 LS?=		/bin/ls
 MKDIR?=		/bin/mkdir -p
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index bc4fbdd..45ddb31 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -91,9 +91,9 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 #				  Default: ${DISTNAME}${EXTRACT_SUFX}
 # 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, .tar.xz if USE_XZ is set, .run if USE_MAKESELF is set,
-#				  .tar.gz otherwise).
+#				  Default: .tar.bz2 if USE_BZIP2 is set, .lzh if USE_LHA is set,
+#				  .zip if USE_ZIP is set, .tar.xz if USE_XZ is set, .run if
+#				  USE_MAKESELF 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.
@@ -303,6 +303,7 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 #
 # USE_BZIP2		- If set, this port tarballs use bzip2, not gzip, for
 #				  compression.
+# USE_LHA		- If set, this port distfile uses lha for compression
 # USE_XZ		- If set, this port tarballs use xz (or lzma)
 #				  for compression
 # USE_ZIP		- If set, this port distfile uses zip, not tar w/[bg]zip
@@ -1371,6 +1372,8 @@ ETCDIR?=		${PREFIX}/etc/${PORTNAME}
 
 .if defined(USE_BZIP2)
 EXTRACT_SUFX?=			.tar.bz2
+.elif defined(USE_LHA)
+EXTRACT_SUFX?=			.lzh
 .elif defined(USE_ZIP)
 EXTRACT_SUFX?=			.zip
 .elif defined(USE_XZ)
@@ -1668,6 +1671,9 @@ PKG_DEPENDS+=		${LOCALBASE}/sbin/pkg:${PORTSDIR}/ports-mgmt/pkg
 .endif
 .endif
 
+.if defined(USE_LHA)
+EXTRACT_DEPENDS+=	lha:${PORTSDIR}/archivers/lha
+.endif
 .if defined(USE_ZIP)
 EXTRACT_DEPENDS+=	${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
 .endif
@@ -2326,7 +2332,11 @@ PATCH_DIST_ARGS+=	--suffix .orig
 TAR?=	/usr/bin/tar
 
 # EXTRACT_SUFX is defined in .pre.mk section
-.if defined(USE_ZIP)
+.if defined(USE_LHA)
+EXTRACT_CMD?=		${LHA_CMD}
+EXTRACT_BEFORE_ARGS?=	xfqw=${WRKDIR}
+EXTRACT_AFTER_ARGS?=
+.elif defined(USE_ZIP)
 EXTRACT_CMD?=		${UNZIP_CMD}
 EXTRACT_BEFORE_ARGS?=	-qo
 EXTRACT_AFTER_ARGS?=	-d ${WRKDIR}
-- 
1.8.1.3
--- 0001-Mk-Add-USE_LHA-to-handle-lha-compressed-distfiles.patch ends here ---

--- dummy1 begins here ---
dummy file, because GNATS damages every other patch
--- dummy1 ends here ---

--- 0002-all-Use-USE_LHA.patch begins here ---
>From 66ad5fe8cea546ad0069f239a53f658289fe3101 Mon Sep 17 00:00:00 2001
From: Christoph Mallon <christoph.mallon@gmx.de>
Date: Sat, 16 Feb 2013 11:00:24 +0100
Subject: [PATCH 2/2] all: Use USE_LHA.

---
 astro/luna/Makefile                | 8 +-------
 benchmarks/himenobench/Makefile    | 9 +++------
 converters/uudx/Makefile           | 7 +------
 games/xchadance/Makefile           | 7 +------
 japanese/ajaxzip2-data/Makefile    | 5 +----
 japanese/jstrings/Makefile         | 9 ++-------
 japanese/mikachan-ttfonts/Makefile | 5 +----
 japanese/today/Makefile            | 8 ++------
 japanese/zipcodes/Makefile         | 5 +----
 math/eval/Makefile                 | 5 +----
 10 files changed, 14 insertions(+), 54 deletions(-)

diff --git a/astro/luna/Makefile b/astro/luna/Makefile
index 53a5455..c1a4114 100644
--- a/astro/luna/Makefile
+++ b/astro/luna/Makefile
@@ -10,17 +10,11 @@ PORTVERSION=	1.9
 CATEGORIES=	astro games
 MASTER_SITES=	http://ftp.vector.co.jp/pack/dos/edu/science/space/
 DISTNAME=	luna19s
-EXTRACT_SUFX=	.lzh
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Display the moon's phase
 
-EXTRACT_DEPENDS=	lha:${PORTSDIR}/archivers/lha
-
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	xtfqw=${WRKDIR}
-EXTRACT_AFTER_ARGS=	# empty
-
+USE_LHA=	yes
 NO_WRKSUBDIR=	yes
 PLIST_FILES=	bin/luna
 MAKEFILE=	makefile
diff --git a/benchmarks/himenobench/Makefile b/benchmarks/himenobench/Makefile
index 290b4ef..1770e86 100644
--- a/benchmarks/himenobench/Makefile
+++ b/benchmarks/himenobench/Makefile
@@ -18,10 +18,12 @@ DIST_SUBDIR=	himeno
 MAINTAINER=	maho@FreeBSD.org
 COMMENT=	Himeno bench benchmark, solves Poisson eq. with Jacobi's method
 
+NO_WRKSRCDIR=	yes
+USE_LHA=	yes
+
 .if defined(WITH_ICC)
 BUILD_DEPENDS=	${LOCALBASE}/intel_cc_80/bin/icc:${PORTSDIR}/lang/icc
 .endif
-EXTRACT_DEPENDS=	lha:${PORTSDIR}/archivers/lha
 
 USE_FORTRAN=	yes
 .if defined(WITH_IFC)
@@ -56,11 +58,6 @@ PLIST_SUB+=	WITH_GFORTRAN="@comment "
 PLIST_SUB+=	WITH_GFORTRAN=""
 .endif
 
-do-extract:
-	@${MKDIR} ${WRKSRC}
-	@for i in ${DISTFILES}; do \
-	cd ${WRKSRC} ; lha xf ${DISTDIR}/${DIST_SUBDIR}/$$i; \
-	done
 do-build:
 .if ${USE_FORTRAN} == yes
 	cd ${WRKSRC} ; ${FC} ${FFLAGS} -o himenobmtxp    himenobmtxp.f90
diff --git a/converters/uudx/Makefile b/converters/uudx/Makefile
index 2d7af30..86b90c1 100644
--- a/converters/uudx/Makefile
+++ b/converters/uudx/Makefile
@@ -10,18 +10,13 @@ PORTVERSION=	2.99
 CATEGORIES=	converters
 MASTER_SITES=	http://ftp.vector.co.jp/pack/dos/util/bin/conv/
 DISTNAME=	${PORTNAME}_${PORTVERSION:S/.//}
-EXTRACT_SUFX=	.lzh
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Extractor from uuencoded files
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha
 BUILD_DEPENDS=	nkf:${PORTSDIR}/japanese/nkf
 
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	xfqw=${WRKDIR}
-EXTRACT_AFTER_ARGS=	# empty
-
+USE_LHA=	yes
 NO_WRKSUBDIR=	yes
 MANLANG=	ja
 MAN1=		uudx.1
diff --git a/games/xchadance/Makefile b/games/xchadance/Makefile
index b936edf..f88fa7d 100644
--- a/games/xchadance/Makefile
+++ b/games/xchadance/Makefile
@@ -15,16 +15,11 @@ DISTFILES=	xchada01.lzh
 MAINTAINER=	motoyuki@FreeBSD.org
 COMMENT=	Display a dancing girl "ChaCha."
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha
-
+USE_LHA=	yes
 USE_XORG=	x11
 MAKEFILE=	makefile
 NO_WRKSUBDIR=	yes
 
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	e
-EXTRACT_AFTER_ARGS=
-
 RESTRICTED=	'contains commercial character data'
 
 post-patch:
diff --git a/japanese/ajaxzip2-data/Makefile b/japanese/ajaxzip2-data/Makefile
index f049cef..5024ce6 100644
--- a/japanese/ajaxzip2-data/Makefile
+++ b/japanese/ajaxzip2-data/Makefile
@@ -11,14 +11,11 @@ DISTFILES=	ken_all-${PORTVERSION_K}.lzh jigyosyo-${PORTVERSION_J}.lzh
 MAINTAINER=	kuriyama@FreeBSD.org
 COMMENT=	ajaxzip2 (Japanese ZIP code utility) ZIP data
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha
 BUILD_DEPENDS=	ja-ajaxzip2-core>0:${PORTSDIR}/japanese/ajaxzip2-core \
 		p5-JSON>0:${PORTSDIR}/converters/p5-JSON
 
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	x
-EXTRACT_AFTER_ARGS=
 NO_WRKSUBDIR=	yes
+USE_LHA=	yes
 USE_PERL5_BUILD=yes
 PORTVERSION_K?=	${PORTVERSION}
 PORTVERSION_J?=	${PORTVERSION}
diff --git a/japanese/jstrings/Makefile b/japanese/jstrings/Makefile
index 2ffea8f..ca9a487 100644
--- a/japanese/jstrings/Makefile
+++ b/japanese/jstrings/Makefile
@@ -11,23 +11,18 @@ CATEGORIES=	japanese
 MASTER_SITES=	http://openmya.hacker.jp/hasegawa/jstrings/ \
 		http://devel.aquahill.net/ports/jstrings/ \
 		http://www.kokone.to/~ryo/lib/ports/jstrings/
-EXTRACT_SUFX=	.lzh
 
 MAINTAINER=	ryo@aquahill.net
 COMMENT=	Japanese enhancement of strings(1) command
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha \
-		nkf:${PORTSDIR}/japanese/nkf
+EXTRACT_DEPENDS=nkf:${PORTSDIR}/japanese/nkf
 
 MAN1=		jstrings.1
 MANLANG=	ja
 PLIST_FILES=	bin/jstrings
 
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	xfqw=${WRKDIR}
-EXTRACT_AFTER_ARGS=#	empty
-
 USE_GMAKE=	yes
+USE_LHA=	yes
 MAKEFILE=	makefile.gcc
 MAKE_ARGS=	CC="${CC}" CFLAGS="${CFLAGS}" BINDIR="${PREFIX}/bin"
 ALL_TARGET=	jstrings
diff --git a/japanese/mikachan-ttfonts/Makefile b/japanese/mikachan-ttfonts/Makefile
index 4ad4364..a1bc5bc 100644
--- a/japanese/mikachan-ttfonts/Makefile
+++ b/japanese/mikachan-ttfonts/Makefile
@@ -14,15 +14,12 @@ MASTER_SITES=	http://members.tripod.co.jp/mikachan_font/ \
 		${MASTER_SITE_PORTS_JP}
 MASTER_SITE_SUBDIR=	${PORTNAME}
 DISTNAME=	ver${PORTVERSION}
-EXTRACT_SUFX=	.lzh
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Handwritten Japanese TrueType fonts by Mika-chan
 
-EXTRACT_DEPENDS=	lha:${PORTSDIR}/archivers/lha
-
 NO_CDROM=	"Don't sell distfile"
-EXTRACT_CMD=	lha
+USE_LHA=	yes
 EXTRACT_BEFORE_ARGS=	pq
 EXTRACT_AFTER_ARGS=	> ${WRKSRC}/mika.ttf
 DIST_SUBDIR=	${PORTNAME}
diff --git a/japanese/today/Makefile b/japanese/today/Makefile
index ec0805a..3ce9308 100644
--- a/japanese/today/Makefile
+++ b/japanese/today/Makefile
@@ -16,14 +16,10 @@ DISTFILES=	td${PORTVERSION:S/.//}s.lzh \
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tells you what day today is
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha \
-		nkf:${PORTSDIR}/japanese/nkf
-
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	xfqw=${WRKDIR}
-EXTRACT_AFTER_ARGS=	# empty
+EXTRACT_DEPENDS=nkf:${PORTSDIR}/japanese/nkf
 
 NO_WRKSUBDIR=	yes
+USE_LHA=	yes
 
 MAKEFILE=	${FILESDIR}/Makefile
 
diff --git a/japanese/zipcodes/Makefile b/japanese/zipcodes/Makefile
index e5e7247..d1ca18c 100644
--- a/japanese/zipcodes/Makefile
+++ b/japanese/zipcodes/Makefile
@@ -10,13 +10,10 @@ DISTFILES=	ken_all-${PORTVERSION_K}.lzh jigyosyo-${PORTVERSION_J}.lzh
 MAINTAINER=	kuriyama@FreeBSD.org
 COMMENT=	Japanese zipcode tables. includes both 3/5 and 7 digits form
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha
 BUILD_DEPENDS=	nkf:${PORTSDIR}/japanese/nkf
 
-EXTRACT_CMD=	lha
-EXTRACT_BEFORE_ARGS=	x
-EXTRACT_AFTER_ARGS=
 NO_WRKSUBDIR=	yes
+USE_LHA=	yes
 
 USE_PERL5_BUILD=yes
 MAKE_ENV=	INSTALL_DATA="${INSTALL_DATA}" SCRIPTDIR=${SCRIPTDIR} PERL=${PERL}
diff --git a/math/eval/Makefile b/math/eval/Makefile
index c3ff1ef..d0f5a20 100644
--- a/math/eval/Makefile
+++ b/math/eval/Makefile
@@ -17,11 +17,8 @@ EXTRACT_SUFX=	.lha
 MAINTAINER=	slaven@rezic.de
 COMMENT=	A full featured floating point expression evaluator
 
-EXTRACT_DEPENDS=lha:${PORTSDIR}/archivers/lha
+USE_LHA=	yes
 
-EXTRACT_CMD=		${CAT}
-EXTRACT_BEFORE_ARGS=	# empty
-EXTRACT_AFTER_ARGS=	| lha x -
 PLIST_FILES=		bin/Eval
 
 WRKSRC=		${WRKDIR}/Eval/source
-- 
1.8.1.3
--- 0002-all-Use-USE_LHA.patch ends here ---


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1U6fC9-0005hK-7E>