wok-current annotate monitorix/receipt @ rev 23186
updated monitorix (3.11.0 -> 3.12.0)
author | Hans-G?nter Theisgen |
---|---|
date | Fri Mar 20 07:07:35 2020 +0100 (2020-03-20) |
parents | 44ed5441e630 |
children | ad8b9ff412d2 |
rev | line source |
---|---|
pascal@14699 | 1 # SliTaz package receipt. |
pascal@14699 | 2 |
pascal@14699 | 3 PACKAGE="monitorix" |
Hans-G?nter@23186 | 4 VERSION="3.12.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@23186 | 15 DEPENDS="perl-dbi perl-cgi perl-config-general 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@14699 | 19 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@14699 | 20 genpkg_rules() |
pascal@14699 | 21 { |
Hans-G?nter@21468 | 22 mkdir -p $fs/usr/lib |
Hans-G?nter@21468 | 23 mkdir -p $fs/usr/bin |
Hans-G?nter@21468 | 24 mkdir -p $fs/etc/logrotate.d |
pascal@14700 | 25 mkdir -p $fs/usr/share/monitorix/cgi |
Hans-G?nter@21468 | 26 |
Hans-G?nter@21468 | 27 cp -a $src/monitorix.conf $fs/etc |
Hans-G?nter@23186 | 28 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' \ |
Hans-G?nter@23186 | 29 $fs/etc/monitorix.conf |
Hans-G?nter@23186 | 30 sed -i 's|group = nobody|group = nogroup|' \ |
Hans-G?nter@23186 | 31 $fs/etc/monitorix.conf |
Hans-G?nter@23186 | 32 cp -a $src/docs/monitorix.logrotate \ |
Hans-G?nter@23186 | 33 $fs/etc/logrotate.d/monitorix |
Hans-G?nter@21468 | 34 cp -a $src/monitorix $fs/usr/bin |
Hans-G?nter@21468 | 35 cp -a $src/lib $fs/usr/lib/monitorix |
Hans-G?nter@21468 | 36 cp -a $src/monitorix.cgi $src/*.png \ |
Hans-G?nter@23186 | 37 $src/reports $fs/usr/share/monitorix |
pascal@14699 | 38 } |
pascal@14699 | 39 |
pascal@14699 | 40 post_install() |
pascal@14699 | 41 { |
pascal@14699 | 42 # Configure lighttpd server |
Hans-G?nter@23186 | 43 if [ -f "$1/etc/lighttpd/lighttpd.conf" ] |
Hans-G?nter@23186 | 44 then |
Hans-G?nter@23186 | 45 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf" |
Hans-G?nter@23186 | 46 then |
pascal@18730 | 47 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 | 48 if [ -z "$1" ] |
Hans-G?nter@23186 | 49 then |
pascal@14699 | 50 # Start Web server. |
pascal@14699 | 51 /etc/init.d/lighttpd stop |
pascal@14699 | 52 /etc/init.d/lighttpd start |
pascal@14699 | 53 fi |
pascal@14699 | 54 fi |
pascal@14699 | 55 fi |
Hans-G?nter@23186 | 56 |
pascal@14699 | 57 # Configure apache server |
Hans-G?nter@23186 | 58 if [ -f "$1/etc/apache/httpd.conf" ] |
Hans-G?nter@23186 | 59 then |
Hans-G?nter@23186 | 60 if [ ! -f "$1/etc/apache/conf.d/monitorix" ] |
Hans-G?nter@23186 | 61 then |
pascal@18730 | 62 cat > "$1/etc/apache/conf.d/monitorix" <<EOT |
pascal@14699 | 63 Alias /monitorix /usr/share/monitorix |
pascal@14699 | 64 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi |
pascal@14699 | 65 |
pascal@14699 | 66 <Directory /usr/share/monitorix/cgi/> |
pascal@14699 | 67 DirectoryIndex monitorix.cgi |
pascal@14699 | 68 Options ExecCGI |
pascal@14699 | 69 Order Deny,Allow |
pascal@14699 | 70 Deny from all |
pascal@14699 | 71 Allow from 127.0.0.1 |
pascal@14699 | 72 </Directory> |
pascal@14699 | 73 |
pascal@14699 | 74 EOT |
Hans-G?nter@23186 | 75 if [ -z "$1" ] |
Hans-G?nter@23186 | 76 then |
pascal@14699 | 77 # Start Web server. |
pascal@14699 | 78 /etc/init.d/apache stop |
pascal@14699 | 79 /etc/init.d/apache start |
pascal@14699 | 80 fi |
pascal@14699 | 81 fi |
pascal@14699 | 82 fi |
pascal@14699 | 83 } |