wok-6.x view nagios/receipt @ rev 16280
Up: feh (2.10)
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Sun Apr 06 09:29:28 2014 +0000 (2014-04-06) |
parents | eb12af3fe895 |
children | 0d8a1a3edc72 |
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/run/nagios \
63 $fs/var/log/nagios \
64 $fs/var/spool/nagios/checkresults \
65 $fs/etc/apache
67 cp -a $install/etc/apache $fs/etc
68 cp -a $install/etc/nagios $fs/etc
69 cp -a $stuff/nagios $fs/etc/init.d
70 install -o root -g root -m 644 $stuff/htpasswd.users $fs/etc/nagios/
72 cp -a $install/usr/bin $fs/usr
73 cp -a $install/usr/lib $fs/usr
74 cp -a $install/usr/share $fs/usr
76 # Put doc in separate package
77 rm -rf $fs/usr/share/nagios/docs
79 # Fix Apache config for Nagvis
80 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
82 # Fix permissions
83 chmod 755 $fs/usr/bin/nagios*
84 }
86 post_install()
87 {
88 if ! grep -q nagios $1/etc/passwd; then
89 echo -n "Adding user/group nagios..."
90 chroot $1/ addgroup -S nagios
91 chroot $1/ adduser -S -D -H -G nagios nagios
92 status
93 fi
95 # Fix perms for files and directories
96 chroot $1/ chown -R nagios.nagios /var/log/nagios \
97 /var/run/nagios \
98 /var/spool/nagios \
99 /var/lib/nagios \
100 /usr/share/nagios \
101 /etc/nagios/*
104 chmod 2775 $1/var/lib/nagios/rw
105 chroot $1/ addgroup www nagios
107 # Start Nagios daemon if we are on running system
108 [ -z $1 ] && /etc/init.d/nagios start
110 # post_install messges
111 echo -e "\nTo starts $PACKAGE server you can run :\n"
112 echo "/etc/init.d/$PACKAGE start"
113 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
114 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
115 }
117 pre_remove()
118 {
119 [ -z $1 ] && /etc/init.d/nagios stop
120 }