wok view nagios/receipt @ rev 8792

Fix compile_rules() for gitmail
author Antoine Bodin <gokhlayeh@slitaz.org>
date Tue Feb 22 23:44:49 2011 +0100 (2011-02-22)
parents 0b4cf0d9e1b5
children 4f4c492f22a1
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 libltld"
9 BUILD_DEPENDS="libgd-dev libpng-dev jpeg-dev libtool-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 || return 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 || return 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/lib/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/lib/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
72 # Fix permissions
73 chmod 755 $fs/usr/bin/nagios*
74 }
76 post_install()
77 {
78 if ! grep -q nagios $1/etc/passwd; then
79 echo -n "Adding user/group nagios..."
80 chroot $1/ addgroup -S nagios
81 chroot $1/ adduser -S -D -H -G nagios nagios
82 status
83 fi
85 # Fix perms for files and directories
86 chroot $1/ chown -R nagios.nagios /var/log/nagios \
87 /var/run/nagios \
88 /var/spool/nagios \
89 /var/lib/nagios \
90 /usr/share/nagios \
91 /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 [ -z $1 ] && /etc/init.d/nagios start
100 # post_install messges
101 echo -e "\nTo starts $PACKAGE server you can run :\n"
102 echo "/etc/init.d/$PACKAGE start"
103 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
104 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
105 }