wok annotate monitorix/receipt @ rev 18007

busybox, slitaz-base-files: update copyright year (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 28 20:32:14 2015 +0200 (2015-04-28)
parents c13b8edc9b7d
children 9e01bc6321ea
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@14700 28 mkdir -p $fs/usr/share/monitorix/cgi
pascal@14699 29 cp -a $src/monitorix.conf $fs/etc
pascal@14700 30 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' $fs/etc/monitorix.conf
pascal@14701 31 sed -i 's|group = nobody|group = nogroup|' $fs/etc/monitorix.conf
pascal@14699 32 cp -a $src/docs/monitorix.logrotate $fs/etc/logrotate.d/monitorix
pascal@14699 33 cp -a $src/monitorix $fs/usr/bin
pascal@14699 34 cp -a $src/lib $fs/usr/lib/monitorix
pascal@14699 35 cp -a $src/monitorix.cgi $src/*.png $src/reports $fs/usr/share/monitorix
pascal@14699 36 }
pascal@14699 37
pascal@14699 38 post_install()
pascal@14699 39 {
pascal@14699 40 # Configure lighttpd server
pascal@14699 41 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@14699 42 if ! grep -q /usr/share/monitorix/ $1/etc/lighttpd/lighttpd.conf; then
pascal@14699 43 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 44 if [ -z "$1" ]; then
pascal@14699 45 # Start Web server.
pascal@14699 46 /etc/init.d/lighttpd stop
pascal@14699 47 /etc/init.d/lighttpd start
pascal@14699 48 fi
pascal@14699 49 fi
pascal@14699 50 fi
pascal@14699 51 # Configure apache server
pascal@14699 52 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@14699 53 if [ ! -f $1/etc/apache/conf.d/monitorix ]; then
pascal@14699 54 cat > $1/etc/apache/conf.d/monitorix <<EOT
pascal@14699 55 Alias /monitorix /usr/share/monitorix
pascal@14699 56 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
pascal@14699 57
pascal@14699 58 <Directory /usr/share/monitorix/cgi/>
pascal@14699 59 DirectoryIndex monitorix.cgi
pascal@14699 60 Options ExecCGI
pascal@14699 61 Order Deny,Allow
pascal@14699 62 Deny from all
pascal@14699 63 Allow from 127.0.0.1
pascal@14699 64 </Directory>
pascal@14699 65
pascal@14699 66 EOT
pascal@14699 67 if [ -z "$1" ]; then
pascal@14699 68 # Start Web server.
pascal@14699 69 /etc/init.d/apache stop
pascal@14699 70 /etc/init.d/apache start
pascal@14699 71 fi
pascal@14699 72 fi
pascal@14699 73 fi
pascal@14699 74 }