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