wok-next annotate nagios/receipt @ rev 20463

Combine receipts
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Mar 06 11:29:35 2018 +0200 (2018-03-06)
parents dd145c435e4b
children b278b2018965
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() {
erjo@8330 18 ./configure \
erjo@8330 19 --prefix=/usr \
erjo@8330 20 --infodir=/usr/share/info \
erjo@8330 21 --mandir=/usr/share/man \
erjo@8330 22 --with-nagios-user=nagios \
erjo@8330 23 --with-nagios-group=nagios \
erjo@8330 24 --with-lockfile=/var/run/nagios/nagios.pid \
erjo@8330 25 --with-checkresult-dir=/var/spool/nagios/checkresults \
erjo@8330 26 --sysconfdir=/etc/nagios \
erjo@8330 27 --with-httpd-conf=/etc/apache/conf.d \
erjo@8330 28 --libexecdir=/usr/lib/nagios/plugins \
erjo@8330 29 --sbindir=/usr/lib/nagios/cgi \
erjo@8330 30 --datadir=/usr/share/nagios \
erjo@8700 31 --localstatedir=/var/lib/nagios \
al@20463 32 $CONFIGURE_ARGS &&
al@20463 33 sed -i 's!HTMLDIR=.*!HTMLDIR=/usr/share/nagios!' html/Makefile &&
al@20463 34
pascal@15584 35 #~ make all && make DESTDIR=$DESTDIR fullinstall \
pascal@15584 36 #~ && make DESTDIR=$DESTDIR install-config
al@20463 37 make all &&
al@20463 38 make install &&
al@20463 39 make install-config &&
al@20463 40 make install-commandmode &&
al@20463 41 make install-webconf &&
al@20463 42 make install-classicui
erjo@8330 43 }
erjo@8330 44
al@20463 45 genpkg_rules() {
al@20463 46 case $PACKAGE in
al@20463 47 nagios)
al@20463 48 mkdir -p $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
erjo@8330 83 echo -n "Adding user/group nagios..."
pascal@18730 84 chroot "$1/" addgroup -S nagios
pascal@18730 85 chroot "$1/" adduser -S -D -H -G nagios nagios
erjo@8330 86 status
erjo@8330 87 fi
al@20463 88
erjo@8330 89 # Fix perms for files and directories
pascal@18730 90 chroot "$1/" chown -R nagios.nagios /var/log/nagios \
al@20463 91 /var/spool/nagios \
al@20463 92 /var/lib/nagios \
al@20463 93 /usr/share/nagios \
al@20463 94 /etc/nagios/*
al@20463 95
pascal@18730 96 chmod 2775 "$1/var/lib/nagios/rw"
pascal@18730 97 chroot "$1/" addgroup www nagios
al@20463 98
erjo@8330 99 # Start Nagios daemon if we are on running system
pascal@18730 100 [ "$1" ] || /etc/init.d/nagios start
al@20463 101
al@20463 102 # post_install messages
al@20463 103 [ -n "$quiet" ] || cat <<EOT
al@20463 104
al@20463 105 .--------------------------------------------------------------.
al@20463 106 | To starts nagios server you can run: |
al@20463 107 | /etc/init.d/$PACKAGE start |
al@20463 108 | |
al@20463 109 | Or add nagios to RUN_DAEMONS in /etc/rcS.conf |
al@20463 110 |--------------------------------------------------------------|
al@20463 111 | Default login/password for the Web GUI is nagiosadmin/nagios |
al@20463 112 '--------------------------------------------------------------'
al@20463 113 EOT
erjo@8330 114 }
erjo@8330 115
al@20463 116 pre_remove_nagios() {
pascal@18730 117 [ "$1" ] || /etc/init.d/nagios stop
pascal@14466 118 }