2013-11-16 08:45:26 +01:00
|
|
|
# $NetBSD: bsd.extract-vars.mk,v 1.16 2013/11/16 07:45:26 shattered Exp $
|
2006-06-06 05:05:48 +02:00
|
|
|
#
|
2006-06-06 17:28:51 +02:00
|
|
|
# This Makefile fragment is included separately by bsd.pkg.mk and
|
|
|
|
# defines some variables which must be defined earlier than where
|
|
|
|
# bsd.extract.mk is included.
|
2006-06-06 05:05:48 +02:00
|
|
|
#
|
|
|
|
# The following variables may be set by the package Makefile and
|
|
|
|
# specify how extraction happens:
|
|
|
|
#
|
|
|
|
# EXTRACT_ONLY is a list of distfiles relative to ${_DISTDIR} to
|
|
|
|
# extract and defaults to ${DISTFILES}.
|
|
|
|
#
|
|
|
|
# EXTRACT_SUFX is the suffix for the default distfile to be
|
2006-08-19 22:06:57 +02:00
|
|
|
# extracted. The default suffix is ".tar.gz".
|
2006-06-06 05:05:48 +02:00
|
|
|
#
|
|
|
|
|
2007-11-07 10:52:58 +01:00
|
|
|
_VARGROUPS+= extract
|
|
|
|
_PKG_VARS.extract= EXTRACT_DIR EXTRACT_ONLY EXTRACT_SUFX EXTRACT_CMD \
|
|
|
|
EXTRACT_OPTS EXTRACT_USING EXTRACT_ELEMENTS
|
|
|
|
_SYS_VARS.extract= EXTRACT_CMD_DEFAULT
|
2006-08-19 22:06:57 +02:00
|
|
|
|
2006-06-06 05:05:48 +02:00
|
|
|
EXTRACT_ONLY?= ${DISTFILES}
|
|
|
|
EXTRACT_SUFX?= .tar.gz
|
|
|
|
|
|
|
|
###
|
|
|
|
### Discover which tools we need based on the file extensions of the
|
|
|
|
### distfiles.
|
|
|
|
###
|
2006-08-19 22:32:28 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.tar) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tar.*) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tbz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tbz2) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tgz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*-tar.gz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*_tar.gz)
|
2008-05-25 22:02:02 +02:00
|
|
|
. if !empty(EXTRACT_USING:Mbsdtar)
|
|
|
|
USE_TOOLS+= bsdtar
|
|
|
|
. elif !empty(EXTRACT_USING:Mgtar)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= gtar
|
2006-08-19 22:32:28 +02:00
|
|
|
. elif !empty(EXTRACT_USING:Mnbtar)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= tar
|
2007-12-30 14:37:18 +01:00
|
|
|
. elif !empty(EXTRACT_USING:Mpax)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= pax
|
2006-08-19 22:32:28 +02:00
|
|
|
. endif
|
|
|
|
.endif
|
2006-09-13 13:10:36 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.cpio) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.cpio.bz2) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.cpio.gz)
|
|
|
|
USE_TOOLS+= pax
|
|
|
|
.endif
|
2006-08-19 22:32:28 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.bz2) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tbz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tbz2)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= bzcat
|
2006-08-19 22:32:28 +02:00
|
|
|
.endif
|
2013-11-16 08:45:26 +01:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.lz)
|
|
|
|
USE_TOOLS+= lzip
|
|
|
|
.endif
|
2008-11-15 21:25:34 +01:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.lzma)
|
2010-12-22 10:33:30 +01:00
|
|
|
USE_TOOLS+= xzcat
|
2008-11-15 21:25:34 +01:00
|
|
|
.endif
|
2009-07-08 15:27:52 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.xz)
|
|
|
|
USE_TOOLS+= xzcat
|
|
|
|
.endif
|
2006-08-19 22:32:28 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.zip)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= unzip
|
2006-08-19 22:32:28 +02:00
|
|
|
.endif
|
|
|
|
.if !empty(EXTRACT_ONLY:M*.lzh) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.lha)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= lha
|
2006-08-19 22:32:28 +02:00
|
|
|
.endif
|
|
|
|
.if !empty(EXTRACT_ONLY:M*.gz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.tgz) || \
|
|
|
|
!empty(EXTRACT_ONLY:M*.Z)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= gzcat
|
2006-08-19 22:32:28 +02:00
|
|
|
.endif
|
|
|
|
.if !empty(EXTRACT_ONLY:M*.zoo)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= unzoo
|
2006-08-19 22:32:28 +02:00
|
|
|
.endif
|
|
|
|
.if !empty(EXTRACT_ONLY:M*.rar)
|
2006-06-06 05:05:48 +02:00
|
|
|
USE_TOOLS+= unrar
|
|
|
|
.endif
|
2007-07-31 19:42:40 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.rpm)
|
|
|
|
USE_TOOLS+= rpm2pkg
|
|
|
|
.endif
|
2006-10-15 03:56:06 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.gem)
|
|
|
|
USE_TOOLS+= gem
|
|
|
|
.endif
|
2012-10-01 12:45:16 +02:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.7z)
|
2013-04-12 14:38:14 +02:00
|
|
|
USE_TOOLS+= 7za
|
2012-10-01 12:45:16 +02:00
|
|
|
.endif
|
|
|
|
|