wok annotate monitorix/receipt @ rev 14699

Add monitorix
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 07 16:22:55 2013 +0200 (2013-06-07)
parents
children c13b8edc9b7d
rev   line source
pascal@14699 1 # SliTaz package receipt.
pascal@14699 2
pascal@14699 3 PACKAGE="monitorix"
pascal@14699 4 VERSION="3.2.1"
pascal@14699 5 CATEGORY="misc"
pascal@14699 6 SHORT_DESC="A lightweight system monitoring tool."
pascal@14699 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14699 8 LICENSE="GPL2"
pascal@14699 9 WEB_SITE="http://www.monitorix.org/"
pascal@14699 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@14699 11 WGET_URL="${WEB_SITE}$TARBALL"
pascal@14699 12 SUGGESTED="iptables logrotate"
pascal@14699 13
pascal@14699 14 DEPENDS="rrdtool-perl perl-libwww perl-dbi perl-xml-simple perl-cgi \
pascal@14699 15 perl-mailtools perl-mime-lite perl-config-general perl-http-server-simple"
pascal@14699 16 BUILD_DEPENDS=""
pascal@14699 17
pascal@14699 18 # Rules to configure and make the package.
pascal@14699 19 compile_rules()
pascal@14699 20 {
pascal@14699 21 cd $src
pascal@14699 22 }
pascal@14699 23
pascal@14699 24 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@14699 25 genpkg_rules()
pascal@14699 26 {
pascal@14699 27 mkdir -p $fs/usr/lib $fs/usr/bin $fs/etc/logrotate.d
pascal@14699 28 mkdir -p $fs/usr/share/monitorix
pascal@14699 29 cp -a $src/monitorix.conf $fs/etc
pascal@14699 30 sed 's|/var/lib|/usr/lib|' $fs/etc/monitorix.conf
pascal@14699 31 cp -a $src/docs/monitorix.logrotate $fs/etc/logrotate.d/monitorix
pascal@14699 32 cp -a $src/monitorix $fs/usr/bin
pascal@14699 33 cp -a $src/lib $fs/usr/lib/monitorix
pascal@14699 34 cp -a $src/monitorix.cgi $src/*.png $src/reports $fs/usr/share/monitorix
pascal@14699 35 }
pascal@14699 36
pascal@14699 37 post_install()
pascal@14699 38 {
pascal@14699 39 # Configure lighttpd server
pascal@14699 40 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@14699 41 if ! grep -q /usr/share/monitorix/ $1/etc/lighttpd/lighttpd.conf; then
pascal@14699 42 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/monitorix/" => "/usr/share/monitorix/",\n "/monitorix-cgi/" => "/usr/share/monitorix/cgi/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@14699 43 if [ -z "$1" ]; then
pascal@14699 44 # Start Web server.
pascal@14699 45 /etc/init.d/lighttpd stop
pascal@14699 46 /etc/init.d/lighttpd start
pascal@14699 47 fi
pascal@14699 48 fi
pascal@14699 49 fi
pascal@14699 50 # Configure apache server
pascal@14699 51 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@14699 52 if [ ! -f $1/etc/apache/conf.d/monitorix ]; then
pascal@14699 53 cat > $1/etc/apache/conf.d/monitorix <<EOT
pascal@14699 54 Alias /monitorix /usr/share/monitorix
pascal@14699 55 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
pascal@14699 56
pascal@14699 57 <Directory /usr/share/monitorix/cgi/>
pascal@14699 58 DirectoryIndex monitorix.cgi
pascal@14699 59 Options ExecCGI
pascal@14699 60 Order Deny,Allow
pascal@14699 61 Deny from all
pascal@14699 62 Allow from 127.0.0.1
pascal@14699 63 </Directory>
pascal@14699 64
pascal@14699 65 EOT
pascal@14699 66 if [ -z "$1" ]; then
pascal@14699 67 # Start Web server.
pascal@14699 68 /etc/init.d/apache stop
pascal@14699 69 /etc/init.d/apache start
pascal@14699 70 fi
pascal@14699 71 fi
pascal@14699 72 fi
pascal@14699 73 }