pkgsrc/www/drupal/Makefile
jlam 4390d56940 Make it easier to build and install packages "unprivileged", where
the owner of all installed files is a non-root user.  This change
affects most packages that require special users or groups by making
them use the specified unprivileged user and group instead.

(1) Add two new variables PKG_GROUPS_VARS and PKG_USERS_VARS to
    unprivileged.mk.  These two variables are lists of other bmake
    variables that define package-specific users and groups.  Packages
    that have user-settable variables for users and groups, e.g. apache
    and APACHE_{USER,GROUP}, courier-mta and COURIER_{USER,GROUP},
    etc., should list these variables in PKG_USERS_VARS and PKG_GROUPS_VARS
    so that unprivileged.mk can know to set them to ${UNPRIVILEGED_USER}
    and ${UNPRIVILEGED_GROUP}.

(2) Modify packages to use PKG_GROUPS_VARS and PKG_USERS_VARS.
2007-07-04 20:54:31 +00:00

80 lines
2.5 KiB
Makefile

# $NetBSD: Makefile,v 1.22 2007/07/04 20:55:04 jlam Exp $
DISTNAME= drupal-5.1
CATEGORIES= www
MASTER_SITES= http://drupal.org/files/projects/
MAINTAINER= adrianp@NetBSD.org
HOMEPAGE= http://drupal.org/
COMMENT= Open source content management system
DEPENDS+= ${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}>=4.3.3:../../www/ap-php
DEPENDS+= ${PHP_PKG_PREFIX}-gd>=4.3.3:../../graphics/php-gd
NO_BUILD= YES
DRUPAL= ${PREFIX}/share/drupal
PAX_DIRS= includes misc modules scripts themes
PKG_GROUPS_VARS+= APACHE_GROUP
PKG_USERS_VARS+= APACHE_USER
OWN_DIRS+= ${DRUPAL}/sites/default
OWN_DIRS_PERMS+= ${DRUPAL}/files ${APACHE_USER} ${APACHE_GROUP} 0750
CONF_FILES= ${PREFIX}/share/examples/drupal/drupal.conf \
${PKG_SYSCONFDIR}/drupal.conf
CONF_FILES+= ${PREFIX}/share/examples/drupal/default.profile \
${DRUPAL}/profiles/default/default.profile
CONF_FILES_PERMS+= ${PREFIX}/share/examples/drupal/settings.php \
${DRUPAL}/sites/default/settings.php \
${APACHE_USER} ${APACHE_GROUP} 0640
SUBST_CLASSES+= conf
SUBST_STAGE.conf= pre-install
SUBST_FILES.conf= drupal.conf
SUBST_SED.conf= -e "s|@DRUPAL@|${DRUPAL}|g"
SUBST_MESSAGE.conf= Fixing configuration files.
.include "../../mk/apachever.mk"
.include "../../lang/php/phpversion.mk"
.include "options.mk"
post-extract:
${CP} ${FILESDIR}/drupal.conf ${WRKSRC}
do-install:
${INSTALL_DATA_DIR} ${DRUPAL}
${INSTALL_DATA_DIR} ${DRUPAL}/files
${INSTALL_DATA_DIR} ${DRUPAL}/profiles
${INSTALL_DATA_DIR} ${DRUPAL}/profiles/default
${INSTALL_DATA_DIR} ${DRUPAL}/sites
${INSTALL_DATA_DIR} ${DRUPAL}/sites/all
${INSTALL_DATA_DIR} ${DRUPAL}/sites/default
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/drupal
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/drupal
${INSTALL_DATA} ${WRKSRC}/*.txt ${PREFIX}/share/doc/drupal
${INSTALL_DATA} ${WRKSRC}/robots.txt ${DRUPAL}
${INSTALL_DATA} ${WRKSRC}/sites/all/README.txt \
${DRUPAL}/sites/all
${INSTALL_DATA} ${WRKSRC}/drupal.conf \
${PREFIX}/share/examples/drupal/drupal.conf
${INSTALL_DATA} ${WRKSRC}/sites/default/settings.php \
${PREFIX}/share/examples/drupal/settings.php
${INSTALL_DATA} ${WRKSRC}/profiles/default/default.profile \
${PREFIX}/share/examples/drupal/default.profile
${INSTALL_DATA} ${WRKSRC}/*.php ${DRUPAL}
. for i in ${PAX_DIRS}
cd ${WRKSRC}/${i} && ${PAX} -rw . ${DRUPAL}/${i}
. endfor
${CHOWN} ${APACHE_USER}:${APACHE_GROUP} ${DRUPAL}/files
${CHMOD} 0770 ${DRUPAL}/files
post-install:
${FIND} ${DRUPAL} -name \*.jpg | ${XARGS} ${CHMOD} 0644
${FIND} ${DRUPAL} -name \*.png | ${XARGS} ${CHMOD} 0644
.include "../../mk/bsd.pkg.mk"