wok view nagios/receipt @ rev 14455

Up: nagios (3.5.0)
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Apr 27 02:48:48 2013 +0200 (2013-04-27)
parents 4b13ba353944
children 00ec8a4f1615
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 DEPENDS="apache nagios-plugins libpng libjpeg libltdl"
9 BUILD_DEPENDS="libgd-dev libpng-dev jpeg-dev libtool"
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 ./configure \
28 --prefix=/usr \
29 --infodir=/usr/share/info \
30 --mandir=/usr/share/man \
31 --with-nagios-user=nagios \
32 --with-nagios-group=nagios \
33 --with-lockfile=/var/run/nagios/nagios.pid \
34 --with-checkresult-dir=/var/spool/nagios/checkresults \
35 --sysconfdir=/etc/nagios \
36 --with-httpd-conf=/etc/apache/conf.d \
37 --libexecdir=/usr/lib/nagios/plugins \
38 --sbindir=/usr/lib/nagios/cgi \
39 --datadir=/usr/share/nagios \
40 --localstatedir=/var/lib/nagios \
41 $CONFIGURE_ARGS
43 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
45 #~ make all && make DESTDIR=$PWD/_pkg fullinstall \
46 #~ && make DESTDIR=$PWD/_pkg install-config
47 make all && make install \
48 && make install-config \
49 && make install-commandmode \
50 && make install-webconf \
51 && make install-classicui
53 }
55 # Rules to gen a SliTaz package suitable for Tazpkg.
56 genpkg_rules()
57 {
58 mkdir -p $fs/usr $fs/etc/init.d \
59 $fs/var/lib/nagios/rw \
60 $fs/var/run/nagios \
61 $fs/var/spool/nagios/checkresults \
62 $fs/etc/apache
64 cp -a $install/etc/apache $fs/etc
65 cp -a $install/etc/nagios $fs/etc
66 cp -a $stuff/nagios $fs/etc/init.d
67 install -o root -g root -m 644 $stuff/htpasswd.users $fs/etc/nagios/
69 cp -a $install/usr/bin $fs/usr
70 cp -a $install/usr/lib $fs/usr
71 cp -a $install/usr/share $fs/usr
73 # Put doc in separate package
74 rm -rf $fs/usr/share/nagios/docs
76 # Fix Apache config for Nagvis
77 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
79 # Fix permissions
80 chmod 755 $fs/usr/bin/nagios*
81 }
83 post_install()
84 {
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/run/nagios \
95 /var/spool/nagios \
96 /var/lib/nagios \
97 /usr/share/nagios \
98 /etc/nagios/*
101 chmod 2775 $1/var/lib/nagios/rw
102 chroot $1/ addgroup www nagios
104 # Start Nagios daemon if we are on running system
105 [ -z $1 ] && /etc/init.d/nagios start
107 # post_install messges
108 echo -e "\nTo starts $PACKAGE server you can run :\n"
109 echo "/etc/init.d/$PACKAGE start"
110 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
111 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
112 }