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