Line 0
Link Here
|
|
|
1 |
# $FreeBSD$ |
2 |
# |
3 |
# Provide support for the bundled projects |
4 |
# |
5 |
# Feature: bundle |
6 |
# Usage: USES=bundle |
7 |
# |
8 |
# MAINTAINER: portmgr@FreeBSD.org |
9 |
|
10 |
# BUNDLE - set of bundled submodules in the form directory:group |
11 |
# that will be extracted under WRKSRC. |
12 |
# Extracted submodules should be present in DISTFILES. |
13 |
# BUNDLE_ROOT - The root path for the bundle. Default: WRKSRC |
14 |
# BUNDLE_MKDIR - Create bundle directories. Default: no |
15 |
|
16 |
.if !defined(_INCLUDE_USES_BUNDLE_MK) |
17 |
_INCLUDE_USES_BUNDLE_MK= yes |
18 |
|
19 |
BUNDLE_ROOT?=${WRKSRC} |
20 |
BUNDLE_MKDIR?=no |
21 |
|
22 |
_USES_extract+= 900:do-bundle |
23 |
do-bundle: |
24 |
@${ECHO} "===> Extracting bundled submodules for ${PKGNAME}" |
25 |
.for b in ${BUNDLE:C@.*:@@} |
26 |
@[ ${BUNDLE_MKDIR} != yes ] || ${MKDIR} "${BUNDLE_ROOT}/${BUNDLE:M*\:${b}:C@:.*@@}" |
27 |
@[ -d "${BUNDLE_ROOT}/${BUNDLE:M*\:${b}:C@:.*@@}" ] || (${ECHO} "No directory for the bundle '${b}': >>${BUNDLE_ROOT}/${BUNDLE:M*\:${b}:C@:.*@@}<<" && return 1) |
28 |
@[ -n "${DISTFILES:M*\:${b}:C@:.*@@}" ] || (${ECHO} "No distfile for the bundle '${b}': ${DISTFILES:M*\:${b}:C@:.*@@}" && return 1) |
29 |
@${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES:M*\:${b}:C@:.*@@} \ |
30 |
-C ${BUNDLE_ROOT}/${BUNDLE:M*\:${b}:C@:.*@@} --strip 1; |
31 |
.endfor |
32 |
|
33 |
EXTRACT_ONLY=${DISTFILES:N*\:*} |
34 |
|
35 |
.endif |