wok-current view monitorix/receipt @ rev 19870

linld: fix progname
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 30 15:54:03 2017 +0200 (2017-03-30)
parents 7518d9c7f507
children a78610b2eb47
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/cgi
29 cp -a $src/monitorix.conf $fs/etc
30 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' $fs/etc/monitorix.conf
31 sed -i 's|group = nobody|group = nogroup|' $fs/etc/monitorix.conf
32 cp -a $src/docs/monitorix.logrotate $fs/etc/logrotate.d/monitorix
33 cp -a $src/monitorix $fs/usr/bin
34 cp -a $src/lib $fs/usr/lib/monitorix
35 cp -a $src/monitorix.cgi $src/*.png $src/reports $fs/usr/share/monitorix
36 }
38 post_install()
39 {
40 # Configure lighttpd server
41 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
42 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf"; then
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"
44 if [ -z "$1" ]; then
45 # Start Web server.
46 /etc/init.d/lighttpd stop
47 /etc/init.d/lighttpd start
48 fi
49 fi
50 fi
51 # Configure apache server
52 if [ -f "$1/etc/apache/httpd.conf" ]; then
53 if [ ! -f "$1/etc/apache/conf.d/monitorix" ]; then
54 cat > "$1/etc/apache/conf.d/monitorix" <<EOT
55 Alias /monitorix /usr/share/monitorix
56 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
58 <Directory /usr/share/monitorix/cgi/>
59 DirectoryIndex monitorix.cgi
60 Options ExecCGI
61 Order Deny,Allow
62 Deny from all
63 Allow from 127.0.0.1
64 </Directory>
66 EOT
67 if [ -z "$1" ]; then
68 # Start Web server.
69 /etc/init.d/apache stop
70 /etc/init.d/apache start
71 fi
72 fi
73 fi
74 }