wok-4.x view nagios/receipt @ rev 8344
lvm2: add patch to fix udevsync.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Feb 02 01:22:46 2011 +0000 (2011-02-02) |
parents | |
children | 1adca870d3e0 |
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios"
4 VERSION="3.2.3"
5 CATEGORY="network"
6 SHORT_DESC="Host and network monitoring"
7 MAINTAINER="erjo@slitaz.org"
8 DEPENDS="apache nagios-plugins libpng libjpeg"
9 BUILD_DEPENDS="libgd-dev libpng-dev libjpeg-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.nagios.org/"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
13 SUGGESTED="nagios-nrpe"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 while read patch_file; do
20 if [ ! -f done.$patch_file ]; then
21 patch -p1 < ../stuff/$patch_file || exit 1
22 touch done.$patch_file
23 fi
24 done <<EOT
25 $PACKAGE-$VERSION-Makefiles.u
26 EOT
27 #patch -p1 < ../stuff/nagios-3.2.1-Makefiles.u || exit 1
28 ./configure \
29 --prefix=/usr \
30 --infodir=/usr/share/info \
31 --mandir=/usr/share/man \
32 --with-nagios-user=nagios \
33 --with-nagios-group=nagios \
34 --with-lockfile=/var/run/nagios/nagios.pid \
35 --with-checkresult-dir=/var/spool/nagios/checkresults \
36 --sysconfdir=/etc/nagios \
37 --with-httpd-conf=/etc/apache/conf.d \
38 --libexecdir=/usr/lib/nagios/plugins \
39 --sbindir=/usr/lib/nagios/cgi \
40 --datadir=/usr/share/nagios \
41 --localstatedir=/var/log/nagios \
42 $CONFIGURE_ARGS
44 make all && make DESTDIR=$PWD/_pkg fullinstall \
45 && make DESTDIR=$PWD/_pkg install-config
46 }
48 # Rules to gen a SliTaz package suitable for Tazpkg.
49 genpkg_rules()
50 {
51 mkdir -p $fs/usr $fs/etc/init.d \
52 $fs/var/log/nagios/rw \
53 $fs/var/run/nagios \
54 $fs/var/spool/nagios/checkresults \
55 $fs/etc/apache
57 cp -a $_pkg/etc/apache $fs/etc
58 cp -a $_pkg/etc/nagios $fs/etc
59 cp -a stuff/nagios $fs/etc/init.d
60 install -o root -g root -m 644 stuff/htpasswd.users $fs/etc/nagios/
62 cp -a $_pkg/usr/bin $fs/usr
63 cp -a $_pkg/usr/lib $fs/usr
64 cp -a $_pkg/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
71 }
73 post_install()
74 {
75 if ! grep -q nagios $1/etc/passwd; then
76 echo -n "Adding user/group nagios..."
77 chroot $1/ addgroup -S nagios
78 chroot $1/ adduser -S -D -H -G nagios nagios
79 status
80 fi
82 # Fix perms for files and directories
83 chroot $1/ chown -R nagios.nagios /var/log/nagios \
84 /var/run/nagios \
85 /var/spool/nagios \
86 /usr/share/nagios \
87 /etc/nagios/*
90 chmod 2775 $1/var/log/nagios/rw
91 chroot $1/ addgroup www nagios
93 # Start Nagios daemon if we are on running system
94 [ -z $1 ] && /etc/init.d/nagios start
96 # post_install messges
97 echo -e "\nTo starts $PACKAGE server you can run :\n"
98 echo "/etc/init.d/$PACKAGE start"
99 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
100 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
101 }