From cf2f80efd105f9a655aacd8d790cae784fd6e1f7 Mon Sep 17 00:00:00 2001 From: Danilo Egea Gondolfo Date: Sun, 20 Jul 2014 19:21:25 +0000 Subject: [PATCH] - Add stage support - Convert USE_BZIP2 to USES - Use options helpers - Remove SSH2 option Approved by: portmgr (blanket) --- net-mgmt/nagiosql/Makefile | 43 ++++++++++---------------- net-mgmt/nagiosql/files/pkg-install.in | 23 -------------- net-mgmt/nagiosql/pkg-plist | 10 ++++++ 3 files changed, 26 insertions(+), 50 deletions(-) delete mode 100644 net-mgmt/nagiosql/files/pkg-install.in diff --git a/net-mgmt/nagiosql/Makefile b/net-mgmt/nagiosql/Makefile index 7d67335328c0..8d54db9c0904 100644 --- a/net-mgmt/nagiosql/Makefile +++ b/net-mgmt/nagiosql/Makefile @@ -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 - -.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 diff --git a/net-mgmt/nagiosql/files/pkg-install.in b/net-mgmt/nagiosql/files/pkg-install.in deleted file mode 100644 index d27a1fe45264..000000000000 --- a/net-mgmt/nagiosql/files/pkg-install.in +++ /dev/null @@ -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 diff --git a/net-mgmt/nagiosql/pkg-plist b/net-mgmt/nagiosql/pkg-plist index b5936d13a3ab..b06950e491ad 100644 --- a/net-mgmt/nagiosql/pkg-plist +++ b/net-mgmt/nagiosql/pkg-plist @@ -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