pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Teach the new tools framework about lha, unrar, unz...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0750e7221613
branches:  trunk
changeset: 493740:0750e7221613
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri May 13 22:08:20 2005 +0000

description:
Teach the new tools framework about lha, unrar, unzip, and unzoo and
modify bsd.pkg.extract.mk to use them.  As a side-effect, we stop
hardcoding ${LOCALBASE} as the install prefix for these tools so this
becomes more pkgviews-friendly.

diffstat:

 mk/bsd.pkg.extract.mk |  30 +++++++++++++++++++++++++-----
 mk/tools/defaults.mk  |   6 +++++-
 mk/tools/replace.mk   |  50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 79 insertions(+), 7 deletions(-)

diffs (170 lines):

diff -r d4776191735c -r 0750e7221613 mk/bsd.pkg.extract.mk
--- a/mk/bsd.pkg.extract.mk     Fri May 13 21:57:13 2005 +0000
+++ b/mk/bsd.pkg.extract.mk     Fri May 13 22:08:20 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.extract.mk,v 1.1 2005/05/11 04:01:49 jlam Exp $
+# $NetBSD: bsd.pkg.extract.mk,v 1.2 2005/05/13 22:08:20 jlam Exp $
 #
 # This Makefile fragment is included to bsd.pkg.mk and defines the
 # relevant variables and targets for the "extract" phase.
@@ -61,11 +61,21 @@
 .  endif
 .endif
 .if !empty(EXTRACT_ONLY:M*.zip) || !empty(EXTRACT_SUFX:M*.zip)
+.  if !empty(_USE_NEW_TOOLS:M[yY][eE][sS])
+PKGSRC_USE_TOOLS+=     unzip
+.  else
 BUILD_DEPENDS+=                unzip-[0-9]*:../../archivers/unzip
+UNZIP=                 ${LOCALBASE}/bin/unzip
+.  endif
 .endif
 .if !empty(EXTRACT_ONLY:M*.lzh) || !empty(EXTRACT_ONLY:M*.lha) || \
     !empty(EXTRACT_SUFX:M*.lzh) || !empty(EXTRACT_SUFX:M*.lha)
+.  if !empty(_USE_NEW_TOOLS:M[yY][eE][sS])
+PKGSRC_USE_TOOLS+=     lha
+.  else
 BUILD_DEPENDS+=                lha>=114.9:../../archivers/lha
+LHA=                   ${LOCALBASE}/bin/lha
+.  endif
 .endif
 .if !empty(EXTRACT_ONLY:M*.gz) || !empty(EXTRACT_ONLY:M*.tgz) || \
     !empty(EXTRACT_SUFX:M*.gz) || !empty(EXTRACT_SUFX:M*.tgz)
@@ -77,10 +87,20 @@
 .  endif
 .endif
 .if !empty(EXTRACT_ONLY:M*.zoo) || !empty(EXTRACT_SUFX:M*.zoo)
+.  if !empty(_USE_NEW_TOOLS:M[yY][eE][sS])
+PKGSRC_USE_TOOLS+=     unzoo
+.  else
 BUILD_DEPENDS+=                unzoo-[0-9]*:../../archivers/unzoo
+UNZOO=                 ${LOCALBASE}/bin/unzoo
+.  endif
 .endif
 .if !empty(EXTRACT_ONLY:M*.rar) || !empty(EXTRACT_SUFX:M*.rar)
+.  if !empty(_USE_NEW_TOOLS:M[yY][eE][sS])
+PKGSRC_USE_TOOLS+=     unrar
+.  else
 BUILD_DEPENDS+=                unrar>=3.3.4:../../archivers/unrar
+UNRAR=                 ${LOCALBASE}/bin/unrar
+.  endif
 .endif
 
 DECOMPRESS_CMD.tar.gz?=                ${GZCAT}
@@ -111,15 +131,15 @@
 
 DOWNLOADED_DISTFILE=   $${extract_file}
 
-EXTRACT_CMD.zip?=      ${LOCALBASE}/bin/unzip ${EXTRACT_CMD_OPTS.zip} $${extract_file}
+EXTRACT_CMD.zip?=      ${UNZIP} ${EXTRACT_CMD_OPTS.zip} $${extract_file}
 EXTRACT_CMD_OPTS.zip?= -Laqo
-EXTRACT_CMD.lha?=      ${LOCALBASE}/bin/lha ${EXTRACT_CMD_OPTS.lha} $${extract_file}
+EXTRACT_CMD.lha?=      ${LHA} ${EXTRACT_CMD_OPTS.lha} $${extract_file}
 EXTRACT_CMD_OPTS.lha?= xq
 EXTRACT_CMD.lzh?=      ${EXTRACT_CMD.lha}
 EXTRACT_CMD_OPTS.lzh?= ${EXTRACT_CMD_OPTS.lha}
-EXTRACT_CMD.zoo?=      ${LOCALBASE}/bin/unzoo ${EXTRACT_CMD_OPTS.zoo} $${extract_file}
+EXTRACT_CMD.zoo?=      ${UNZOO} ${EXTRACT_CMD_OPTS.zoo} $${extract_file}
 EXTRACT_CMD_OPTS.zoo?= -x
-EXTRACT_CMD.rar?=      ${LOCALBASE}/bin/unrar ${EXTRACT_CMD_OPTS.rar} $${extract_file}
+EXTRACT_CMD.rar?=      ${UNRAR} ${EXTRACT_CMD_OPTS.rar} $${extract_file}
 EXTRACT_CMD_OPTS.rar?= x -inul
 EXTRACT_ENV.bin?=      # empty
 EXTRACT_CMD.bin?=      ${ECHO} yes | ${SETENV} ${EXTRACT_ENV.bin} $${extract_file} ${EXTRACT_CMD_OPTS.bin} >/dev/null
diff -r d4776191735c -r 0750e7221613 mk/tools/defaults.mk
--- a/mk/tools/defaults.mk      Fri May 13 21:57:13 2005 +0000
+++ b/mk/tools/defaults.mk      Fri May 13 22:08:20 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defaults.mk,v 1.10 2005/05/12 03:57:40 jlam Exp $
+# $NetBSD: defaults.mk,v 1.11 2005/05/13 22:08:20 jlam Exp $
 
 .if !defined(TOOLS_DEFAULTS_MK)
 TOOLS_DEFAULTS_MK=     defined
@@ -51,6 +51,7 @@
 _TOOLS_VARNAME.install=                INSTALL
 _TOOLS_VARNAME.ldconfig=       LDCONFIG
 _TOOLS_VARNAME.lex=            LEX
+_TOOLS_VARNAME.lha=            LHA
 _TOOLS_VARNAME.ln=             LN
 _TOOLS_VARNAME.ls=             LS
 _TOOLS_VARNAME.m4=             M4
@@ -76,6 +77,9 @@
 _TOOLS_VARNAME.tr=             TR
 _TOOLS_VARNAME.true=           TRUE
 _TOOLS_VARNAME.tsort=          TSORT
+_TOOLS_VARNAME.unrar=          UNRAR
+_TOOLS_VARNAME.unzip=          UNZIP
+_TOOLS_VARNAME.unzoo=          UNZOO
 _TOOLS_VARNAME.wc=             WC
 _TOOLS_VARNAME.xargs=          XARGS
 _TOOLS_VARNAME.xmkmf=          XMKMF_CMD
diff -r d4776191735c -r 0750e7221613 mk/tools/replace.mk
--- a/mk/tools/replace.mk       Fri May 13 21:57:13 2005 +0000
+++ b/mk/tools/replace.mk       Fri May 13 22:08:20 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.70 2005/05/13 21:57:13 jlam Exp $
+# $NetBSD: replace.mk,v 1.71 2005/05/13 22:08:20 jlam Exp $
 #
 # This Makefile fragment handles "replacements" of system-supplied
 # tools with pkgsrc versions.
@@ -556,6 +556,18 @@
 .  endif
 .endif
 
+.if !defined(TOOLS_IGNORE.lha) && !empty(_USE_TOOLS:Mlha)
+.  if !empty(PKGPATH:Marchivers/lha)
+MAKEFLAGS+=                    TOOLS_IGNORE.lha=
+.  elif !empty(_TOOLS_USE_PKGSRC.lha:M[yY][eE][sS])
+TOOLS_DEPENDS.lha?=            lha>=114.9:../../archivers/lha
+TOOLS_CREATE+=                 lha
+EVAL_PREFIX+=                  TOOLS_PREFIX.lha=lha
+TOOLS_REAL_CMD.lha=            ${TOOLS_PREFIX.lha}/bin/lha
+TOOLS_${_TOOLS_VARNAME.lha}=   ${TOOLS_REAL_CMD.lha}
+.  endif
+.endif
+
 .if !defined(TOOLS_IGNORE.ln) && !empty(_USE_TOOLS:Mln)
 .  if !empty(PKGPATH:Msysutils/coreutils)
 MAKEFLAGS+=                    TOOLS_IGNORE.ln=
@@ -866,6 +878,42 @@
 .  endif
 .endif
 
+.if !defined(TOOLS_IGNORE.unrar) && !empty(_USE_TOOLS:Munrar)
+.  if !empty(PKGPATH:Marchivers/unrar)
+MAKEFLAGS+=                    TOOLS_IGNORE.unrar=
+.  elif !empty(_TOOLS_USE_PKGSRC.unrar:M[yY][eE][sS])
+TOOLS_DEPENDS.unrar?=          unrar>=3.3.4:../../archivers/unrar
+TOOLS_CREATE+=                 unrar
+EVAL_PREFIX+=                  TOOLS_PREFIX.unrar=unrar
+TOOLS_REAL_CMD.unrar=          ${TOOLS_PREFIX.unrar}/bin/unrar
+TOOLS_${_TOOLS_VARNAME.unrar}= ${TOOLS_REAL_CMD.unrar}
+.  endif
+.endif
+
+.if !defined(TOOLS_IGNORE.unzip) && !empty(_USE_TOOLS:Munzip)
+.  if !empty(PKGPATH:Marchivers/unzip)
+MAKEFLAGS+=                    TOOLS_IGNORE.unzip=
+.  elif !empty(_TOOLS_USE_PKGSRC.unzip:M[yY][eE][sS])
+TOOLS_DEPENDS.unzip?=          unzip-[0-9]*:../../archivers/unzip
+TOOLS_CREATE+=                 unzip
+EVAL_PREFIX+=                  TOOLS_PREFIX.unzip=unzip
+TOOLS_REAL_CMD.unzip=          ${TOOLS_PREFIX.unzip}/bin/unzip
+TOOLS_${_TOOLS_VARNAME.unzip}= ${TOOLS_REAL_CMD.unzip}
+.  endif
+.endif
+
+.if !defined(TOOLS_IGNORE.unzoo) && !empty(_USE_TOOLS:Munzoo)
+.  if !empty(PKGPATH:Marchivers/unzoo)
+MAKEFLAGS+=                    TOOLS_IGNORE.unzoo=
+.  elif !empty(_TOOLS_USE_PKGSRC.unzoo:M[yY][eE][sS])
+TOOLS_DEPENDS.unzoo?=          unzoo-[0-9]*:../../archivers/unzoo
+TOOLS_CREATE+=                 unzoo
+EVAL_PREFIX+=                  TOOLS_PREFIX.unzoo=unzoo
+TOOLS_REAL_CMD.unzoo=          ${TOOLS_PREFIX.unzoo}/bin/unzoo
+TOOLS_${_TOOLS_VARNAME.unzoo}= ${TOOLS_REAL_CMD.unzoo}
+.  endif
+.endif
+
 .if !defined(TOOLS_IGNORE.wc) && !empty(_USE_TOOLS:Mwc)
 .  if !empty(PKGPATH:Msysutils/coreutils)
 MAKEFLAGS+=                    TOOLS_IGNORE.wc=



Home | Main Index | Thread Index | Old Index