wok-next annotate nagios/receipt @ rev 20663
Fix web site for the Shimmer Project themes
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu May 10 22:58:32 2018 +0300 (2018-05-10) |
parents | b278b2018965 |
children | 68d93367f930 |
rev | line source |
---|---|
al@20463 | 1 # SliTaz package receipt v2. |
erjo@8330 | 2 |
erjo@8330 | 3 PACKAGE="nagios" |
erjo@14455 | 4 VERSION="3.5.0" |
erjo@8330 | 5 CATEGORY="network" |
erjo@8330 | 6 SHORT_DESC="Host and network monitoring" |
erjo@8330 | 7 MAINTAINER="erjo@slitaz.org" |
pascal@15584 | 8 LICENSE="GPL2" |
al@20463 | 9 WEB_SITE="http://www.nagios.org/" |
al@20463 | 10 |
erjo@8330 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
erjo@8330 | 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
erjo@8330 | 13 |
al@20454 | 14 BUILD_DEPENDS="libgd-dev libpng16-dev jpeg-dev libtool" |
al@20463 | 15 SPLIT="nagios-dev" |
pascal@15584 | 16 |
al@20463 | 17 compile_rules() { |
al@20481 | 18 sed -i '/sysconfdir=/ s|^|#|' /etc/slitaz/cook.site # default sysconfdir=/etc |
al@20481 | 19 |
erjo@8330 | 20 ./configure \ |
al@20534 | 21 --sysconfdir=/etc/nagios \ |
al@20534 | 22 --libexecdir=/usr/lib/nagios/plugins \ |
al@20534 | 23 --sbindir=/usr/lib/nagios/cgi \ |
al@20534 | 24 --datadir=/usr/share/nagios \ |
al@20534 | 25 --localstatedir=/var/lib/nagios \ |
erjo@8330 | 26 --with-nagios-user=nagios \ |
erjo@8330 | 27 --with-nagios-group=nagios \ |
erjo@8330 | 28 --with-lockfile=/var/run/nagios/nagios.pid \ |
erjo@8330 | 29 --with-checkresult-dir=/var/spool/nagios/checkresults \ |
erjo@8330 | 30 --with-httpd-conf=/etc/apache/conf.d \ |
al@20463 | 31 $CONFIGURE_ARGS && |
al@20463 | 32 sed -i 's!HTMLDIR=.*!HTMLDIR=/usr/share/nagios!' html/Makefile && |
al@20463 | 33 |
pascal@15584 | 34 #~ make all && make DESTDIR=$DESTDIR fullinstall \ |
pascal@15584 | 35 #~ && make DESTDIR=$DESTDIR install-config |
al@20463 | 36 make all && |
al@20463 | 37 make install && |
al@20463 | 38 make install-config && |
al@20463 | 39 make install-commandmode && |
al@20463 | 40 make install-webconf && |
al@20463 | 41 make install-classicui |
erjo@8330 | 42 } |
erjo@8330 | 43 |
al@20463 | 44 genpkg_rules() { |
al@20463 | 45 case $PACKAGE in |
al@20463 | 46 nagios) |
al@20481 | 47 mkdir -p \ |
al@20481 | 48 $fs/usr $fs/etc/init.d \ |
al@20463 | 49 $fs/var/lib/nagios/rw \ |
al@20463 | 50 $fs/var/log/nagios \ |
al@20463 | 51 $fs/var/spool/nagios/checkresults \ |
al@20463 | 52 $fs/etc/apache |
al@20463 | 53 |
al@20463 | 54 cp -a $install/etc/apache $fs/etc |
al@20463 | 55 cp -a $install/etc/nagios $fs/etc |
al@20463 | 56 cp -a $stuff/nagios $fs/etc/init.d |
al@20463 | 57 install -m644 $stuff/htpasswd.users $fs/etc/nagios/ |
al@20463 | 58 |
al@20463 | 59 cp -a $install/usr/bin $fs/usr |
al@20463 | 60 cp -a $install/usr/lib $fs/usr |
al@20463 | 61 cp -a $install/usr/share $fs/usr |
al@20463 | 62 |
al@20463 | 63 # Put doc in separate package |
al@20463 | 64 rm -rf $fs/usr/share/nagios/docs |
al@20463 | 65 |
al@20463 | 66 # Fix Apache config for Nagvis |
al@20463 | 67 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf |
al@20463 | 68 |
al@20463 | 69 # Fix permissions |
al@20463 | 70 chmod 755 $fs/usr/bin/nagios* |
al@20463 | 71 DEPENDS="apache nagios-plugins libpng16 libjpeg libltdl" |
al@20463 | 72 SUGGESTED="nagios-nrpe" |
al@20463 | 73 ;; |
al@20463 | 74 nagios-dev) |
al@20463 | 75 mkdir -p $fs/usr |
al@20463 | 76 cp -pa $src/include $fs/usr |
al@20463 | 77 ;; |
al@20463 | 78 esac |
erjo@8330 | 79 } |
erjo@8330 | 80 |
al@20463 | 81 post_install_nagios() { |
pascal@18730 | 82 if ! grep -q nagios "$1/etc/passwd"; then |
pascal@18730 | 83 chroot "$1/" addgroup -S nagios |
pascal@18730 | 84 chroot "$1/" adduser -S -D -H -G nagios nagios |
erjo@8330 | 85 fi |
al@20463 | 86 |
erjo@8330 | 87 # Fix perms for files and directories |
pascal@18730 | 88 chroot "$1/" chown -R nagios.nagios /var/log/nagios \ |
al@20463 | 89 /var/spool/nagios \ |
al@20463 | 90 /var/lib/nagios \ |
al@20463 | 91 /usr/share/nagios \ |
al@20463 | 92 /etc/nagios/* |
al@20463 | 93 |
pascal@18730 | 94 chmod 2775 "$1/var/lib/nagios/rw" |
pascal@18730 | 95 chroot "$1/" addgroup www nagios |
al@20463 | 96 |
erjo@8330 | 97 # Start Nagios daemon if we are on running system |
pascal@18730 | 98 [ "$1" ] || /etc/init.d/nagios start |
al@20463 | 99 |
al@20463 | 100 # post_install messages |
al@20463 | 101 [ -n "$quiet" ] || cat <<EOT |
al@20463 | 102 |
al@20463 | 103 .--------------------------------------------------------------. |
al@20463 | 104 | To starts nagios server you can run: | |
al@20534 | 105 | /etc/init.d/nagios start | |
al@20463 | 106 | | |
al@20463 | 107 | Or add nagios to RUN_DAEMONS in /etc/rcS.conf | |
al@20463 | 108 |--------------------------------------------------------------| |
al@20463 | 109 | Default login/password for the Web GUI is nagiosadmin/nagios | |
al@20463 | 110 '--------------------------------------------------------------' |
al@20463 | 111 EOT |
erjo@8330 | 112 } |
erjo@8330 | 113 |
al@20463 | 114 pre_remove_nagios() { |
pascal@18730 | 115 [ "$1" ] || /etc/init.d/nagios stop |
pascal@14466 | 116 } |