wok-next view nagvis/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents 5baa3b6a24e7
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="nagvis"
4 VERSION="1.5.7"
5 CATEGORY="network"
6 SHORT_DESC="Visualization addon for nagios"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.nagvis.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 SPLIT="$PACKAGE-flex $PACKAGE-doc $PACKAGE"
16 compile_rules() {
17 mkdir -p \
18 $install/usr/share/nagvis \
19 $install/etc/apache/conf.d \
20 $install/var/lib/nagvis/var/tmpl/cache \
21 $install/var/lib/nagvis/var/tmpl/compile \
22 $install/usr/share/doc/nagvis
24 cp -a $src/share $install/usr/share/nagvis
25 cp -a $src/etc $install/etc/nagvis
27 # copy demo maps.
28 #~ cp $install/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \
29 #~ $install/var/lib/nagvis/automap.png
31 # link var direcxtory (FHS)
32 ln -s /var/lib/nagvis/var $install/usr/share/nagvis/var
34 # move config files
35 ln -s /etc/nagvis $install/usr/share/nagvis/etc
37 # nagvis config
38 mv $install/etc/nagvis/nagvis.ini.php-sample \
39 $install/etc/nagvis/nagvis.ini.php
41 # Apache config
42 mv $install/etc/nagvis/apache2-nagvis.conf-sample \
43 $install/etc/nagvis/apache2-nagvis.conf
44 ln -s /etc/nagvis/apache2-nagvis.conf $install/etc/apache/conf.d/nagvis.conf
46 # Fix perms
47 chown -R www.www $install/usr/share/nagvis $install/var/lib/nagvis
48 chown -R root.www $install/etc/nagvis
50 chmod 664 $install/etc/nagvis/nagvis.ini.php
51 chmod 775 $install/etc/nagvis/maps
52 chmod 664 $install/etc/nagvis/maps/*
53 chmod 664 $install/etc/nagvis/geomap/*
54 chmod 664 $install/etc/nagvis/automaps/*
55 chmod 775 $install/var/lib/nagvis
58 mv $install/usr/share/nagvis/share/userfiles/images/maps \
59 $install/var/lib/nagvis
60 chmod 775 $install/var/lib/nagvis/maps
61 chmod 664 $install/var/lib/nagvis/maps/*
62 ln -s /var/lib/nagvis/maps $install/usr/share/nagvis/share/userfiles/images/
64 # Nagvis Flex
65 mkdir -p $install/usr/share/nagvis
66 cp -a $src/uifx $install/usr/share/nagvis
68 cook_pick_docs INSTALL LICENCE README ChangeLog
70 mkdir -p $install/usr/share/nagvis/
71 cp -a $src/docs $install/usr/share/nagvis/
72 }
74 genpkg_rules() {
75 case $PACKAGE in
76 nagvis-flex)
77 copy uifx/
78 CAT="network|Nagvis Flex"
79 DEPENDS="nagvis"
80 ;;
81 nagvis-doc)
82 copy docs/
83 CAT="network|documentation"
84 DEPENDS="nagvis"
85 ;;
86 nagvis)
87 copy @std @dev @rm
88 SUGGESTED="graphviz"
89 DEPENDS="nagios php-mysql php-gd ndoutils mk-livestatus"
91 # nagvis config
92 sed -i -e 's|;language=|language=|' \
93 -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \
94 -e 's|;base=.*|base="/usr/share/nagvis/"|' \
95 -e 's|;htmlbase=|htmlbase=|' \
96 -e 's|;htmlcgi=|htmlcgi=|' \
97 -e 's|;backendtype=|backendtype=|' \
98 -e 's|;dbhost=|dbhost=|' \
99 -e 's|;dbport=|dbport=|' \
100 -e 's|;dbname=|dbname=|' \
101 -e 's|;dbname=|dbname=|' \
102 -e 's|;dbuser=|dbuser=|' \
103 -e 's|;dbpass=""|dbpass=|' \
104 -e 's|;dbprefix=|dbprefix=|' \
105 -e 's|;dbinstancename=|dbinstancename=|' \
106 -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' \
107 -e 's/;showautomaps=1/showautomaps=0/' \
108 -e '/;logonmodule=/ {
109 a\logonmodule="LogonEnv"\
110 logonenvvar="REMOTE_USER"\
111 logonenvcreateuser="0"
112 }' \
113 $fs/etc/nagvis/nagvis.ini.php
115 # Apache config
116 sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \
117 -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \
118 -e 's|#AuthName|AuthName|' \
119 -e 's|#AuthType|AuthType|' \
120 -e 's|#AuthUserFile|AuthUserFile|' \
121 -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \
122 -e 's| #Require|Require|' $fs/etc/nagvis/apache2-nagvis.conf
124 # Cleanup
125 rm -f $fs/usr/share/nagvis/install.*
126 ;;
127 esac
128 }
130 post_install_nagvis() {
131 [ -n "$quiet" ] || cat <<EOT
133 .-----------------------------------.
134 | Now visit http://localhost/nagvis |
135 '-----------------------------------'
136 EOT
137 if [ -z "$1" ]; then
138 /etc/init.d/nagios stop
139 /etc/init.d/nagios start
140 fi
141 }