Support STAGE

Future update should move files to WWWDIR

Sponsored by:	SupraNet Communications, Inc
This commit is contained in:
Mark Felder 2014-06-27 16:59:28 +00:00
parent f49c41a045
commit 5def1213bb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=359580

View file

@ -11,6 +11,8 @@ DISTNAME= php-weathermap-${PORTVERSION}
MAINTAINER= hhyou@cs.nctu.edu.tw
COMMENT= A network visualisation tool with web editor
LICENSE= GPLv2
RUN_DEPENDS= ${LOCALBASE}/share/pear/Console/Getopt.php:${PORTSDIR}/devel/pear \
rrdtool:${PORTSDIR}/databases/rrdtool
@ -18,8 +20,6 @@ NO_BUILD= yes
USES= zip
USE_PHP= gd
LICENSE= GPLv2
WM_FILES= HTML_ImageMap.class.php WeatherMap.functions.php \
WeatherMapLink.class.php WeatherMapNode.class.php \
Weathermap.class.php weathermap.conf
@ -34,42 +34,35 @@ WRKSRC= ${WRKDIR}/weathermap
SUB_FILES= pkg-message
NO_STAGE= yes
.include <bsd.port.pre.mk>
post-patch:
${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' ${WRKSRC}/editor.php
${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \
-e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/weathermap
# ${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' ${WRKSRC}/editor.php
do-install:
@${MKDIR} ${DATADIR}/www/configs
@${INSTALL_SCRIPT} ${WRKSRC}/weathermap ${PREFIX}/bin/phpweathermap
@${MKDIR} ${STAGEDIR}/${DATADIR}/www/configs
@${INSTALL_SCRIPT} ${WRKSRC}/weathermap ${STAGEDIR}/${PREFIX}/bin/phpweathermap
@for i in ${WM_FILES}; do \
${INSTALL_DATA} ${WRKSRC}/$$i ${DATADIR}/$$i; \
${INSTALL_DATA} ${WRKSRC}/$$i ${STAGEDIR}/${DATADIR}/$$i; \
done
@for i in ${WM_WWW_FILES}; do \
${INSTALL_DATA} ${WRKSRC}/$$i ${DATADIR}/www/$$i; \
${INSTALL_DATA} ${WRKSRC}/$$i ${STAGEDIR}/${DATADIR}/www/$$i; \
done
@${CP} -R ${WRKSRC}/lib ${DATADIR}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} "${WM_WWW_DIRS}" ${DATADIR}/www)
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${DATADIR}/www
.if !defined(NOPORTEXAMPLES)
@(cd ${WRKSRC} && ${COPYTREE_SHARE} "random-bits" ${EXAMPLESDIR})
@${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} \
${EXAMPLESDIR:S|^${PREFIX}/|%D/|}' >> ${TMPPLIST}
@${FIND} ${EXAMPLESDIR} -type f -print0 | ${XARGS} -0 ${CHMOD} 644
@${ECHO_CMD} '@exec ${FIND} ${EXAMPLESDIR} -type f -print0 | \
${XARGS} -0 ${CHMOD} 644' >> ${TMPPLIST}
@${FIND} ${EXAMPLESDIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 755
@${ECHO_CMD} '@exec ${FIND} ${EXAMPLESDIR} -type d -print0 | \
${XARGS} -0 ${CHMOD} 755' >> ${TMPPLIST}
@${CP} -R ${WRKSRC}/lib ${STAGEDIR}/${DATADIR}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} "${WM_WWW_DIRS}" ${STAGEDIR}/${DATADIR}/www)
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${STAGEDIR}/${DATADIR}/www
.if ${PORT_OPTIONS:MEXAMPLES}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} "random-bits" ${STAGEDIR}/${EXAMPLESDIR})
@${FIND} ${STAGEDIR}/${EXAMPLESDIR} -type f -print0 | ${XARGS} -0 ${CHMOD} 644
@${FIND} ${STAGEDIR}/${EXAMPLESDIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 755
.endif
post-install:
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}/${DOCSDIR}
@${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}/${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}