wok-6.x annotate nagvis/receipt @ rev 25510

Update some web_site
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 12 20:36:56 2023 +0000 (20 months ago)
parents ad8b9ff412d2
children
rev   line source
erjo@8701 1 # SliTaz package receipt.
erjo@8701 2
erjo@8701 3 PACKAGE="nagvis"
Hans-G?nter@24953 4 VERSION="1.9.31"
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@24953 9 WEB_SITE="https://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
pascal@24433 17 # What is the latest version available today?
pascal@24433 18 current_version()
pascal@24433 19 {
pascal@24433 20 wget -O - $WEB_SITE 2>/dev/null | \
pascal@24433 21 sed '/has been released/!d;s|.*NagVis ||;s| has been.*||;q'
pascal@24433 22 }
pascal@24433 23
erjo@8701 24 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@8701 25 genpkg_rules()
erjo@8701 26 {
Hans-G?nter@23214 27 mkdir -p $fs/usr/share/nagvis
Hans-G?nter@23214 28 mkdir -p $fs/etc/apache/conf.d
Hans-G?nter@23214 29 mkdir -p $fs/var/lib/nagvis/var/tmpl/cache
Hans-G?nter@23214 30 mkdir -p $fs/var/lib/nagvis/var/tmpl/compile
Hans-G?nter@23214 31 mkdir -p $fs/usr/share/doc/nagvis
Hans-G?nter@24953 32
Hans-G?nter@21516 33 cp -a $src/share $fs/usr/share/nagvis
Hans-G?nter@21516 34 cp -a $src/etc $fs/etc/nagvis
erjo@8701 35
erjo@8701 36 # copy demo maps.
erjo@8701 37 #~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \
erjo@8701 38 #~ $fs/var/lib/nagvis/automap.png
Hans-G?nter@21516 39
Hans-G?nter@23214 40 # link var directory (FHS)
Hans-G?nter@24953 41 ln -s /var/lib/nagvis/var $fs/usr/share/nagvis/var
Hans-G?nter@21516 42
Hans-G?nter@21516 43 # move configuration files
Hans-G?nter@24953 44 ln -s /etc/nagvis $fs/usr/share/nagvis/etc
Hans-G?nter@21516 45
Hans-G?nter@21516 46 # nagvis configuration
erjo@8701 47 mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php
erjo@8701 48 sed -i -e 's|;language=|language=|' \
erjo@8701 49 -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \
erjo@8701 50 -e 's|;base=.*|base="/usr/share/nagvis/"|' \
erjo@8701 51 -e 's|;htmlbase=|htmlbase=|' \
erjo@8701 52 -e 's|;htmlcgi=|htmlcgi=|' \
erjo@8701 53 -e 's|;backendtype=|backendtype=|' \
erjo@8701 54 -e 's|;dbhost=|dbhost=|' \
erjo@8701 55 -e 's|;dbport=|dbport=|' \
erjo@8701 56 -e 's|;dbname=|dbname=|' \
erjo@8701 57 -e 's|;dbname=|dbname=|' \
erjo@8701 58 -e 's|;dbuser=|dbuser=|' \
erjo@8701 59 -e 's|;dbpass=""|dbpass=|' \
erjo@8701 60 -e 's|;dbprefix=|dbprefix=|' \
erjo@8701 61 -e 's|;dbinstancename=|dbinstancename=|' \
erjo@8701 62 $fs/etc/nagvis/nagvis.ini.php
erjo@8701 63
erjo@8701 64 sed -i -e '/;logonmodule=/ {
erjo@8701 65 a\logonmodule="LogonEnv"\
erjo@8701 66 logonenvvar="REMOTE_USER"\
erjo@8701 67 logonenvcreateuser="0"
erjo@8701 68 }' $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 69 sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' \
Hans-G?nter@23214 70 $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 71 sed -i -e 's/;showautomaps=1/showautomaps=0/' \
Hans-G?nter@23214 72 $fs/etc/nagvis/nagvis.ini.php
erjo@8701 73
Hans-G?nter@21516 74 # Apache configuration
Hans-G?nter@23214 75 mv $fs/etc/nagvis/apache2-nagvis.conf-sample \
Hans-G?nter@23214 76 $fs/etc/nagvis/apache2-nagvis.conf
Hans-G?nter@23214 77 ln -s /etc/nagvis/apache2-nagvis.conf \
Hans-G?nter@23214 78 $fs/etc/apache/conf.d/nagvis.conf
erjo@8701 79 sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \
erjo@8701 80 -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \
erjo@8701 81 -e 's|#AuthName|AuthName|' \
erjo@8701 82 -e 's|#AuthType|AuthType|' \
erjo@8701 83 -e 's|#AuthUserFile|AuthUserFile|' \
erjo@8701 84 -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \
Hans-G?nter@23214 85 -e 's| #Require|Require|' \
Hans-G?nter@23214 86 $fs/etc/nagvis/apache2-nagvis.conf
erjo@8701 87
Hans-G?nter@21516 88 # Fix permissions
Hans-G?nter@23214 89 chown -R www.www $fs/usr/share/nagvis
Hans-G?nter@23214 90 chown -R www.www $fs/var/lib/nagvis
Hans-G?nter@23214 91 chown -R root.www $fs/etc/nagvis
erjo@8701 92
Hans-G?nter@23214 93 chmod 664 $fs/etc/nagvis/nagvis.ini.php
Hans-G?nter@23214 94 chmod 775 $fs/etc/nagvis/maps
Hans-G?nter@23214 95 chmod 664 $fs/etc/nagvis/maps/*
Hans-G?nter@23214 96 chmod 664 $fs/etc/nagvis/geomap/*
Hans-G?nter@23214 97 # chmod 664 $fs/etc/nagvis/automaps/*
Hans-G?nter@23214 98 chmod 775 $fs/var/lib/nagvis
erjo@8701 99
erjo@8701 100 # Cleanup
Hans-G?nter@23214 101 rm -f $fs/usr/share/nagvis/install.*
Hans-G?nter@23214 102 rm -f $fs/usr/share/nagvis/share/uifx
erjo@8701 103
Hans-G?nter@23214 104 mv $fs/usr/share/nagvis/share/userfiles/images/maps \
Hans-G?nter@23214 105 $fs/var/lib/nagvis
Hans-G?nter@23214 106 chmod 775 $fs/var/lib/nagvis/maps
Hans-G?nter@23214 107 chmod 664 $fs/var/lib/nagvis/maps/*
Hans-G?nter@23214 108 ln -s /var/lib/nagvis/maps \
Hans-G?nter@23214 109 $fs/usr/share/nagvis/share/userfiles/images/
erjo@8701 110 }
erjo@8701 111
erjo@8701 112 post_install()
erjo@8701 113 {
erjo@8701 114 cat <<EOT
erjo@8701 115 Now visit http://localhost/nagvis
erjo@8701 116 EOT
Hans-G?nter@23214 117 if [ -z "$1" ]
Hans-G?nter@23214 118 then
erjo@8701 119 /etc/init.d/nagios stop
erjo@8701 120 /etc/init.d/nagios start
erjo@8701 121 fi
erjo@8701 122 }