wok-next view nagvis/receipt @ rev 19741

Many random packages update/upgrade.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jun 05 16:48:55 2017 +0300 (2017-06-05)
parents bb34bab08c6e
children fe76d2fe539b
line source
1 # SliTaz package receipt.
3 PACKAGE="nagvis"
4 VERSION="1.5.7"
5 CATEGORY="network"
6 SHORT_DESC="Visualization addon for nagios."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.nagvis.org/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 SUGGESTED="graphviz"
14 DEPENDS="nagios php-mysql php-gd ndoutils mk-livestatus"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 }
22 # Rules to gen a SliTaz package suitable for Tazpkg.
23 genpkg_rules()
24 {
25 mkdir -p $fs/usr/share/nagvis \
26 $fs/etc/apache/conf.d \
27 $fs/var/lib/nagvis/var/tmpl/cache \
28 $fs/var/lib/nagvis/var/tmpl/compile \
29 $fs/usr/share/doc/nagvis
31 cp -a $src/share $fs/usr/share/nagvis
32 cp -a $src/etc $fs/etc/nagvis
34 # copy demo maps.
35 #~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \
36 #~ $fs/var/lib/nagvis/automap.png
38 # link var direcxtory (FHS)
39 ln -s /var/lib/nagvis/var $fs/usr/share/nagvis/var
41 # move config files
42 ln -s /etc/nagvis $fs/usr/share/nagvis/etc
44 # nagvis config
45 mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php
46 sed -i -e 's|;language=|language=|' \
47 -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \
48 -e 's|;base=.*|base="/usr/share/nagvis/"|' \
49 -e 's|;htmlbase=|htmlbase=|' \
50 -e 's|;htmlcgi=|htmlcgi=|' \
51 -e 's|;backendtype=|backendtype=|' \
52 -e 's|;dbhost=|dbhost=|' \
53 -e 's|;dbport=|dbport=|' \
54 -e 's|;dbname=|dbname=|' \
55 -e 's|;dbname=|dbname=|' \
56 -e 's|;dbuser=|dbuser=|' \
57 -e 's|;dbpass=""|dbpass=|' \
58 -e 's|;dbprefix=|dbprefix=|' \
59 -e 's|;dbinstancename=|dbinstancename=|' \
60 $fs/etc/nagvis/nagvis.ini.php
62 sed -i -e '/;logonmodule=/ {
63 a\logonmodule="LogonEnv"\
64 logonenvvar="REMOTE_USER"\
65 logonenvcreateuser="0"
66 }' $fs/etc/nagvis/nagvis.ini.php
67 sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' $fs/etc/nagvis/nagvis.ini.php
68 sed -i -e 's/;showautomaps=1/showautomaps=0/' $fs/etc/nagvis/nagvis.ini.php
70 # Apache config
71 mv $fs/etc/nagvis/apache2-nagvis.conf-sample $fs/etc/nagvis/apache2-nagvis.conf
72 ln -s /etc/nagvis/apache2-nagvis.conf $fs/etc/apache/conf.d/nagvis.conf
73 sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \
74 -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \
75 -e 's|#AuthName|AuthName|' \
76 -e 's|#AuthType|AuthType|' \
77 -e 's|#AuthUserFile|AuthUserFile|' \
78 -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \
79 -e 's| #Require|Require|' $fs/etc/nagvis/apache2-nagvis.conf
81 # Fix perms
82 chown -R www.www $fs/usr/share/nagvis $fs/var/lib/nagvis
83 chown -R root.www $fs/etc/nagvis
85 chmod 664 $fs/etc/nagvis/nagvis.ini.php
86 chmod 775 $fs/etc/nagvis/maps
87 chmod 664 $fs/etc/nagvis/maps/*
88 chmod 664 $fs/etc/nagvis/geomap/*
89 chmod 664 $fs/etc/nagvis/automaps/*
90 chmod 775 $fs/var/lib/nagvis
92 # Cleanup
93 rm -f $fs/usr/share/nagvis/install.*
94 rm -f $fs/usr/share/nagvis/share/uifx
96 mv $fs/usr/share/nagvis/share/userfiles/images/maps $fs/var/lib/nagvis
97 chmod 775 $fs/var/lib/nagvis/maps
98 chmod 664 $fs/var/lib/nagvis/maps/*
99 ln -s /var/lib/nagvis/maps $fs/usr/share/nagvis/share/userfiles/images/
101 }
103 post_install()
104 {
105 cat <<EOT
106 Now visit http://localhost/nagvis
107 EOT
108 if [ -z "$1" ]; then
109 /etc/init.d/nagios stop
110 /etc/init.d/nagios start
111 fi
112 }