wok rev 8701

add: nagvis{-doc,-flex}
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Feb 17 23:11:32 2011 +0100 (2011-02-17)
parents f84080e3ed2f
children 3b3a18a0c294
files nagvis-doc/receipt nagvis-flex/receipt nagvis/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nagvis-doc/receipt	Thu Feb 17 23:11:32 2011 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="nagvis-doc"
     1.7 +VERSION="1.5.7"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Nagvis documentation and licence"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.12 +WEB_SITE="http://www.nagvis.org/"
    1.13 +DEPENDS="nagvis"
    1.14 +WANTED="nagvis"
    1.15 +
    1.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.17 +genpkg_rules()
    1.18 +{
    1.19 +	mkdir -p $fs/usr/share/doc/nagvis \
    1.20 +		$fs/usr/share/nagvis
    1.21 +	
    1.22 +	# Copy doc and licence
    1.23 +	cp -a  $src/INSTALL $fs/usr/share/doc/nagvis
    1.24 +	cp -a $src/LICENCE $fs/usr/share/doc/nagvis
    1.25 +	cp -a $src/README $fs/usr/share/doc/nagvis
    1.26 +	cp -a $src/ChangeLog $fs/usr/share/doc/nagvis
    1.27 +	cp -pa $src/docs $fs/usr/share/nagvis
    1.28 +}
    1.29 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/nagvis-flex/receipt	Thu Feb 17 23:11:32 2011 +0100
     2.3 @@ -0,0 +1,21 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="nagvis-flex"
     2.7 +VERSION="1.5.7"
     2.8 +CATEGORY="network"
     2.9 +SHORT_DESC="Nagvis Flex"
    2.10 +MAINTAINER="erjo@slitaz.org"
    2.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.12 +WEB_SITE="http://www.nagvis.org/"
    2.13 +DEPENDS="nagvis"
    2.14 +WANTED="nagvis"
    2.15 +
    2.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.17 +genpkg_rules()
    2.18 +{
    2.19 +	mkdir -p $fs/usr/share/nagvis
    2.20 +	
    2.21 +	# Copy doc and licence
    2.22 +	cp -a $src/uifx $fs/usr/share/nagvis
    2.23 +}
    2.24 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/nagvis/receipt	Thu Feb 17 23:11:32 2011 +0100
     3.3 @@ -0,0 +1,110 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="nagvis"
     3.7 +VERSION="1.5.7"
     3.8 +CATEGORY="network"
     3.9 +SHORT_DESC="Visualization addon for nagios."
    3.10 +MAINTAINER="erjo@slitaz.org"
    3.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    3.12 +WEB_SITE="http://www.nagvis.org/"
    3.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    3.14 +DEPENDS="nagios php-mysql php-gd ndoutils mk-livestatus"
    3.15 +SUGGESTED="graphviz"
    3.16 +
    3.17 +# Rules to configure and make the package.
    3.18 +compile_rules()
    3.19 +{
    3.20 +	cd $src
    3.21 +}
    3.22 +
    3.23 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.24 +genpkg_rules()
    3.25 +{
    3.26 +	mkdir -p $fs/usr/share/nagvis \
    3.27 +		$fs/etc/apache/conf.d \
    3.28 +		$fs/var/lib/nagvis/var/tmpl/cache \
    3.29 +		$fs/var/lib/nagvis/var/tmpl/compile \
    3.30 +		$fs/usr/share/doc/nagvis
    3.31 +	
    3.32 +	cp -a $src/share $fs/usr/share/nagvis
    3.33 +	cp -a $src/etc $fs/etc/nagvis
    3.34 +	
    3.35 +	# copy demo maps.
    3.36 +	#~ cp $fs/usr/share/nagios/nagvis/nagvis/images/maps/nagvis-demo.png \
    3.37 +		#~ $fs/var/lib/nagvis/automap.png
    3.38 +	
    3.39 +	# link  var direcxtory (FHS)	
    3.40 +	ln -s /var/lib/nagvis/var  $fs/usr/share/nagvis/var
    3.41 +	
    3.42 +	# move config files
    3.43 +	ln -s /etc/nagvis $fs/usr/share/nagvis/etc
    3.44 +	
    3.45 +	# nagvis config
    3.46 +	mv $fs/etc/nagvis/nagvis.ini.php-sample $fs/etc/nagvis/nagvis.ini.php
    3.47 +	sed -i  -e 's|;language=|language=|' \
    3.48 +		-e 's|;dateformat="Y-m-d H:i:s"|dateformat="d-m-Y H:i:s"|' \
    3.49 +		-e 's|;base=.*|base="/usr/share/nagvis/"|' \
    3.50 +		-e 's|;htmlbase=|htmlbase=|' \
    3.51 +		-e 's|;htmlcgi=|htmlcgi=|' \
    3.52 +		-e 's|;backendtype=|backendtype=|' \
    3.53 +		-e 's|;dbhost=|dbhost=|' \
    3.54 +		-e 's|;dbport=|dbport=|' \
    3.55 +		-e 's|;dbname=|dbname=|' \
    3.56 +		-e 's|;dbname=|dbname=|' \
    3.57 +		-e 's|;dbuser=|dbuser=|' \
    3.58 +		-e 's|;dbpass=""|dbpass=|' \
    3.59 +		-e 's|;dbprefix=|dbprefix=|' \
    3.60 +		-e 's|;dbinstancename=|dbinstancename=|' \
    3.61 +		$fs/etc/nagvis/nagvis.ini.php
    3.62 +	
    3.63 +	sed -i -e '/;logonmodule=/ {
    3.64 +		a\logonmodule="LogonEnv"\
    3.65 +logonenvvar="REMOTE_USER"\
    3.66 +logonenvcreateuser="0"
    3.67 +	}' $fs/etc/nagvis/nagvis.ini.php
    3.68 +	sed -i -e '/;socket/ a\socket="unix:/var/lib/nagios/rw/live"' $fs/etc/nagvis/nagvis.ini.php
    3.69 +	sed -i -e 's/;showautomaps=1/showautomaps=0/"' $fs/etc/nagvis/nagvis.ini.php
    3.70 +	
    3.71 +	# Apache config
    3.72 +	mv $fs/etc/nagvis/apache2-nagvis.conf-sample $fs/etc/nagvis/apache2-nagvis.conf
    3.73 +	ln -s /etc/nagvis/apache2-nagvis.conf $fs/etc/apache/conf.d/nagvis.conf
    3.74 +	sed -i -e 's|@NAGVIS_WEB@|/nagvis|' \
    3.75 +		-e 's|@NAGVIS_PATH@|/usr/share/nagvis|' \
    3.76 +		-e 's|#AuthName|AuthName|' \
    3.77 +		-e 's|#AuthType|AuthType|' \
    3.78 +		-e 's|#AuthUserFile|AuthUserFile|' \
    3.79 +		-e 's|@NAGIOS_PATH@.*|/etc/nagios/htpasswd.users|' \
    3.80 +		-e 's| #Require|Require|' $fs/etc/nagvis/apache2-nagvis.conf
    3.81 +	
    3.82 +	# Fix perms
    3.83 +	chown -R www.www $fs/usr/share/nagvis $fs/var/lib/nagvis
    3.84 +	chown -R root.www $fs/etc/nagvis
    3.85 +	
    3.86 +	chmod 664 $fs/etc/nagvis/nagvis.ini.php  
    3.87 +	chmod 775 $fs/etc/nagvis/maps
    3.88 +	chmod 664 $fs/etc/nagvis/maps/*
    3.89 +	chmod 664 $fs/etc/nagvis/geomap/*
    3.90 +	chmod 664 $fs/etc/nagvis/automaps/*
    3.91 +	chmod 775 $fs/var/lib/nagvis
    3.92 +
    3.93 +	# Cleanup
    3.94 +	rm -f $fs/usr/share/nagvis/install.*
    3.95 +	rm -f $fs/usr/share/nagvis/share/uifx
    3.96 +	
    3.97 +	mv $fs/usr/share/nagvis/share/userfiles/images/maps $fs/var/lib/nagvis
    3.98 +	chmod 775 $fs/var/lib/nagvis/maps
    3.99 +	chmod 664 $fs/var/lib/nagvis/maps/*
   3.100 +	ln -s /var/lib/nagvis/maps $fs/usr/share/nagvis/share/userfiles/images/
   3.101 +
   3.102 +}
   3.103 +
   3.104 +post_install()
   3.105 +{
   3.106 +	cat <<EOT
   3.107 +Now visit http://localhost/nagvis
   3.108 +EOT
   3.109 +	if [ -z "$1" ]; then
   3.110 +		/etc/init.d/nagios stop
   3.111 +		/etc/init.d/nagios start
   3.112 +	fi
   3.113 +}