wok-next view monitorix/receipt @ rev 20674
Up putty (0.70)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat May 12 05:17:48 2018 +0300 (2018-05-12) |
parents | ded7bc956f55 |
children | a3c581bf52b8 |
line source
1 # SliTaz package receipt v2.
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/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}$TARBALL"
14 compile_rules() {
15 mkdir -p \
16 $install/usr/lib \
17 $install/usr/bin \
18 $install/etc/logrotate.d \
19 $install/usr/share/monitorix/cgi
20 cp -a $src/monitorix.conf $install/etc
21 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' $install/etc/monitorix.conf
22 sed -i 's|group = nobody|group = nogroup|' $install/etc/monitorix.conf
23 cp -a $src/docs/monitorix.logrotate $install/etc/logrotate.d/monitorix
24 cp -a $src/monitorix $install/usr/bin
25 cp -a $src/lib $install/usr/lib/monitorix
26 cp -a $src/monitorix.cgi $src/*.png $src/reports \
27 $install/usr/share/monitorix
28 }
30 genpkg_rules() {
31 copy @std
32 DEPENDS="rrdtool-perl perl-libwww-perl perl-dbi perl-xml-simple perl-cgi \
33 perl-mailtools perl-mime-lite perl-config-general perl-http-server-simple"
34 SUGGESTED="iptables logrotate"
35 }
37 post_install() {
38 # Configure lighttpd server
39 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
40 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf"; then
41 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"
42 if [ -z "$1" ]; then
43 # Start Web server.
44 /etc/init.d/lighttpd stop
45 /etc/init.d/lighttpd start
46 fi
47 fi
48 fi
49 # Configure apache server
50 if [ -f "$1/etc/apache/httpd.conf" ]; then
51 if [ ! -f "$1/etc/apache/conf.d/monitorix" ]; then
52 cat > "$1/etc/apache/conf.d/monitorix" <<EOT
53 Alias /monitorix /usr/share/monitorix
54 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
56 <Directory /usr/share/monitorix/cgi/>
57 DirectoryIndex monitorix.cgi
58 Options ExecCGI
59 Order Deny,Allow
60 Deny from all
61 Allow from 127.0.0.1
62 </Directory>
64 EOT
65 if [ -z "$1" ]; then
66 # Start Web server.
67 /etc/init.d/apache stop
68 /etc/init.d/apache start
69 fi
70 fi
71 fi
72 }