wok-6.x view nagios/receipt @ rev 16681

Create some /var/run/<dir> in /etc/init.d/<daemon> scritps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 18 20:24:07 2014 +0000 (2014-05-18)
parents 3765f181a6d5
children 9e01bc6321ea
line source
1 # SliTaz package receipt.
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.nagios.org/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 SUGGESTED="nagios-nrpe"
14 DEPENDS="apache nagios-plugins libpng libjpeg libltdl"
15 BUILD_DEPENDS="libgd-dev libpng-dev jpeg-dev libtool"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 while read patch_file; do
22 if [ ! -f done.$patch_file ]; then
23 patch -p1 < $stuff/$patch_file || return 1
24 touch done.$patch_file
25 fi
26 done <<EOT
27 $PACKAGE-$VERSION-Makefiles.u
28 EOT
29 ./configure \
30 --prefix=/usr \
31 --infodir=/usr/share/info \
32 --mandir=/usr/share/man \
33 --with-nagios-user=nagios \
34 --with-nagios-group=nagios \
35 --with-lockfile=/var/run/nagios/nagios.pid \
36 --with-checkresult-dir=/var/spool/nagios/checkresults \
37 --sysconfdir=/etc/nagios \
38 --with-httpd-conf=/etc/apache/conf.d \
39 --libexecdir=/usr/lib/nagios/plugins \
40 --sbindir=/usr/lib/nagios/cgi \
41 --datadir=/usr/share/nagios \
42 --localstatedir=/var/lib/nagios \
43 $CONFIGURE_ARGS
45 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
47 #~ make all && make DESTDIR=$DESTDIR fullinstall \
48 #~ && make DESTDIR=$DESTDIR install-config
49 make all && make install \
50 && make install-config \
51 && make install-commandmode \
52 && make install-webconf \
53 && make install-classicui
55 }
57 # Rules to gen a SliTaz package suitable for Tazpkg.
58 genpkg_rules()
59 {
60 mkdir -p $fs/usr $fs/etc/init.d \
61 $fs/var/lib/nagios/rw \
62 $fs/var/log/nagios \
63 $fs/var/spool/nagios/checkresults \
64 $fs/etc/apache
66 cp -a $install/etc/apache $fs/etc
67 cp -a $install/etc/nagios $fs/etc
68 cp -a $stuff/nagios $fs/etc/init.d
69 install -o root -g root -m 644 $stuff/htpasswd.users $fs/etc/nagios/
71 cp -a $install/usr/bin $fs/usr
72 cp -a $install/usr/lib $fs/usr
73 cp -a $install/usr/share $fs/usr
75 # Put doc in separate package
76 rm -rf $fs/usr/share/nagios/docs
78 # Fix Apache config for Nagvis
79 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
81 # Fix permissions
82 chmod 755 $fs/usr/bin/nagios*
83 }
85 post_install()
86 {
87 if ! grep -q nagios $1/etc/passwd; then
88 echo -n "Adding user/group nagios..."
89 chroot $1/ addgroup -S nagios
90 chroot $1/ adduser -S -D -H -G nagios nagios
91 status
92 fi
94 # Fix perms for files and directories
95 chroot $1/ chown -R nagios.nagios /var/log/nagios \
96 /var/spool/nagios \
97 /var/lib/nagios \
98 /usr/share/nagios \
99 /etc/nagios/*
102 chmod 2775 $1/var/lib/nagios/rw
103 chroot $1/ addgroup www nagios
105 # Start Nagios daemon if we are on running system
106 [ -z $1 ] && /etc/init.d/nagios start
108 # post_install messges
109 echo -e "\nTo starts $PACKAGE server you can run :\n"
110 echo "/etc/init.d/$PACKAGE start"
111 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
112 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
113 }
115 pre_remove()
116 {
117 [ -z $1 ] && /etc/init.d/nagios stop
118 }