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

- Add LICENSE

- Use ETCDIR
- Support STAGEDIR
- Pass maintainership to submitter
- While I'm here:
  - Use NO_BUILD
  - Simplify Makefile

PR:		ports/190311
Submitted by:	Muhammad Moinur Rahman <5u623l20@gmail.com>
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2014-05-30 05:31:46 +00:00
parent 7c36698d22
commit 01315ca45e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=355780
3 changed files with 39 additions and 47 deletions

View File

@ -2,69 +2,53 @@
PORTNAME= hawk
PORTVERSION= 0.6
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= net-mgmt
MASTER_SITES= SF/iphawk/iphawk/Hawk%20${PORTVERSION}/
MAINTAINER= ports@FreeBSD.org
MAINTAINER= 5u623l20@gmail.com
COMMENT= Track uptime and DNS status for machines on your networks
RUN_DEPENDS= p5-Net-Netmask>0:${PORTSDIR}/net-mgmt/p5-Net-Netmask \
p5-Net-Ping-External>0:${PORTSDIR}/net/p5-Net-Ping-External \
p5-DBI>0:${PORTSDIR}/databases/p5-DBI \
p5-DBD-mysql>0:${PORTSDIR}/databases/p5-DBD-mysql
LICENSE= GPLv2
RUN_DEPENDS= p5-Net-Netmask>=0:${PORTSDIR}/net-mgmt/p5-Net-Netmask \
p5-Net-Ping-External>=0:${PORTSDIR}/net/p5-Net-Ping-External \
p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
USES= perl5
USE_MYSQL= server
USE_PHP= mysql
WANT_PHP_MOD= yes
NO_BUILD= yes
USE_RC_SUBR= hawk
SUB_LIST= PERL=${PERL}
SUB_FILES= pkg-message
OPTIONS_DEFINE= DOCS
NO_STAGE= yes
post-patch:
@${SED} -e 's#%%PREFIX%%#${PREFIX}#' \
${WRKSRC}/daemon/hawk > ${WRKSRC}/daemon/hawk.sed
@${MV} ${WRKSRC}/daemon/hawk.sed ${WRKSRC}/daemon/hawk
@${SED} -e 's#hawk.conf.inc#${PREFIX}/etc/hawk/php.conf#' \
${WRKSRC}/php/hawk.php > ${WRKSRC}/php/hawk.php.sed
@${MV} ${WRKSRC}/php/hawk.php.sed ${WRKSRC}/php/hawk.php
do-build:
# Empty target, nothing to build
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
${WRKSRC}/daemon/hawk
@${REINPLACE_CMD} -e 's|hawk.conf.inc|${PREFIX}/etc/hawk/php.conf|' \
${WRKSRC}/php/hawk.php
do-install:
${MKDIR} ${PREFIX}/etc/hawk
${INSTALL_DATA} ${WRKSRC}/daemon/hawk.conf ${PREFIX}/etc/hawk/daemon.conf.sample
${INSTALL_SCRIPT} ${WRKSRC}/daemon/hawk ${PREFIX}/sbin
${MKDIR} ${WWWDIR}/images
${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_DATA} ${WRKSRC}/daemon/hawk.conf ${STAGEDIR}${ETCDIR}/daemon.conf.sample
${INSTALL_SCRIPT} ${WRKSRC}/daemon/hawk ${STAGEDIR}${PREFIX}/sbin
${MKDIR} ${STAGEDIR}${WWWDIR}/images
(for f in ${WRKSRC}/php/images/* ${FILESDIR}/favicon.ico; do \
${INSTALL_DATA} $$f ${WWWDIR}/images; \
${INSTALL_DATA} $$f ${STAGEDIR}${WWWDIR}/images; \
done)
${INSTALL_DATA} ${WRKSRC}/php/hawk.php ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/php/hawk.css ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/php/hawk.conf.inc \
${PREFIX}/etc/hawk/php.conf.sample
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/create_hawk_db.sql ${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/create_hawk_user.sql ${DOCSDIR}
.endif
PKGMESSAGE= ${WRKDIR}/pkg-message
post-install:
@${ECHO} '******************************************************************************' > ${PKGMESSAGE}
@${ECHO} '*** See ${PREFIX}/share/doc/hawk/create_hawk* for instructions on ***' >> ${PKGMESSAGE}
@${ECHO} '*** creating the database and user that the PHP code expects. ***' >> ${PKGMESSAGE}
@${ECHO} '*** ***' >> ${PKGMESSAGE}
@${ECHO} '*** Copy daemon.conf.sample and php.conf.sample to their non-sample ***' >> ${PKGMESSAGE}
@${ECHO} '*** names in ${PREFIX}/etc/hawk, and configure local networks, etc. ***' >> ${PKGMESSAGE}
@${ECHO} '******************************************************************************' >> ${PKGMESSAGE}
@${CAT} ${PKGMESSAGE}
${INSTALL_DATA} ${WRKSRC}/php/hawk.php ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/php/hawk.css ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/php/hawk.conf.inc ${STAGEDIR}${ETCDIR}/php.conf.sample
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/create_hawk_db.sql ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/create_hawk_user.sql ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,8 @@
******************************************************************************
**** See %%PREFIX%%/share/doc/hawk/create_hawk* for instructions on ****
**** creating the database and user that the PHP code expects. ****
**** ****
**** Copy daemon.conf.sample and php.conf.sample to their non-sample ****
**** names in %%ETCDIR%% and configure local networks, etc. ****
******************************************************************************

View File

@ -1,5 +1,5 @@
etc/hawk/daemon.conf.sample
etc/hawk/php.conf.sample
%%ETCDIR%%/daemon.conf.sample
%%ETCDIR%%/php.conf.sample
sbin/hawk
%%WWWDIR%%/images/bluesphere.png
%%WWWDIR%%/images/favicon.ico
@ -15,6 +15,6 @@ sbin/hawk
%%PORTDOCS%%%%DOCSDIR%%/create_hawk_db.sql
%%PORTDOCS%%%%DOCSDIR%%/create_hawk_user.sql
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrmtry etc/hawk
@dirrmtry %%ETCDIR%%
@dirrm %%WWWDIR%%/images
@dirrm %%WWWDIR%%