wok view monitorix/receipt @ rev 25794

created recipe for exo-lang
author Hans-G?nter Theisgen
date Wed Oct 23 16:19:52 2024 +0100 (4 weeks ago)
parents c5245e11296b
children
line source
1 # SliTaz package receipt.
3 PACKAGE="monitorix"
4 VERSION="3.15.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="https://github.com/mikaku/Monitorix/archive/refs/tags/v$VERSION.tar.gz"
14 SUGGESTED="iptables logrotate"
15 DEPENDS="perl-cgi perl-config-general perl-dbi 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 '/tag\//!d;s|.*tag/v*||;s|".*||;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 $fs/usr/share/monitorix
45 cp -a $src/*.png $fs/usr/share/monitorix
46 }
48 post_install()
49 {
50 # Configure lighttpd server
51 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
52 then
53 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf"
54 then
55 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"
56 if [ -z "$1" ]
57 then
58 # Start Web server.
59 /etc/init.d/lighttpd stop
60 /etc/init.d/lighttpd start
61 fi
62 fi
63 fi
65 # Configure apache server
66 if [ -f "$1/etc/apache/httpd.conf" ]
67 then
68 if [ ! -f "$1/etc/apache/conf.d/monitorix" ]
69 then
70 cat > "$1/etc/apache/conf.d/monitorix" <<EOT
71 Alias /monitorix /usr/share/monitorix
72 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
74 <Directory /usr/share/monitorix/cgi/>
75 DirectoryIndex monitorix.cgi
76 Options ExecCGI
77 Order Deny,Allow
78 Deny from all
79 Allow from 127.0.0.1
80 </Directory>
82 EOT
83 if [ -z "$1" ]
84 then
85 # Start Web server.
86 /etc/init.d/apache stop
87 /etc/init.d/apache start
88 fi
89 fi
90 fi
91 }