wok-next view nagios/receipt @ rev 20533

cairo-clock, grub4dos: fix CFLAGS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 27 12:50:45 2018 +0200 (2018-03-27)
parents e323d0535e2c
children 757d032c55c7
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 --prefix=/usr \
22 --infodir=/usr/share/info \
23 --mandir=/usr/share/man \
24 --with-nagios-user=nagios \
25 --with-nagios-group=nagios \
26 --with-lockfile=/var/run/nagios/nagios.pid \
27 --with-checkresult-dir=/var/spool/nagios/checkresults \
28 --sysconfdir=/etc/nagios \
29 --with-httpd-conf=/etc/apache/conf.d \
30 --libexecdir=/usr/lib/nagios/plugins \
31 --sbindir=/usr/lib/nagios/cgi \
32 --datadir=/usr/share/nagios \
33 --localstatedir=/var/lib/nagios \
34 $CONFIGURE_ARGS &&
35 sed -i 's!HTMLDIR=.*!HTMLDIR=/usr/share/nagios!' html/Makefile &&
37 #~ make all && make DESTDIR=$DESTDIR fullinstall \
38 #~ && make DESTDIR=$DESTDIR install-config
39 make all &&
40 make install &&
41 make install-config &&
42 make install-commandmode &&
43 make install-webconf &&
44 make install-classicui
45 }
47 genpkg_rules() {
48 case $PACKAGE in
49 nagios)
50 mkdir -p \
51 $fs/usr $fs/etc/init.d \
52 $fs/var/lib/nagios/rw \
53 $fs/var/log/nagios \
54 $fs/var/spool/nagios/checkresults \
55 $fs/etc/apache
57 cp -a $install/etc/apache $fs/etc
58 cp -a $install/etc/nagios $fs/etc
59 cp -a $stuff/nagios $fs/etc/init.d
60 install -m644 $stuff/htpasswd.users $fs/etc/nagios/
62 cp -a $install/usr/bin $fs/usr
63 cp -a $install/usr/lib $fs/usr
64 cp -a $install/usr/share $fs/usr
66 # Put doc in separate package
67 rm -rf $fs/usr/share/nagios/docs
69 # Fix Apache config for Nagvis
70 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
72 # Fix permissions
73 chmod 755 $fs/usr/bin/nagios*
74 DEPENDS="apache nagios-plugins libpng16 libjpeg libltdl"
75 SUGGESTED="nagios-nrpe"
76 ;;
77 nagios-dev)
78 mkdir -p $fs/usr
79 cp -pa $src/include $fs/usr
80 ;;
81 esac
82 }
84 post_install_nagios() {
85 if ! grep -q nagios "$1/etc/passwd"; then
86 echo -n "Adding user/group nagios..."
87 chroot "$1/" addgroup -S nagios
88 chroot "$1/" adduser -S -D -H -G nagios nagios
89 status
90 fi
92 # Fix perms for files and directories
93 chroot "$1/" chown -R nagios.nagios /var/log/nagios \
94 /var/spool/nagios \
95 /var/lib/nagios \
96 /usr/share/nagios \
97 /etc/nagios/*
99 chmod 2775 "$1/var/lib/nagios/rw"
100 chroot "$1/" addgroup www nagios
102 # Start Nagios daemon if we are on running system
103 [ "$1" ] || /etc/init.d/nagios start
105 # post_install messages
106 [ -n "$quiet" ] || cat <<EOT
108 .--------------------------------------------------------------.
109 | To starts nagios server you can run: |
110 | /etc/init.d/$PACKAGE start |
111 | |
112 | Or add nagios to RUN_DAEMONS in /etc/rcS.conf |
113 |--------------------------------------------------------------|
114 | Default login/password for the Web GUI is nagiosadmin/nagios |
115 '--------------------------------------------------------------'
116 EOT
117 }
119 pre_remove_nagios() {
120 [ "$1" ] || /etc/init.d/nagios stop
121 }