1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Support STAGE

This commit is contained in:
Mark Felder 2014-03-17 01:05:34 +00:00
parent 3b8a674f5b
commit d6f8c6d5b4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=348440
3 changed files with 26 additions and 40 deletions

View File

@ -23,7 +23,6 @@ USES= iconv shebangfix perl5
USE_PHP= session pcre sockets
NO_BUILD= yes
PLIST_SUB+= PORTNAME=${PORTNAME}
SUB_FILES= pkg-install
USE_RC_SUBR= nfsen
perl_OLD_CMD= %%PERL%%
SHEBANG_FILES= bin/testPlugin bin/RebuildHierarchy.pl bin/nfsen bin/nfsend libexec/NfSenRRD.pm \
@ -39,7 +38,6 @@ SUB_LIST+= "PREFIX=${PREFIX}"
SUB_LIST+= "WWWDIR=${WWWDIR}"
SUB_LIST+= "PORTNAME=${PORTNAME}"
NO_STAGE= yes
post-patch:
.for nfsenfile in ${REINPLACE_LIST}
@${REINPLACE_CMD} ${_SUB_LIST_TEMP} ${WRKSRC}/${nfsenfile}
@ -47,27 +45,27 @@ post-patch:
.for perlfile in ${SHEBANG_FILES}
@${REINPLACE_CMD} "s|perl -w$$|perl|" ${WRKSRC}/${perlfile}
.endfor
${CP} ${FILESDIR}/conf.php ${WRKSRC}
@${REINPLACE_CMD} ${_SUB_LIST_TEMP} ${WRKSRC}/conf.php
do-install:
${INSTALL} -d ${PREFIX}/var/${PORTNAME}/profiles-data/live
${INSTALL} -d ${PREFIX}/var/${PORTNAME}/profiles-stat/live
${INSTALL} -d ${PREFIX}/var/${PORTNAME}/profiles/live
${INSTALL} -d ${PREFIX}/var/${PORTNAME}/filters
${INSTALL} -d ${PREFIX}/var/${PORTNAME}/run
${INSTALL} -d ${PREFIX}/libexec/${PORTNAME}/plugins
${INSTALL} -d ${WWWDIR}/plugins
(cd ${WRKSRC}/bin && ${INSTALL_SCRIPT} * ${PREFIX}/bin/)
${INSTALL_DATA} ${WRKSRC}/etc/nfsen-dist.conf ${PREFIX}/etc/
(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${WWWDIR}/)
(cd ${WRKSRC}/plugins/frontend/ && ${COPYTREE_SHARE} . ${WWWDIR}/plugins/)
(cd ${WRKSRC}/libexec && ${INSTALL_SCRIPT} * ${PREFIX}/libexec/${PORTNAME}/)
(cd ${WRKSRC}/plugins/backend && ${COPYTREE_SHARE} . ${PREFIX}/libexec/${PORTNAME}/plugins/)
${INSTALL_DATA} ${WRKSRC}/installer-items/CopyRecursive.pm ${PREFIX}/libexec/${PORTNAME}/
${INSTALL_DATA} ${WRKSRC}/installer-items/RRDconvertv1.pm ${PREFIX}/libexec/${PORTNAME}/
${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-data/live
${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-stat/live
${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles/live
${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/filters
${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/run
${INSTALL} -d ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins
${INSTALL} -d ${STAGEDIR}/${WWWDIR}/plugins
(cd ${WRKSRC}/bin && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/bin/)
${INSTALL_DATA} ${WRKSRC}/etc/nfsen-dist.conf ${STAGEDIR}/${PREFIX}/etc/
(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/)
(cd ${WRKSRC}/plugins/frontend/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/plugins/)
(cd ${WRKSRC}/libexec && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/)
(cd ${WRKSRC}/plugins/backend && ${COPYTREE_SHARE} . ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins/)
${INSTALL_DATA} ${WRKSRC}/installer-items/CopyRecursive.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/
${INSTALL_DATA} ${WRKSRC}/installer-items/RRDconvertv1.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/
${INSTALL_DATA} ${WRKSRC}/conf.php ${STAGEDIR}/${WWWDIR}
@${ECHO_MSG} "Configure your ${LOCALBASE}/etc/nfsen.conf to have necessary sources ";
@${ECHO_MSG} "Then run 'nfsen reconfig' to correctly setup source, RRD, and profile files";
post-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1,8 @@
<?php
/* This file was automatically created by the NfSen %%PORTVERSION%% install.pl script */
$COMMSOCKET = "%%PREFIX%%/var/nfsen/run/nfsen.comm";
$DEBUG=0;
?>

View File

@ -1,20 +0,0 @@
#!/bin/sh
# Created by: Mark Felder <feld@FreeBSD.org>
# $FreeBSD$
if [ "$2" = "POST-INSTALL" ]; then
# generate conf.php
/usr/bin/printf "<?php
/* This file was automatically created by the NfSen %%PORTVERSION%% install.pl script */
\$COMMSOCKET = \"%%PREFIX%%/var/nfsen/run/nfsen.comm\";
\$DEBUG=0;
?>" > %%WWWDIR%%/conf.php
# chown some files
/usr/sbin/chown -R www:www %%PREFIX%%/var/nfsen
fi