2007-07-31 19:42:40 +02:00
|
|
|
# $NetBSD: bsd.extract-vars.mk,v 1.7 2007/07/31 17:42:40 jlam 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
|
|
|
#
|
|
|
|
|
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)
|
|
|
|
. if !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
|
2006-08-19 22:32:28 +02:00
|
|
|
. else
|
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
|
|
|
|
.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
|