ab348058e8
has turned off show hosts. It's nice not to have to load 190+ images just so I can select a host from the dropdown. Do some general cleanup of the port infrastructure. - Install into a staging directory in the build target and install that. - Add a target to generate the plist from the staging directory rather than doing it by hand. - Use a pkg-install script to copy conf.php.sample to conf.php as needed instead of some bits in the make file and different ones in the plist. - Use SUB_FILES to handle pkg-message rather than hand-rolled sed.
100 lines
3 KiB
Makefile
100 lines
3 KiB
Makefile
# Ports collection makefile for: ganglia-webfrontend
|
|
# Date created: Thu Fed 20, 2003
|
|
# Whom: Brooks Davis <brooks@freebsd.org>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= webfrontend
|
|
PORTVERSION= 3.0.1
|
|
PORTREVISION= 1
|
|
CATEGORIES= sysutils net parallel www
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
MASTER_SITE_SUBDIR= ganglia
|
|
PKGNAMEPREFIX= ganglia-
|
|
DISTNAME= ganglia-${PORTVERSION}
|
|
|
|
MAINTAINER= brooks@FreeBSD.org
|
|
COMMENT= "Ganglia cluster monitor, web frontend"
|
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/sbin/gmetad:${PORTSDIR}/sysutils/ganglia-monitor-core
|
|
|
|
PKGINSTALL= ${WRKDIR}/pkg-install
|
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
|
|
|
SUB_FILES+= pkg-install pkg-message
|
|
SUB_LIST+= WEBFRONTDIR="${WEBFRONTDIR}"
|
|
|
|
PLIST_SUB+= WEBFRONTDIR="${WEBFRONTDIR}"
|
|
|
|
USE_REINPLACE= yes
|
|
USE_PHP= gd pcre xml
|
|
USE_BZIP2= yes
|
|
WANT_PHP_MOD= yes
|
|
WRKSRC= ${WRKDIR}/${DISTNAME}/web
|
|
|
|
# The Ganglia Web Frontend port supports a number of options that may be
|
|
# tweaked at buildtime. Perform a "make options" to see more
|
|
# information on these variables.
|
|
WEBFRONTDIR?= www/ganglia
|
|
WWWOWN?= www
|
|
WWWGRP?= www
|
|
|
|
# Set custom variables:
|
|
#
|
|
PKGOPTS= ${FILESDIR}/pkg-opts
|
|
EXCEPTFILES= AUTHORS \
|
|
ChangeLog \
|
|
COPYING \
|
|
Makefile.am \
|
|
addons \
|
|
version.php.in \
|
|
webfrontend.spec
|
|
CPIOARGS= --quiet -pdum -R
|
|
TMP_WEBFRONTDIR= ${WRKDIR}/webfrontend
|
|
|
|
options:
|
|
@ ${ECHO_MSG} "===> Build options for ${PKGNAME}:"
|
|
@ ${CAT} ${PKGOPTS}
|
|
|
|
post-extract:
|
|
.if !defined(BATCH)
|
|
@ ${TEST} -r ${PKGOPTS} && \
|
|
(${ECHO_MSG} '-------------------------------------------------------------------------'; \
|
|
${ECHO_MSG} 'Perform a "make options" to see a list of available installation options.'; \
|
|
${ECHO_MSG} '-------------------------------------------------------------------------')
|
|
.endif
|
|
|
|
post-patch:
|
|
@ ${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|g" ${WRKSRC}/conf.php
|
|
|
|
do-build:
|
|
@${MKDIR} -m 0755 ${TMP_WEBFRONTDIR}
|
|
@cd ${WRKSRC} && ${FIND} * \( -name conf.php\* \
|
|
${EXCEPTFILES:S/^/-o -name /} -o -name \*.orig \) \
|
|
-a -prune -o -print \
|
|
| ${TAR} cTf - - | ${TAR} xUCf ${TMP_WEBFRONTDIR} -
|
|
@${CP} ${WRKSRC}/conf.php ${TMP_WEBFRONTDIR}/conf.php.sample
|
|
|
|
do-install:
|
|
@${MKDIR} -m 0755 ${PREFIX}/${WEBFRONTDIR}
|
|
@${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/${WEBFRONTDIR}
|
|
@cd ${TMP_WEBFRONTDIR} && \
|
|
${FIND} . | \
|
|
${CPIO} ${CPIOARGS} ${WWWOWN}:${WWWGRP} ${PREFIX}/${WEBFRONTDIR}
|
|
|
|
post-install:
|
|
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
build-plist:
|
|
@${FIND} ${TMP_WEBFRONTDIR}/* -type f | \
|
|
${SED} -e 's|${TMP_WEBFRONTDIR}|%%WEBFRONTDIR%%|' | \
|
|
${SORT} > ${PLIST}
|
|
@${FIND} ${TMP_WEBFRONTDIR}/* -type d | \
|
|
${SED} -e 's|${TMP_WEBFRONTDIR}|@dirrm %%WEBFRONTDIR%%|' | \
|
|
${SORT} -r >> ${PLIST}
|
|
@${ECHO} '@unexec if cmp -s %D/%%WEBFRONTDIR%%/conf.php %D/%%WEBFRONTDIR%%/conf.php.sample ; then rm -f %D/%%WEBFRONTDIR%%/conf.php; fi' >> ${PLIST}
|
|
@${ECHO} '@unexec rmdir %D/%%WEBFRONTDIR%% 2>/dev/null || (echo "Configuration information saved. If you will *NOT* use this package anymore," && echo "please remove %D/%%WEBFRONTDIR%% and its contents manually.")' >> ${PLIST}
|
|
|
|
.include <bsd.port.mk>
|