wok-next annotate monitorix/receipt @ rev 20481

Proper packing for v2
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Mar 12 02:18:53 2018 +0200 (2018-03-12)
parents ded7bc956f55
children a3c581bf52b8
rev   line source
al@20481 1 # SliTaz package receipt v2.
pascal@14699 2
pascal@14699 3 PACKAGE="monitorix"
pascal@14699 4 VERSION="3.2.1"
pascal@14699 5 CATEGORY="misc"
al@20481 6 SHORT_DESC="A lightweight system monitoring tool"
pascal@14699 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14699 8 LICENSE="GPL2"
pascal@14699 9 WEB_SITE="http://www.monitorix.org/"
al@20481 10
pascal@14699 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@14699 12 WGET_URL="${WEB_SITE}$TARBALL"
pascal@14699 13
al@20481 14 compile_rules() {
al@20481 15 mkdir -p \
al@20481 16 $install/usr/lib \
al@20481 17 $install/usr/bin \
al@20481 18 $install/etc/logrotate.d \
al@20481 19 $install/usr/share/monitorix/cgi
al@20481 20 cp -a $src/monitorix.conf $install/etc
al@20481 21 sed -i 's|/var/lib/monitorix|/usr/lib/monitorix|' $install/etc/monitorix.conf
al@20481 22 sed -i 's|group = nobody|group = nogroup|' $install/etc/monitorix.conf
al@20481 23 cp -a $src/docs/monitorix.logrotate $install/etc/logrotate.d/monitorix
al@20481 24 cp -a $src/monitorix $install/usr/bin
al@20481 25 cp -a $src/lib $install/usr/lib/monitorix
al@20481 26 cp -a $src/monitorix.cgi $src/*.png $src/reports \
al@20481 27 $install/usr/share/monitorix
pascal@14699 28 }
pascal@14699 29
al@20481 30 genpkg_rules() {
al@20481 31 copy @std
al@20481 32 DEPENDS="rrdtool-perl perl-libwww-perl perl-dbi perl-xml-simple perl-cgi \
al@20481 33 perl-mailtools perl-mime-lite perl-config-general perl-http-server-simple"
al@20481 34 SUGGESTED="iptables logrotate"
al@20481 35 }
al@20481 36
al@20481 37 post_install() {
pascal@14699 38 # Configure lighttpd server
pascal@18730 39 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
pascal@18730 40 if ! grep -q /usr/share/monitorix/ "$1/etc/lighttpd/lighttpd.conf"; then
al@20481 41 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"
pascal@14699 42 if [ -z "$1" ]; then
pascal@14699 43 # Start Web server.
pascal@14699 44 /etc/init.d/lighttpd stop
pascal@14699 45 /etc/init.d/lighttpd start
pascal@14699 46 fi
pascal@14699 47 fi
pascal@14699 48 fi
pascal@14699 49 # Configure apache server
pascal@18730 50 if [ -f "$1/etc/apache/httpd.conf" ]; then
pascal@18730 51 if [ ! -f "$1/etc/apache/conf.d/monitorix" ]; then
pascal@18730 52 cat > "$1/etc/apache/conf.d/monitorix" <<EOT
pascal@14699 53 Alias /monitorix /usr/share/monitorix
pascal@14699 54 ScriptAlias /monitorix-cgi /usr/share/monitorix/cgi
pascal@14699 55
pascal@14699 56 <Directory /usr/share/monitorix/cgi/>
pascal@14699 57 DirectoryIndex monitorix.cgi
pascal@14699 58 Options ExecCGI
pascal@14699 59 Order Deny,Allow
pascal@14699 60 Deny from all
pascal@14699 61 Allow from 127.0.0.1
pascal@14699 62 </Directory>
pascal@14699 63
pascal@14699 64 EOT
pascal@14699 65 if [ -z "$1" ]; then
pascal@14699 66 # Start Web server.
pascal@14699 67 /etc/init.d/apache stop
pascal@14699 68 /etc/init.d/apache start
pascal@14699 69 fi
pascal@14699 70 fi
pascal@14699 71 fi
pascal@14699 72 }