diff options
author | ohauer <ohauer@FreeBSD.org> | 2011-05-15 00:50:17 +0800 |
---|---|---|
committer | ohauer <ohauer@FreeBSD.org> | 2011-05-15 00:50:17 +0800 |
commit | e978e19877dfa92f1b134ba9ee1c4fb4bf7badf6 (patch) | |
tree | 71c0c3fa6d9a77b2c9b6722436b3a9f44fbecda9 | |
parent | 6486036d5ef55e470809d25c0d1680d07a73f657 (diff) | |
download | freebsd-ports-gnome-e978e19877dfa92f1b134ba9ee1c4fb4bf7badf6.tar.gz freebsd-ports-gnome-e978e19877dfa92f1b134ba9ee1c4fb4bf7badf6.tar.zst freebsd-ports-gnome-e978e19877dfa92f1b134ba9ee1c4fb4bf7badf6.zip |
- update to version 1.5.9
PR: ports/156608
Submitted by: ohauer
-rw-r--r-- | net-mgmt/nagvis/Makefile | 21 | ||||
-rw-r--r-- | net-mgmt/nagvis/distinfo | 4 | ||||
-rw-r--r-- | net-mgmt/nagvis/files/pkg-install.in | 89 | ||||
-rw-r--r-- | net-mgmt/nagvis/pkg-plist | 2 |
4 files changed, 101 insertions, 15 deletions
diff --git a/net-mgmt/nagvis/Makefile b/net-mgmt/nagvis/Makefile index a31ded92d89c..303a893fbd36 100644 --- a/net-mgmt/nagvis/Makefile +++ b/net-mgmt/nagvis/Makefile @@ -6,9 +6,10 @@ # PORTNAME= nagvis -PORTVERSION= 1.5.8 +PORTVERSION= 1.5.9 CATEGORIES= net-mgmt -MASTER_SITES= SF/${PORTNAME}/NagVis%201.5/ +MASTER_SITES= SF +MASTER_SITE_SUBDIR=${PORTNAME}/NagVis%201.5 MAINTAINER= derfi@vei.ru COMMENT= NagVis is a visualization addon for Nagios @@ -20,7 +21,7 @@ OPTIONS= MKLIVESTATUS "depend on mk-livestatus broker (preferred)" on \ GRAPHVIZ "graphviz is needed for automaps" off NO_BUILD= yes -USE_PHP= gd gettext mbstring mysql session json pdo pdo_sqlite +USE_PHP= gd gettext mbstring session json pdo pdo_sqlite WANT_PHP_WEB= yes DEFAULT_PHP_VER=5 @@ -28,10 +29,15 @@ DEFAULT_PHP_VER=5 WWW_OWNER?= ${WWWOWN} WWW_GROUP?= ${WWWGRP} -SUB_LIST+= WWW_OWNER=${WWW_OWNER} WWW_GROUP=${WWW_GROUP} +DIRMODE?= 750 +FILEMODE?= 640 + +SUB_LIST+= WWW_OWNER=${WWW_OWNER} WWW_GROUP=${WWW_GROUP} \ + DIRMODE=${DIRMODE} FILEMODE=${FILEMODE} SUB_FILES+= pkg-install pkg-deinstall .if defined(WITH_NDO2DB) +USE_PHP+= mysql RUN_DEPENDS+= ndo2db-3x:${PORTSDIR}/net-mgmt/ndoutils .endif @@ -45,7 +51,7 @@ RUN_DEPENDS+= dot:${PORTSDIR}/graphics/graphviz check-sanity: .if !defined(WITH_NDO2DB) && !defined(WITH_MKLIVESTATUS) -IGNORE= please choose at least one nagios broker module +IGNORE= please choose at least one nagios broker module .endif post-extract: @@ -59,10 +65,7 @@ post-patch: ${WRKSRC}/etc/nagvis.ini.php-sample do-install: - @${CP} -R ${WRKSRC} ${WWWDIR} - @${MKDIR} ${WWWDIR}/var/tmpl/cache - @${MKDIR} ${WWWDIR}/var/tmpl/compile - @${MKDIR} ${WWWDIR}/share/var + @( cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${WWWDIR}/ ) post-install: @${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL diff --git a/net-mgmt/nagvis/distinfo b/net-mgmt/nagvis/distinfo index 558f6e456562..ea0a298343c6 100644 --- a/net-mgmt/nagvis/distinfo +++ b/net-mgmt/nagvis/distinfo @@ -1,2 +1,2 @@ -SHA256 (nagvis-1.5.8.tar.gz) = 6c87b19550c90dd4ed54040ff4835e3ceb3a4ba93f723f44763c66d289288817 -SIZE (nagvis-1.5.8.tar.gz) = 3296727 +SHA256 (nagvis-1.5.9.tar.gz) = c0911a474563a8bd78e2454e8cd0f5c2cd8b83891869ada31d4d7ed0abddcbaa +SIZE (nagvis-1.5.9.tar.gz) = 3298253 diff --git a/net-mgmt/nagvis/files/pkg-install.in b/net-mgmt/nagvis/files/pkg-install.in index 29b6b3436724..f7b8377e5891 100644 --- a/net-mgmt/nagvis/files/pkg-install.in +++ b/net-mgmt/nagvis/files/pkg-install.in @@ -1,7 +1,90 @@ #!/bin/sh -# +#-*- mode: makefile; tab-width: 4; -*- +# ex:ts=4 +# $FreeBSD$ + +# Set strict file and directory permissions. +# Idea taken from nagvis install.sh +# 2010-12-30 olli hauer + +OWNER=%%WWW_OWNER%%:%%WWW_GROUP%% +DIRMODE=%%DIRMODE%% +FILEMODE=%%FILEMODE%% + +set_perm() { + # create missing directories + [ "${2#${2%?}}" != '*' ] && /bin/mkdir -p ${2} + + if [ -d "$2" -o -f "$2" -o "${2#${2%?}}" = '*' ]; then + # Don't do anything when called with globbing and directory is empty + if [ "${2#${2%?}}" = '*' -a -z "$(/bin/ls "${2%/*}/")" ]; then + return 0 + else + if [ -z $3 ]; then +# echo "chown -R $OWNER $2" + chown -R $OWNER $2 + else +# echo "chown $OWNER $2" + chown $OWNER $2 + + fi +# echo "chmod $1 $2" + chmod $1 $2 + fi + fi +} + +# handle single files +set_file_perm() { +# echo "chown $OWNER $2" + chown $OWNER $2 + +# echo "chmod $1 $2" + chmod $1 $2 +} + # fix directory owner if installed via package if [ "$2" = "POST-INSTALL" ]; then - echo "Fixing ownership settings ..." - chown -R %%WWW_OWNER%%:%%WWW_GROUP%% %%WWWDIR%% + + # honor PREFIX if installed from package + if [ ! -z $PKG_PREFIX ]; then + NAGVIS_PATH=${PKG_PREFIX%/}/www/nagvis + else + NAGVIS_PATH=%%WWWDIR%% + fi + + echo "===========================================================" + echo "Set access rights on ${NAGVIS_PATH} ..." + + # Set more strict access rights for save keeping. There is no need + # to grant WWW_OWNER:WWW_GROUP general ownership and write permission. + chown root:%%WWW_GROUP%% "$NAGVIS_PATH" + chmod $DIRMODE "$NAGVIS_PATH" + + # from nagvis source install.sh (with some modifications) + set_perm $DIRMODE "$NAGVIS_PATH/etc" non_recursive + set_perm $DIRMODE "$NAGVIS_PATH/etc/automaps" + set_perm $FILEMODE "$NAGVIS_PATH/etc/automaps/*" + set_perm $DIRMODE "$NAGVIS_PATH/etc/geomap" + set_perm $FILEMODE "$NAGVIS_PATH/etc/geomap/*" + set_perm $DIRMODE "$NAGVIS_PATH/etc/maps" + set_perm $FILEMODE "$NAGVIS_PATH/etc/maps/*" + + set_perm $DIRMODE "$NAGVIS_PATH/share/userfiles/images/maps" + set_perm $FILEMODE "$NAGVIS_PATH/share/userfiles/images/maps/*" + set_perm $DIRMODE "$NAGVIS_PATH/share/userfiles/images/shapes" + set_perm $FILEMODE "$NAGVIS_PATH/share/userfiles/images/shapes/*" + set_perm $DIRMODE "$NAGVIS_PATH/var" + set_perm $FILEMODE "$NAGVIS_PATH/var/*" + set_perm $DIRMODE "$NAGVIS_PATH/var/tmpl" + set_perm $DIRMODE "$NAGVIS_PATH/var/tmpl/cache" + set_perm $DIRMODE "$NAGVIS_PATH/var/tmpl/compile" + set_perm $DIRMODE "$NAGVIS_PATH/share/var" + set_perm $FILEMODE "$NAGVIS_PATH/share/var/*" + + # some additional file permission adjustments + set_file_perm $FILEMODE "$NAGVIS_PATH/etc/nagvis.ini.*" + [ -f "$NAGVIS_PATH/etc/auth.db" ] && set_file_perm $FILEMODE "$NAGVIS_PATH/etc/auth.db" + + echo "===========================================================" fi diff --git a/net-mgmt/nagvis/pkg-plist b/net-mgmt/nagvis/pkg-plist index 40f8eb6844b6..d47af9d5e8c2 100644 --- a/net-mgmt/nagvis/pkg-plist +++ b/net-mgmt/nagvis/pkg-plist @@ -820,7 +820,7 @@ @dirrm %%WWWDIR%%/share/frontend/nagvis-js/classes @dirrm %%WWWDIR%%/share/frontend/nagvis-js @dirrm %%WWWDIR%%/share/frontend -@dirrm %%WWWDIR%%/share +@dirrmtry %%WWWDIR%%/share @dirrmtry %%WWWDIR%%/etc/maps @dirrmtry %%WWWDIR%%/etc/geomap @dirrmtry %%WWWDIR%%/etc/automaps |