diff options
author | ryoon <ryoon@pkgsrc.org> | 2012-10-01 10:45:16 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2012-10-01 10:45:16 +0000 |
commit | 14eac3ca3623ec00cb44e25fd0387be79217b0b9 (patch) | |
tree | 898e499db862c9bdafe18b2f636a6bf3e017ccb5 /mk | |
parent | 728f58418d74532e7b5c33570df7457bfe6da0a1 (diff) | |
download | pkgsrc-14eac3ca3623ec00cb44e25fd0387be79217b0b9.tar.gz |
Add 7z archive distfile support.
Fix PR pkg/42967
Diffstat (limited to 'mk')
-rw-r--r-- | mk/extract/bsd.extract-vars.mk | 6 | ||||
-rwxr-xr-x | mk/extract/extract | 8 | ||||
-rw-r--r-- | mk/extract/extract.mk | 3 | ||||
-rw-r--r-- | mk/tools/defaults.mk | 3 | ||||
-rw-r--r-- | mk/tools/replace.mk | 13 |
5 files changed, 28 insertions, 5 deletions
diff --git a/mk/extract/bsd.extract-vars.mk b/mk/extract/bsd.extract-vars.mk index d024e05ddad..8d68ac04e3f 100644 --- a/mk/extract/bsd.extract-vars.mk +++ b/mk/extract/bsd.extract-vars.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.extract-vars.mk,v 1.13 2010/12/22 09:33:30 tron Exp $ +# $NetBSD: bsd.extract-vars.mk,v 1.14 2012/10/01 10:45:16 ryoon Exp $ # # This Makefile fragment is included separately by bsd.pkg.mk and # defines some variables which must be defined earlier than where @@ -83,3 +83,7 @@ USE_TOOLS+= rpm2pkg .if !empty(EXTRACT_ONLY:M*.gem) USE_TOOLS+= gem .endif +.if !empty(EXTRACT_ONLY:M*.7z) +USE_TOOLS+= 7za +.endif + diff --git a/mk/extract/extract b/mk/extract/extract index 79d048e52d9..8966e4f7b0d 100755 --- a/mk/extract/extract +++ b/mk/extract/extract @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: extract,v 1.12 2010/12/22 09:33:30 tron Exp $ +# $NetBSD: extract,v 1.13 2012/10/01 10:45:16 ryoon Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -118,6 +118,7 @@ set -u # treat undefined variables as errors : ${UNRAR:=unrar} : ${UNZIP_CMD:=unzip} : ${UNZOO:=unzoo} +: ${P7ZA:="7za x"} : ${TMPDIR:=/tmp} @@ -217,6 +218,7 @@ case "$distfile" in *.rpm) _format=rpm ;; *.bin) _format=jre-bin ;; *.gem) _format=gem ;; +*.7z) _format=7z ;; *) _format=none ;; esac ${TEST} -n "$format" || format="$_format" @@ -340,6 +342,10 @@ gem) ${GEM} "$distfile" ;; +7z) + ${P7ZA} "$distfile" + ;; + none) # By default, copy the distfile over to the current working directory. ${CP} "$distfile" . diff --git a/mk/extract/extract.mk b/mk/extract/extract.mk index 5291b038218..a691cde0d68 100644 --- a/mk/extract/extract.mk +++ b/mk/extract/extract.mk @@ -1,4 +1,4 @@ -# $NetBSD: extract.mk,v 1.34 2011/09/08 20:17:16 abs Exp $ +# $NetBSD: extract.mk,v 1.35 2012/10/01 10:45:16 ryoon Exp $ # # The following variables may be set by the package Makefile and # specify how extraction happens: @@ -187,6 +187,7 @@ _EXTRACT_ENV+= ${TOOLS_UNRAR:D UNRAR=${TOOLS_UNRAR:Q}} _EXTRACT_ENV+= ${TOOLS_UNZIP_CMD:D UNZIP_CMD=${TOOLS_UNZIP_CMD:Q}} _EXTRACT_ENV+= ${TOOLS_UNZOO:D UNZOO=${TOOLS_UNZOO:Q}} _EXTRACT_ENV+= ${TOOLS_XZCAT:D XZCAT=${TOOLS_XZCAT:Q}} +_EXTRACT_ENV+= ${TOOLS_7ZA:D P7ZA=${TOOLS_7ZA:Q}} _EXTRACT_ENV+= ${EXTRACT_ENV} .if !empty(EXTRACT_USING:Mbsdtar) diff --git a/mk/tools/defaults.mk b/mk/tools/defaults.mk index bafd4a4d9e6..6fd5b7c1f20 100644 --- a/mk/tools/defaults.mk +++ b/mk/tools/defaults.mk @@ -1,4 +1,4 @@ -# $NetBSD: defaults.mk,v 1.57 2009/07/08 12:51:16 minskim Exp $ +# $NetBSD: defaults.mk,v 1.58 2012/10/01 10:45:16 ryoon Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -113,6 +113,7 @@ _TOOLS_VARNAME.mv= MV _TOOLS_VARNAME.nice= NICE _TOOLS_VARNAME.nroff= NROFF _TOOLS_VARNAME.openssl= OPENSSL +_TOOLS_VARNAME.7za= P7ZA _TOOLS_VARNAME.patch= PATCH _TOOLS_VARNAME.pax= PAX _TOOLS_VARNAME.perl= PERL5 diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk index 067a28dd4d5..92acae0f0e8 100644 --- a/mk/tools/replace.mk +++ b/mk/tools/replace.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace.mk,v 1.251 2012/07/27 10:48:36 jperkin Exp $ +# $NetBSD: replace.mk,v 1.252 2012/10/01 10:45:16 ryoon Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -205,6 +205,17 @@ _TOOLS_USE_PKGSRC.${_t_}?= yes # command, e.g., TOOLS_TBL, TOOLS_YACC, etc., provided that "TOOL" has # been associated with <tool>. # +.if !defined(TOOLS_IGNORE.7za) && !empty(_USE_TOOLS:M7za) +. if !empty(PKGPATH:Marchivers/p7zip) +MAKEFLAGS+= TOOLS_IGNORE.7za= +. elif !empty(_TOOLS_USE_PKGSRC.7za:M[yY][eE][sS]) +TOOLS_DEPENDS.7za?= p7zip>=9.04:../../archivers/p7zip +TOOLS_CREATE+= 7za +TOOLS_FIND_PREFIX+= TOOLS_PREFIX.7za=7za +TOOLS_PATH.7za= ${TOOLS_PREFIX.7za}/bin/7za +. endif +.endif + .if !defined(TOOLS_IGNORE.awk) && !empty(_USE_TOOLS:Mawk) . if !empty(PKGPATH:Mlang/nawk) MAKEFLAGS+= TOOLS_IGNORE.awk= |