wok annotate nagvis/receipt @ rev 23836

Up jbig2dec (0.18), metasploit (5.0.91), nginx (1.19.0), spamassassin (3.4.4), sqlite (3.32.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 01 10:15:25 2020 +0000 (2020-06-01)
parents 4e6f31d3d204
children ad8b9ff412d2
rev   line source
erjo@8701 1 # SliTaz package receipt.
erjo@8701 2
erjo@8701 3 PACKAGE="nagvis"
Hans-G?nter@23214 4 VERSION="1.9.18"
erjo@8701 5 CATEGORY="network"
erjo@8701 6 SHORT_DESC="Visualization addon for nagios."
erjo@8701 7 MAINTAINER="erjo@slitaz.org"
pascal@15584 8 LICENSE="GPL2"
Hans-G?nter@21516 9 WEB_SITE="http://www.nagvis.org/"
Hans-G?nter@21516 10
erjo@8701 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
Hans-G?nter@21516 12 WGET_URL="${WEB_SITE}share/$TARBALL"
Hans-G?nter@21516 13
pascal@15584 14 SUGGESTED="graphviz"
Hans-G?nter@21516 15 DEPENDS="mk-livestatus nagios ndoutils php-gd php-mysql"
erjo@8701 16
erjo@8701 17 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@8701 18 genpkg_rules()
erjo@8701 19 {
Hans-G?nter@23214 20 mkdir -p $fs/usr/share/nagvis
Hans-G?nter@23214 21 mkdir -p $fs/etc/apache/conf.d
Hans-G?nter@23214 22 mkdir -p $fs/var/lib/nagvis/var/tmpl/cache
Hans-G?nter@23214 23 mkdir -p $fs/var/lib/nagvis/var/tmpl/compile
Hans-G?nter@23214 24 mkdir -p $fs/usr/share/doc/nagvis
erjo@8701 25
Hans-G?nter@21516 26 cp -a $src/share $fs/usr/share/nagvis
Hans-G?nter@21516 27 cp -a $src/etc $fs/etc/nagvis
erjo@8701 28
erjo@8701 29 # copy demo maps.
erjo@8701 30 #~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \
erjo@8701 31 #~ $fs/var/lib/nagvis/automap.png
Hans-G?nter@21516 32
Hans-G?nter@23214 33 # link var directory (FHS)
erjo@8701 34 ln -s /var/lib/nagvis/var $fs/usr/share/nagvis/var
Hans-G?nter@21516 35
Hans-G?nter@21516 36 # move configuration files
Hans-G?nter@23214 37 ln -s /etc/nagvis $fs/usr/share/nagvis/etc
Hans-G?nter@21516 38
Hans-G?nter@21516 39 # nagvis configuration
erjo@8701 40 mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php
erjo@8701 41 sed -i -e 's|;language=|language=|' \
erjo@8701 42 -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \
erjo@8701 43 -e 's|;base=.*|base="/usr/share/nagvis/"|' \
erjo@8701 44 -e 's|;htmlbase=|htmlbase=|' \
erjo@8701 45 -e 's|;htmlcgi=|htmlcgi=|' \
erjo@8701 46 -e 's|;backendtype=|backendtype=|' \
erjo@8701 47 -e 's|;dbhost=|dbhost=|' \
erjo@8701 48 -e 's|;dbport=|dbport=|' \
erjo@8701 49 -e 's|;dbname=|dbname=|' \
erjo@8701 50 -e 's|;dbname=|dbname=|' \
erjo@8701 51 -e 's|;dbuser=|dbuser=|' \
erjo@8701 52 -e 's|;dbpass=""|dbpass=|' \
erjo@8701 53 -e 's|;dbprefix=|dbprefix=|' \
erjo@8701 54 -e 's|;dbinstancename=|dbinstancename=|' \
erjo@8701 55 $fs/etc/nagvis/nagvis.ini.php
erjo@8701 56
erjo@8701 57 sed -i -e '/;logonmodule=/ {
erjo@8701 58 a\logonmodule="LogonEnv"\
erjo@8701 59 logonenvvar="REMOTE_USER"\
erjo@8701 60 logonenvcreateuser="0"
erjo@8701 61 }' $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 62 sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' \
Hans-G?nter@23214 63 $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 64 sed -i -e 's/;showautomaps=1/showautomaps=0/' \
Hans-G?nter@23214 65 $fs/etc/nagvis/nagvis.ini.php
erjo@8701 66
Hans-G?nter@21516 67 # Apache configuration
Hans-G?nter@23214 68 mv $fs/etc/nagvis/apache2-nagvis.conf-sample \
Hans-G?nter@23214 69 $fs/etc/nagvis/apache2-nagvis.conf
Hans-G?nter@23214 70 ln -s /etc/nagvis/apache2-nagvis.conf \
Hans-G?nter@23214 71 $fs/etc/apache/conf.d/nagvis.conf
erjo@8701 72 sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \
erjo@8701 73 -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \
erjo@8701 74 -e 's|#AuthName|AuthName|' \
erjo@8701 75 -e 's|#AuthType|AuthType|' \
erjo@8701 76 -e 's|#AuthUserFile|AuthUserFile|' \
erjo@8701 77 -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \
Hans-G?nter@23214 78 -e 's| #Require|Require|' \
Hans-G?nter@23214 79 $fs/etc/nagvis/apache2-nagvis.conf
erjo@8701 80
Hans-G?nter@21516 81 # Fix permissions
Hans-G?nter@23214 82 chown -R www.www $fs/usr/share/nagvis
Hans-G?nter@23214 83 chown -R www.www $fs/var/lib/nagvis
Hans-G?nter@23214 84 chown -R root.www $fs/etc/nagvis
erjo@8701 85
Hans-G?nter@23214 86 chmod 664 $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 87 chmod 775 $fs/etc/nagvis/maps
Hans-G?nter@23214 88 chmod 664 $fs/etc/nagvis/maps/*
Hans-G?nter@23214 89 chmod 664 $fs/etc/nagvis/geomap/*
Hans-G?nter@23214 90 # chmod 664 $fs/etc/nagvis/automaps/*
Hans-G?nter@23214 91 chmod 775 $fs/var/lib/nagvis
erjo@8701 92
erjo@8701 93 # Cleanup
Hans-G?nter@23214 94 rm -f $fs/usr/share/nagvis/install.*
Hans-G?nter@23214 95 rm -f $fs/usr/share/nagvis/share/uifx
erjo@8701 96
Hans-G?nter@23214 97 mv $fs/usr/share/nagvis/share/userfiles/images/maps \
Hans-G?nter@23214 98 $fs/var/lib/nagvis
Hans-G?nter@23214 99 chmod 775 $fs/var/lib/nagvis/maps
Hans-G?nter@23214 100 chmod 664 $fs/var/lib/nagvis/maps/*
Hans-G?nter@23214 101 ln -s /var/lib/nagvis/maps \
Hans-G?nter@23214 102 $fs/usr/share/nagvis/share/userfiles/images/
erjo@8701 103 }
erjo@8701 104
erjo@8701 105 post_install()
erjo@8701 106 {
erjo@8701 107 cat <<EOT
erjo@8701 108 Now visit http://localhost/nagvis
erjo@8701 109 EOT
Hans-G?nter@23214 110 if [ -z "$1" ]
Hans-G?nter@23214 111 then
erjo@8701 112 /etc/init.d/nagios stop
erjo@8701 113 /etc/init.d/nagios start
erjo@8701 114 fi
erjo@8701 115 }