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