wok-6.x view monitorix/receipt @ rev 24699
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 13 19:47:29 2022 +0000 (2022-03-13) |
parents | 442b472ff67d |
children | e45212bb7544 |
line source
1 # SliTaz package receipt.
3 PACKAGE="monitorix"
4 VERSION="3.12.0"
5 CATEGORY="misc"
6 SHORT_DESC="A lightweight system monitoring tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.monitorix.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}$TARBALL"
14 SUGGESTED="iptables logrotate"
15 DEPENDS="perl-dbi perl-cgi perl-config-general perl-http-server-simple \
16 perl-libwww perl-mailtools perl-mime-lite perl-xml-simple rrdtool-perl"
17 BUILD_DEPENDS=""
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://github.com/mikaku/Monitorix/releases 2>/dev/null | \
23 sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
24 }
26 # Rules to gen a SliTaz package suitable for Tazpkg.
27 genpkg_rules()
28 {
29 mkdir -p $fs/usr/lib
30 mkdir -p $fs/usr/bin
31 mkdir -p $fs/etc/logrotate.d
32 mkdir -p $fs/usr/share/monitorix/cgi
34 cp -a $src/monitorix.conf $fs/etc
35 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' \
36 $fs/etc/monitorix.conf
37 sed -i 's|group = nobody|group = nogroup|' \
38 $fs/etc/monitorix.conf
39 cp -a $src/docs/monitorix.logrotate \
40 $fs/etc/logrotate.d/monitorix
41 cp -a $src/monitorix $fs/usr/bin
42 cp -a $src/lib $fs/usr/lib/monitorix
43 cp -a $src/monitorix.cgi $src/*.png \
44 $src/reports $fs/usr/share/monitorix
45 }
47 post_install()
48 {
49 # Configure lighttpd server
50 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
51 then
52 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf"
53 then
54 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"
55 if [ -z "$1" ]
56 then
57 # Start Web server.
58 /etc/init.d/lighttpd stop
59 /etc/init.d/lighttpd start
60 fi
61 fi
62 fi
64 # Configure apache server
65 if [ -f "$1/etc/apache/httpd.conf" ]
66 then
67 if [ ! -f "$1/etc/apache/conf.d/monitorix" ]
68 then
69 cat > "$1/etc/apache/conf.d/monitorix" <<EOT
70 Alias /monitorix /usr/share/monitorix
71 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
73 <Directory /usr/share/monitorix/cgi/>
74 DirectoryIndex monitorix.cgi
75 Options ExecCGI
76 Order Deny,Allow
77 Deny from all
78 Allow from 127.0.0.1
79 </Directory>
81 EOT
82 if [ -z "$1" ]
83 then
84 # Start Web server.
85 /etc/init.d/apache stop
86 /etc/init.d/apache start
87 fi
88 fi
89 fi
90 }