freebsd-ports/Mk/Uses/zip.mk
Mathieu Arnold ec218a1332 Change the meaning of NO_WRKSUBDIR to force a WRKDIR != WRKSRC.
Right now, NO_WRKSUBDIR means that the extraction does not produce a
subdirectory, and that everything goes straight into WRKDIR.  It is
problematic, because during the build of a port, quite a few files are
created in there, and then, a stage directory, where everything is
installed, and then a pkg directory where the package is created, and
those often conflict, or get in the way, of the building process.

With this, NO_WRKSUBDIR will extract the distfiles directly into WRKSRC
instead of WRKDIR.  In this case, WRKSRC is artificial and is based on
PKGNAME and not DISTNAME, mitigate conflicts with rc files.

PR:		204056
Submitted by:	mat
Reviewed by:	bapt
Exp-run:	antoine
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D2735
2015-11-05 12:35:26 +00:00

28 lines
538 B
Makefile

# $FreeBSD$
#
# handle zip archives
#
# Feature: zip
# Usage: USES=zip[:infozip]
#
# MAINTAINER: portmgr@FreeBSD.org
.if !defined(_INCLUDE_USES_ZIP_MK)
_INCLUDE_USES_ZIP_MK= yes
EXTRACT_SUFX?= .zip
EXTRACT_BEFORE_ARGS?= -qo
EXTRACT_AFTER_ARGS?= -d ${EXTRACT_WRKDIR}
.if empty(zip_ARGS)
EXTRACT_CMD?= ${UNZIP_NATIVE_CMD}
.elif ${zip_ARGS} == "infozip"
EXTRACT_DEPENDS+= ${UNZIP_CMD}:${PORTSDIR}/archivers/unzip
EXTRACT_CMD?= ${UNZIP_CMD}
.else
IGNORE= Incorrect 'USES+=zip:${zip_ARGS}' expecting 'USES+=zip[:infozip]'
.endif
.endif