wok annotate monitorix/receipt @ rev 24915

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