2014-06-18 14:16:43 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Support for Drupal ports and modules.
|
|
|
|
#
|
|
|
|
# Feature: drupal
|
|
|
|
# Usage: USES=drupal or USES=drupal:ARGS
|
|
|
|
# Valid ARGS: module <version> theme
|
|
|
|
#
|
|
|
|
# module The port is a drupal module
|
|
|
|
#
|
2016-01-09 09:07:02 +01:00
|
|
|
# MAINTAINER: ports@FreeBSD.org
|
2014-06-18 14:16:43 +02:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_DRUPAL_Mk)
|
|
|
|
_INCLUDE_USES_DRUPAL_Mk= yes
|
|
|
|
|
2016-06-18 10:22:11 +02:00
|
|
|
.if ${drupal_ARGS:M[7]}
|
|
|
|
_DRUPAL_VERSION= ${drupal_ARGS:M[7]}
|
2014-06-18 14:16:43 +02:00
|
|
|
.endif
|
|
|
|
|
2016-06-18 10:22:11 +02:00
|
|
|
VALID_VERSIONS= 7
|
2014-06-18 14:16:43 +02:00
|
|
|
|
2016-06-18 10:22:11 +02:00
|
|
|
.if ${drupal_ARGS:N[7]:Ntheme:Nmodule}
|
|
|
|
IGNORE= Unknown argument for USES=drupal: ${drupal_ARGS:N[7]:Ntheme:Nmodule}
|
2014-06-18 14:16:43 +02:00
|
|
|
.endif
|
|
|
|
|
2016-06-18 10:22:11 +02:00
|
|
|
_DRUPAL_COMP= ${drupal_ARGS:N[7]}
|
2014-06-18 14:16:43 +02:00
|
|
|
|
|
|
|
.if !defined(_DRUPAL_VERSION) || ! ${VALID_VERSIONS:M${_DRUPAL_VERSION}}
|
|
|
|
IGNORE= Missing or invalid argument for USES=drupal, a version must be provided: ${VALID_VERSIONS}
|
|
|
|
.endif
|
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if ${drupal_ARGS:Mmodule} && ${drupal_ARGS:Mtheme}
|
2014-06-18 14:16:43 +02:00
|
|
|
IGNORE= theme and module arguments are mutually exclusive for USES=drupal
|
|
|
|
.endif
|
|
|
|
|
|
|
|
DRUPAL_BASE?= www/drupal${_DRUPAL_VERSION}
|
|
|
|
|
|
|
|
DRUPAL_DIR= ${PREFIX}/${DRUPAL_BASE}
|
|
|
|
DRUPAL_DOCSDIR?= ${PREFIX}/${DRUPAL_BASE}/doc
|
|
|
|
PLIST_SUB+= DRUPAL_BASE=${DRUPAL_BASE}
|
|
|
|
SUB_LIST+= DRUPAL_BASE=${DRUPAL_BASE} DRUPAL_DIR=${DRUPAL_DIR}
|
|
|
|
|
|
|
|
.if ! ${_DRUPAL_COMP}
|
|
|
|
DOCSDIR?= ${DRUPAL_DOCSDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${_DRUPAL_COMP}
|
2014-08-07 11:50:22 +02:00
|
|
|
_USES_POST+= drupal
|
2014-06-18 14:16:43 +02:00
|
|
|
PKGNAMEPREFIX= drupal${_DRUPAL_VERSION}-
|
|
|
|
|
|
|
|
# drupal contributions must be licensed under the GPLv2 or GPLv3. This is
|
|
|
|
# documented at: http://drupal.org/licensing/faq/
|
|
|
|
.if !defined(LICENSE)
|
|
|
|
LICENSE= GPLv2 GPLv3
|
|
|
|
LICENSE_COMB= dual
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(DRUPAL_MODSUBDIR)
|
|
|
|
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${_DRUPAL_COMP}s/${DRUPAL_MODSUBDIR}
|
|
|
|
.else
|
|
|
|
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${_DRUPAL_COMP}s
|
|
|
|
.endif
|
|
|
|
|
|
|
|
DRUPAL_MODLIB?= ${DRUPAL_BASE}/sites/all/libraries
|
|
|
|
|
|
|
|
DOCSDIR?= ${DRUPAL_DOCSDIR}/${PORTNAME}
|
|
|
|
|
|
|
|
MASTER_SITE_DRUPAL+= \
|
|
|
|
http://ftp.drupal.org/files/projects/ \
|
|
|
|
http://ftp.osuosl.org/pub/drupal/files/projects/
|
|
|
|
MASTER_SITE_DRUPAL_SUBDIR=
|
|
|
|
|
|
|
|
MASTER_SITES?= ${MASTER_SITE_DRUPAL}
|
|
|
|
MASTER_SITE_SUBDIR?= ${MASTER_SITE_DRUPAL_SUBDIR}
|
|
|
|
|
|
|
|
DIST_SUBDIR= drupal
|
|
|
|
|
|
|
|
NO_BUILD?= yes
|
|
|
|
|
|
|
|
WRKSRC?= ${WRKDIR}/${PORTNAME}
|
2016-03-27 03:23:25 +02:00
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/${DRUPAL_BASE}/index.php:${DRUPAL_BASE}
|
2014-06-18 14:16:43 +02:00
|
|
|
|
|
|
|
PLIST_SUB+= DRUPAL_MODDIR=${DRUPAL_MODDIR}
|
|
|
|
PLIST_FILES+= "@owner www" \
|
|
|
|
"@group www" \
|
|
|
|
${MODULE_FILES:C|^|%%DRUPAL_MODDIR%%/|} \
|
|
|
|
"@owner root" \
|
2014-11-14 22:35:11 +01:00
|
|
|
"@group wheel"
|
2014-06-18 14:16:43 +02:00
|
|
|
PLIST_DIRS+= ${MODULE_DIRS:C|^|%%DRUPAL_MODDIR%%/|}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_DRUPAL_POST_MK)
|
|
|
|
_INCLUDE_USES_DRUPAL_POST_MK= yes
|
|
|
|
|
|
|
|
.if ${_DRUPAL_COMP}
|
|
|
|
.if ${PORT_OPTIONS:MDOCS}
|
|
|
|
PLIST_FILES+= ${DOC_FILES:C|^|%%DOCSDIR%%/|}
|
|
|
|
PLIST_DIRS+= ${DOC_DIRS:C|^|%%DOCSDIR%%/|}
|
|
|
|
PLIST_DIRS+= %%DOCSDIR%%
|
|
|
|
.endif
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
@${MKDIR} ${DRUPAL_MODDIR:C|^|${STAGEDIR}${PREFIX}/|}
|
|
|
|
.if defined(MODULE_DIRS)
|
|
|
|
@${MKDIR} ${MODULE_DIRS:C|^|${STAGEDIR}${PREFIX}/${DRUPAL_MODDIR}/|}
|
|
|
|
.endif
|
|
|
|
.for f in ${MODULE_FILES}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/${DRUPAL_MODDIR}/${f}
|
|
|
|
.endfor
|
|
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR} ${DOC_DIRS:C|^|${STAGEDIR}${DOCSDIR}/|}
|
|
|
|
.for f in ${DOC_FILES}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/${f}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.endif
|
|
|
|
.endif
|