- Add stage support

- Convert USE_BZIP2 to USES
- Use options helpers
- Remove SSH2 option

Approved by:	portmgr (blanket)
This commit is contained in:
Danilo Egea Gondolfo 2014-07-20 19:21:25 +00:00
parent 5108730061
commit cf2f80efd1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=362355
3 changed files with 26 additions and 50 deletions

View File

@ -17,9 +17,8 @@ LICENSE= GPLv2
RUN_DEPENDS= nagios:${PORTSDIR}/net-mgmt/nagios \
${PEARDIR}/HTML/Template/IT.php:${PORTSDIR}/devel/pear-HTML_Template_IT
USE_BZIP2= yes
USE_MYSQL= yes
USES= gettext
USES= gettext tar:bzip2
USE_PHP= mysql filter gettext session simplexml
WANT_PHP_WEB= yes
@ -30,30 +29,17 @@ NAGIOSUSER?= nagios
NO_BUILD= yes
WRKSRC= ${WRKDIR}/${PORTNAME}32
SUB_FILES= pkg-message pkg-install
SUB_LIST= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} NAGIOSUSER=${NAGIOSUSER}
SUB_FILES= pkg-message
PLIST_SUB= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} NAGIOSUSER=${NAGIOSUSER}
PEARDIR?= ${LOCALBASE}/share/pear
OPTIONS_DEFINE= CURL FTP SSH2
OPTIONS_DEFINE= CURL FTP
CURL_DESC= Configure with cURL support
FTP_DESC= Configure with FTP support
SSH2_DESC= Configure with SSH2 support
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCURL}
USE_PHP+= curl
.endif
.if ${PORT_OPTIONS:MFTP}
USE_PHP+= ftp
.endif
.if ${PORT_OPTIONS:MSSH2}
USE_PHP+= ssh2
.endif
CURL_USE= PHP=curl
FTP_USE= PHP=ftp
post-patch:
${REINPLACE_CMD} -e "s|\'/etc/nagiosql/|\'${ETCDIR}/|g" \
@ -71,12 +57,15 @@ post-patch:
${WRKSRC}/install/install.php
do-install:
@${MKDIR} ${WWWDIR}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${WWWDIR} "! ( -name *\.orig -o -name *\.bak )")
@${CHOWN} ${WWWOWN}:${WWWGRP} ${WWWDIR}/config
post-install:
@${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
@${MKDIR} ${STAGEDIR}${WWWDIR}
@${MKDIR} ${STAGEDIR}${ETCDIR}
@${MKDIR} ${STAGEDIR}${ETCDIR}/ssh
@${MKDIR} ${STAGEDIR}${ETCDIR}/hosts
@${MKDIR} ${STAGEDIR}${ETCDIR}/services
@${MKDIR} ${STAGEDIR}${ETCDIR}/backup
@${MKDIR} ${STAGEDIR}${ETCDIR}/backup/hosts
@${MKDIR} ${STAGEDIR}${ETCDIR}/backup/services
@${MKDIR} ${STAGEDIR}${ETCDIR}/backup/ssh
(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} "! ( -name *\.orig -o -name *\.bak )")
.include <bsd.port.mk>

View File

@ -1,23 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
WWWOWN=%%WWWOWN%%
WWWGRP=%%WWWGRP%%
NAGIOSUSER=%%NAGIOSUSER%%
ETCDIR=%%ETCDIR%%
WWWDIR=%%WWWDIR%%
if [ "$2" = "POST-INSTALL" ]; then
echo "=========== p o s t - i n s t a l l ================="
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/ssh
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/hosts
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/services
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/backup
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/backup/hosts
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/backup/services
install -m 750 -o ${WWWOWN} -g ${NAGIOSUSER} -d ${ETCDIR}/backup/ssh
chown ${WWWOWN}:${WWWGRP} ${WWWDIR}/config
fi

View File

@ -487,9 +487,16 @@
@dirrm %%WWWDIR%%/config/locale/da_DK/LC_MESSAGES
@dirrm %%WWWDIR%%/config/locale/da_DK
@dirrm %%WWWDIR%%/config/locale
@owner %%WWWOWN%%
@group %%WWWGRP%%
@dirrmtry %%WWWDIR%%/config
@group
@owner
@dirrm %%WWWDIR%%/admin
@dirrmtry %%WWWDIR%%
@mode 750
@owner %%WWWOWN%%
@group %%NAGIOSUSER%%
@dirrmtry %%ETCDIR%%/ssh
@dirrmtry %%ETCDIR%%/services
@dirrmtry %%ETCDIR%%/hosts
@ -498,3 +505,6 @@
@dirrmtry %%ETCDIR%%/backup/hosts
@dirrmtry %%ETCDIR%%/backup
@dirrmtry %%ETCDIR%%
@mode
@owner
@group