diff options
author | jlam <jlam> | 2007-07-31 17:42:40 +0000 |
---|---|---|
committer | jlam <jlam> | 2007-07-31 17:42:40 +0000 |
commit | 0eedaaea4fe63eeedb9b152b545a24adff551535 (patch) | |
tree | 6ca9e44cd5e09709e149046ddcf9fac8af1253d2 | |
parent | 790666c7b9128c33ec5fbb8801d3a2943d224098 (diff) | |
download | pkgsrc-0eedaaea4fe63eeedb9b152b545a24adff551535.tar.gz |
Teach the extract module to extract RPMs with rpm2pkg.
-rw-r--r-- | mk/extract/bsd.extract-vars.mk | 5 | ||||
-rwxr-xr-x | mk/extract/extract | 10 | ||||
-rw-r--r-- | mk/extract/extract.mk | 4 | ||||
-rw-r--r-- | mk/tools/replace.mk | 13 |
4 files changed, 28 insertions, 4 deletions
diff --git a/mk/extract/bsd.extract-vars.mk b/mk/extract/bsd.extract-vars.mk index cc7076b83ae..92def75fbea 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.6 2006/10/15 01:56:06 minskim Exp $ +# $NetBSD: bsd.extract-vars.mk,v 1.7 2007/07/31 17:42:40 jlam Exp $ # # This Makefile fragment is included separately by bsd.pkg.mk and # defines some variables which must be defined earlier than where @@ -65,6 +65,9 @@ USE_TOOLS+= unzoo .if !empty(EXTRACT_ONLY:M*.rar) USE_TOOLS+= unrar .endif +.if !empty(EXTRACT_ONLY:M*.rpm) +USE_TOOLS+= rpm2pkg +.endif .if !empty(EXTRACT_ONLY:M*.gem) USE_TOOLS+= gem .endif diff --git a/mk/extract/extract b/mk/extract/extract index 7d3a94ea063..62d8b1ee76d 100755 --- a/mk/extract/extract +++ b/mk/extract/extract @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: extract,v 1.6 2006/10/18 19:18:12 ben Exp $ +# $NetBSD: extract,v 1.7 2007/07/31 17:42:40 jlam Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -88,6 +88,7 @@ # EXTRACT_OPTS_LHA # EXTRACT_OPTS_PAX # EXTRACT_OPTS_RAR +# EXTRACT_OPTS_RPM # EXTRACT_OPTS_TAR # EXTRACT_OPTS_ZIP # EXTRACT_OPTS_ZOO @@ -110,6 +111,7 @@ set -u # treat undefined variables as errors : ${MKDIR:=mkdir} : ${PAX:=pax} : ${RM:=rm} +: ${RPM2PKG:=rpm2pkg} : ${SH:=sh} : ${TAR:=tar} : ${TEST:=test} @@ -208,6 +210,7 @@ case "$distfile" in _format=compressed ;; *.zoo) _format=zoo ;; *.rar) _format=rar ;; +*.rpm) _format=rpm ;; *.bin) _format=jre-bin ;; *.gem) _format=gem ;; *) _format=none ;; @@ -319,6 +322,11 @@ rar) ${UNRAR} x ${EXTRACT_OPTS_RAR} "$distfile" ${1+"$@"} ;; +rpm) + : ${EXTRACT_OPTS_RPM=} + ${RPM2PKG} -d . ${EXTRACT_OPTS_RPM} "$distfile" ${1+"$@"} + ;; + jre-bin) : ${EXTRACT_OPTS_BIN=} ${ECHO} yes | "$distfile" ${EXTRACT_OPTS_BIN} >/dev/null diff --git a/mk/extract/extract.mk b/mk/extract/extract.mk index d8436f1aa7f..ddc68ce8ad1 100644 --- a/mk/extract/extract.mk +++ b/mk/extract/extract.mk @@ -1,4 +1,4 @@ -# $NetBSD: extract.mk,v 1.19 2007/01/09 05:13:27 rillig Exp $ +# $NetBSD: extract.mk,v 1.20 2007/07/31 17:42:40 jlam Exp $ # # The following variables may be set by the package Makefile and # specify how extraction happens: @@ -154,6 +154,7 @@ _EXTRACT_ENV+= ${EXTRACT_OPTS_BIN:D EXTRACT_OPTS_BIN=${EXTRACT_OPTS_BIN:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_LHA:D EXTRACT_OPTS_LHA=${EXTRACT_OPTS_LHA:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_PAX:D EXTRACT_OPTS_PAX=${EXTRACT_OPTS_PAX:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_RAR:D EXTRACT_OPTS_RAR=${EXTRACT_OPTS_RAR:Q}} +_EXTRACT_ENV+= ${EXTRACT_OPTS_RPM:D EXTRACT_OPTS_LHA=${EXTRACT_OPTS_RPM:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_TAR:D EXTRACT_OPTS_TAR=${EXTRACT_OPTS_TAR:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_ZIP:D EXTRACT_OPTS_ZIP=${EXTRACT_OPTS_ZIP:Q}} _EXTRACT_ENV+= ${EXTRACT_OPTS_ZOO:D EXTRACT_OPTS_ZOO=${EXTRACT_OPTS_ZOO:Q}} @@ -165,6 +166,7 @@ _EXTRACT_ENV+= ${TOOLS_CMDLINE.gzcat:D GZCAT=${TOOLS_CMDLINE.gzcat:Q}} _EXTRACT_ENV+= ${TOOLS_LHA:D LHA=${TOOLS_LHA:Q}} _EXTRACT_ENV+= ${TOOLS_MKDIR:D MKDIR=${TOOLS_MKDIR:Q}} _EXTRACT_ENV+= ${TOOLS_RM:D RM=${TOOLS_RM:Q}} +_EXTRACT_ENV+= ${TOOLS_RPM2PKG:D RPM2PKG=${TOOLS_RPM2PKG:Q}} _EXTRACT_ENV+= ${TOOLS_PAX:D PAX=${TOOLS_PAX:Q}} _EXTRACT_ENV+= ${TOOLS_SH:D SH=${TOOLS_SH:Q}} _EXTRACT_ENV+= ${TOOLS_TAR:D TAR=${TOOLS_TAR:Q}} diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk index afd11a95e10..68075924901 100644 --- a/mk/tools/replace.mk +++ b/mk/tools/replace.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace.mk,v 1.193 2007/07/02 14:56:10 joerg Exp $ +# $NetBSD: replace.mk,v 1.194 2007/07/31 17:42:40 jlam Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -635,6 +635,17 @@ TOOLS_PATH.pod2man= ${TOOLS_PREFIX.pod2man}/bin/pod2man . endif .endif +.if !defined(TOOLS_IGNORE.rpm2pkg) && !empty(_USE_TOOLS:Mrpm2pkg) +. if !empty(PKGPATH:Mpkgtools/rpm2pkg) +MAKEFLAGS+= TOOLS_IGNORE.rpm2pkg= +. elif !empty(_TOOLS_USE_PKGSRC.rpm2pkg:M[yY][eE][sS]) +TOOLS_DEPENDS.rpm2pkg?= rpm2pkg>=2.1:../../pkgtools/rpm2pkg +TOOLS_CREATE+= rpm2pkg +TOOLS_FIND_PREFIX+= TOOLS_PREFIX.rpm2pkg=rpm2pkg +TOOLS_PATH.rpm2pkg= ${TOOLS_PREFIX.rpm2pkg}/bin/rpm2pkg +. endif +.endif + .if !defined(TOOLS_IGNORE.sed) && !empty(_USE_TOOLS:Msed) . if !empty(PKGPATH:Mtextproc/nbsed) MAKEFLAGS+= TOOLS_IGNORE.sed= |