# SliTaz package receipt. PACKAGE="nagvis" VERSION="1.9.31" CATEGORY="network" SHORT_DESC="Visualization addon for nagios." MAINTAINER="erjo@slitaz.org" LICENSE="GPL2" WEB_SITE="https://www.nagvis.org/" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="${WEB_SITE}share/$TARBALL" SUGGESTED="graphviz" DEPENDS="mk-livestatus nagios ndoutils php-gd php-mysql" # What is the latest version available today? current_version() { wget -O - $WEB_SITE 2>/dev/null | \ sed '/has been released/!d;s|.*NagVis ||;s| has been.*||;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share/nagvis mkdir -p $fs/etc/apache/conf.d mkdir -p $fs/var/lib/nagvis/var/tmpl/cache mkdir -p $fs/var/lib/nagvis/var/tmpl/compile mkdir -p $fs/usr/share/doc/nagvis cp -a $src/share $fs/usr/share/nagvis cp -a $src/etc $fs/etc/nagvis # copy demo maps. #~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \ #~ $fs/var/lib/nagvis/automap.png # link var directory (FHS) ln -s /var/lib/nagvis/var $fs/usr/share/nagvis/var # move configuration files ln -s /etc/nagvis $fs/usr/share/nagvis/etc # nagvis configuration mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php sed -i -e 's|;language=|language=|' \ -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \ -e 's|;base=.*|base="/usr/share/nagvis/"|' \ -e 's|;htmlbase=|htmlbase=|' \ -e 's|;htmlcgi=|htmlcgi=|' \ -e 's|;backendtype=|backendtype=|' \ -e 's|;dbhost=|dbhost=|' \ -e 's|;dbport=|dbport=|' \ -e 's|;dbname=|dbname=|' \ -e 's|;dbname=|dbname=|' \ -e 's|;dbuser=|dbuser=|' \ -e 's|;dbpass=""|dbpass=|' \ -e 's|;dbprefix=|dbprefix=|' \ -e 's|;dbinstancename=|dbinstancename=|' \ $fs/etc/nagvis/nagvis.ini.php sed -i -e '/;logonmodule=/ { a\logonmodule="LogonEnv"\ logonenvvar="REMOTE_USER"\ logonenvcreateuser="0" }' $fs/etc/nagvis/nagvis.ini.php sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' \ $fs/etc/nagvis/nagvis.ini.php sed -i -e 's/;showautomaps=1/showautomaps=0/' \ $fs/etc/nagvis/nagvis.ini.php # Apache configuration mv $fs/etc/nagvis/apache2-nagvis.conf-sample \ $fs/etc/nagvis/apache2-nagvis.conf ln -s /etc/nagvis/apache2-nagvis.conf \ $fs/etc/apache/conf.d/nagvis.conf sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \ -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \ -e 's|#AuthName|AuthName|' \ -e 's|#AuthType|AuthType|' \ -e 's|#AuthUserFile|AuthUserFile|' \ -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \ -e 's| #Require|Require|' \ $fs/etc/nagvis/apache2-nagvis.conf # Fix permissions chown -R www.www $fs/usr/share/nagvis chown -R www.www $fs/var/lib/nagvis chown -R root.www $fs/etc/nagvis chmod 664 $fs/etc/nagvis/nagvis.ini.php chmod 775 $fs/etc/nagvis/maps chmod 664 $fs/etc/nagvis/maps/* chmod 664 $fs/etc/nagvis/geomap/* # chmod 664 $fs/etc/nagvis/automaps/* chmod 775 $fs/var/lib/nagvis # Cleanup rm -f $fs/usr/share/nagvis/install.* rm -f $fs/usr/share/nagvis/share/uifx mv $fs/usr/share/nagvis/share/userfiles/images/maps \ $fs/var/lib/nagvis chmod 775 $fs/var/lib/nagvis/maps chmod 664 $fs/var/lib/nagvis/maps/* ln -s /var/lib/nagvis/maps \ $fs/usr/share/nagvis/share/userfiles/images/ } post_install() { cat <