wok-next diff nagvis/receipt @ rev 8790
Fix bdeps: gnustep packages needs gnustep-make to compile
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Feb 22 23:07:21 2011 +0100 (2011-02-22) |
parents | |
children | bb34bab08c6e |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nagvis/receipt Tue Feb 22 23:07:21 2011 +0100 1.3 @@ -0,0 +1,110 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="nagvis" 1.7 +VERSION="1.5.7" 1.8 +CATEGORY="network" 1.9 +SHORT_DESC="Visualization addon for nagios." 1.10 +MAINTAINER="erjo@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.nagvis.org/" 1.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" 1.14 +DEPENDS="nagios php-mysql php-gd ndoutils mk-livestatus" 1.15 +SUGGESTED="graphviz" 1.16 + 1.17 +# Rules to configure and make the package. 1.18 +compile_rules() 1.19 +{ 1.20 + cd $src 1.21 +} 1.22 + 1.23 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.24 +genpkg_rules() 1.25 +{ 1.26 + mkdir -p $fs/usr/share/nagvis \ 1.27 + $fs/etc/apache/conf.d \ 1.28 + $fs/var/lib/nagvis/var/tmpl/cache \ 1.29 + $fs/var/lib/nagvis/var/tmpl/compile \ 1.30 + $fs/usr/share/doc/nagvis 1.31 + 1.32 + cp -a $src/share $fs/usr/share/nagvis 1.33 + cp -a $src/etc $fs/etc/nagvis 1.34 + 1.35 + # copy demo maps. 1.36 + #~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \ 1.37 + #~ $fs/var/lib/nagvis/automap.png 1.38 + 1.39 + # link var direcxtory (FHS) 1.40 + ln -s /var/lib/nagvis/var $fs/usr/share/nagvis/var 1.41 + 1.42 + # move config files 1.43 + ln -s /etc/nagvis $fs/usr/share/nagvis/etc 1.44 + 1.45 + # nagvis config 1.46 + mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php 1.47 + sed -i -e 's|;language=|language=|' \ 1.48 + -e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \ 1.49 + -e 's|;base=.*|base="/usr/share/nagvis/"|' \ 1.50 + -e 's|;htmlbase=|htmlbase=|' \ 1.51 + -e 's|;htmlcgi=|htmlcgi=|' \ 1.52 + -e 's|;backendtype=|backendtype=|' \ 1.53 + -e 's|;dbhost=|dbhost=|' \ 1.54 + -e 's|;dbport=|dbport=|' \ 1.55 + -e 's|;dbname=|dbname=|' \ 1.56 + -e 's|;dbname=|dbname=|' \ 1.57 + -e 's|;dbuser=|dbuser=|' \ 1.58 + -e 's|;dbpass=""|dbpass=|' \ 1.59 + -e 's|;dbprefix=|dbprefix=|' \ 1.60 + -e 's|;dbinstancename=|dbinstancename=|' \ 1.61 + $fs/etc/nagvis/nagvis.ini.php 1.62 + 1.63 + sed -i -e '/;logonmodule=/ { 1.64 + a\logonmodule="LogonEnv"\ 1.65 +logonenvvar="REMOTE_USER"\ 1.66 +logonenvcreateuser="0" 1.67 + }' $fs/etc/nagvis/nagvis.ini.php 1.68 + sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' $fs/etc/nagvis/nagvis.ini.php 1.69 + sed -i -e 's/;showautomaps=1/showautomaps=0/"' $fs/etc/nagvis/nagvis.ini.php 1.70 + 1.71 + # Apache config 1.72 + mv $fs/etc/nagvis/apache2-nagvis.conf-sample $fs/etc/nagvis/apache2-nagvis.conf 1.73 + ln -s /etc/nagvis/apache2-nagvis.conf $fs/etc/apache/conf.d/nagvis.conf 1.74 + sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \ 1.75 + -e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \ 1.76 + -e 's|#AuthName|AuthName|' \ 1.77 + -e 's|#AuthType|AuthType|' \ 1.78 + -e 's|#AuthUserFile|AuthUserFile|' \ 1.79 + -e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \ 1.80 + -e 's| #Require|Require|' $fs/etc/nagvis/apache2-nagvis.conf 1.81 + 1.82 + # Fix perms 1.83 + chown -R www.www $fs/usr/share/nagvis $fs/var/lib/nagvis 1.84 + chown -R root.www $fs/etc/nagvis 1.85 + 1.86 + chmod 664 $fs/etc/nagvis/nagvis.ini.php 1.87 + chmod 775 $fs/etc/nagvis/maps 1.88 + chmod 664 $fs/etc/nagvis/maps/* 1.89 + chmod 664 $fs/etc/nagvis/geomap/* 1.90 + chmod 664 $fs/etc/nagvis/automaps/* 1.91 + chmod 775 $fs/var/lib/nagvis 1.92 + 1.93 + # Cleanup 1.94 + rm -f $fs/usr/share/nagvis/install.* 1.95 + rm -f $fs/usr/share/nagvis/share/uifx 1.96 + 1.97 + mv $fs/usr/share/nagvis/share/userfiles/images/maps $fs/var/lib/nagvis 1.98 + chmod 775 $fs/var/lib/nagvis/maps 1.99 + chmod 664 $fs/var/lib/nagvis/maps/* 1.100 + ln -s /var/lib/nagvis/maps $fs/usr/share/nagvis/share/userfiles/images/ 1.101 + 1.102 +} 1.103 + 1.104 +post_install() 1.105 +{ 1.106 + cat <<EOT 1.107 +Now visit http://localhost/nagvis 1.108 +EOT 1.109 + if [ -z "$1" ]; then 1.110 + /etc/init.d/nagios stop 1.111 + /etc/init.d/nagios start 1.112 + fi 1.113 +}