# SliTaz package receipt. PACKAGE="monitorix" VERSION="3.15.0" CATEGORY="misc" SHORT_DESC="A lightweight system monitoring tool." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" WEB_SITE="https://www.monitorix.org/" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="https://github.com/mikaku/Monitorix/archive/refs/tags/v$VERSION.tar.gz" SUGGESTED="iptables logrotate" DEPENDS="perl-cgi perl-config-general perl-dbi perl-http-server-simple perl-libwww perl-mailtools perl-mime-lite perl-xml-simple rrdtool-perl" BUILD_DEPENDS="" # What is the latest version available today? current_version() { wget -O - https://github.com/mikaku/Monitorix/releases 2>/dev/null | \ sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/lib mkdir -p $fs/usr/bin mkdir -p $fs/etc/logrotate.d mkdir -p $fs/usr/share/monitorix/cgi cp -a $src/monitorix.conf $fs/etc sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' \ $fs/etc/monitorix.conf sed -i 's|group = nobody|group = nogroup|' \ $fs/etc/monitorix.conf cp -a $src/docs/monitorix.logrotate \ $fs/etc/logrotate.d/monitorix cp -a $src/monitorix $fs/usr/bin cp -a $src/lib $fs/usr/lib/monitorix cp -a $src/monitorix.cgi $src/*.png \ $fs/usr/share/monitorix cp -a $src/*.png $fs/usr/share/monitorix } post_install() { # Configure lighttpd server if [ -f "$1/etc/lighttpd/lighttpd.conf" ] then if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf" then 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" if [ -z "$1" ] then # Start Web server. /etc/init.d/lighttpd stop /etc/init.d/lighttpd start fi fi fi # Configure apache server if [ -f "$1/etc/apache/httpd.conf" ] then if [ ! -f "$1/etc/apache/conf.d/monitorix" ] then cat > "$1/etc/apache/conf.d/monitorix" < DirectoryIndex monitorix.cgi Options ExecCGI Order Deny,Allow Deny from all Allow from 127.0.0.1 EOT if [ -z "$1" ] then # Start Web server. /etc/init.d/apache stop /etc/init.d/apache start fi fi fi }