wok-next view nagios/receipt @ rev 20607

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