diff -ruN Mk1/Uses/bundle.mk Mk2/Uses/bundle.mk --- Mk1/Uses/bundle.mk 1969-12-31 16:00:00.000000000 -0800 +++ Mk2/Uses/bundle.mk 2015-12-07 16:36:20.956465000 -0800 @@ -0,0 +1,29 @@ +# $FreeBSD$ +# +# Provide support for the bundled projects +# +# Feature: bundle +# Usage: USES=bundle +# +# MAINTAINER: portmgr@FreeBSD.org + +# BUNDLE - set of bundled submodules in the form directory:group +# that will be extracted under WRKSRC. +# Extracted submodules should be present in DISTFILES. + +.if !defined(_INCLUDE_USES_BUNDLE_MK) +_INCLUDE_USES_BUNDLE_MK= yes + +_USES_extract+= 900:do-bundle +do-bundle: + @${ECHO} "===> Extracting bundled submodules for ${PKGNAME}" +.for b in ${BUNDLE:C@.*:@@} + @[ -d ${WRKSRC}/${BUNDLE:M*\:${b}:C@:.*@@} ] || ${ECHO} "No directory for the bundle ${b}: ${WRKSRC}/${BUNDLE:M*\:${b}:C@:.*@@}" + @[ -n "${DISTFILES:M*\:${b}:C@:.*@@}" ] || ${ECHO} "No distfile for the bundle ${b}: ${DISTFILES:M*\:${b}:C@:.*@@}" + @${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES:M*\:${b}:C@:.*@@} \ + -C ${WRKSRC}/${BUNDLE:M*\:${b}:C@:.*@@} --strip 1; +.endfor + +EXTRACT_ONLY=${DISTFILES:N*\:*} + +.endif