- update to version 1.5.9

PR:		ports/156608
Submitted by:	ohauer
This commit is contained in:
Olli Hauer 2011-05-14 16:50:17 +00:00
parent d5f12237b1
commit 58ce275fd1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=274113
4 changed files with 101 additions and 15 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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