wok-6.x view nagios/receipt @ rev 23804
Up cryptsetup (2.3.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 24 07:30:14 2020 +0000 (2020-05-24) |
parents | baf354e69dbb |
children | eb5518b1b094 |
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios"
4 VERSION="4.4.5"
5 CATEGORY="network"
6 SHORT_DESC="Host and network monitoring."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.nagios.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 SUGGESTED="nagios-nrpe"
15 DEPENDS="apache libjpeg libltdl libpng nagios-plugins"
16 BUILD_DEPENDS="jpeg-dev libgd-dev libpng-dev libtool procps unzip"
17 # busybox ps and unzip do not supply the required options
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 while read patch_file
23 do
24 if [ ! -f done.$patch_file ]
25 then
26 patch -p1 < $stuff/$patch_file || return 1
27 touch done.$patch_file
28 fi
29 done <<EOT
30 $PACKAGE-Makefiles.u
31 EOT
33 ./configure \
34 --prefix=/usr \
35 --infodir=/usr/share/info \
36 --mandir=/usr/share/man \
37 --with-nagios-user=nagios \
38 --with-nagios-group=nagios \
39 --with-lockfile=/var/run/nagios/nagios.pid \
40 --with-checkresult-dir=/var/spool/nagios/checkresults \
41 --sysconfdir=/etc/nagios \
42 --with-httpd-conf=/etc/apache/conf.d \
43 --libexecdir=/usr/lib/nagios/plugins \
44 --sbindir=/usr/lib/nagios/cgi \
45 --datadir=/usr/share/nagios \
46 --localstatedir=/var/lib/nagios \
47 $CONFIGURE_ARGS
49 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
51 #~ make all && make DESTDIR=$DESTDIR fullinstall \
52 #~ && make DESTDIR=$DESTDIR install-config
53 make all &&
54 make install &&
55 make install-config &&
56 make install-commandmode &&
57 make install-webconf &&
58 make install-classicui
59 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 genpkg_rules()
63 {
64 mkdir -p $fs/usr $fs/etc/init.d
65 mkdir -p $fs/var/lib/nagios/rw
66 mkdir -p $fs/var/log/nagios
67 mkdir -p $fs/var/spool/nagios/checkresults
68 mkdir -p $fs/etc/apache
70 cp -a $install/etc/apache $fs/etc
71 cp -a $install/etc/nagios $fs/etc
72 cp -a $stuff/nagios $fs/etc/init.d
73 install -o root -g root -m 644 $stuff/htpasswd.users \
74 $fs/etc/nagios/
76 cp -a $install/usr/bin $fs/usr
77 cp -a $install/usr/lib $fs/usr
78 cp -a $install/usr/share $fs/usr
80 # Put documentation in a separate package
81 rm -rf $fs/usr/share/nagios/docs
83 # Mofify Apache configuration for nagvis
84 sed -i 's/Options None/Options FollowSymLinks/' \
85 $fs/etc/apache/conf.d/nagios.conf
87 # Fix permissions
88 chmod 755 $fs/usr/bin/nagios*
89 }
91 post_install()
92 {
93 if ! grep -q nagios "$1/etc/passwd"
94 then
95 echo -n "Adding user/group nagios..."
96 chroot "$1/" addgroup -S nagios
97 chroot "$1/" adduser -S -D -H -G nagios nagios
98 status
99 fi
101 # Fix permissions for files and directories
102 chroot "$1/" chown -R nagios.nagios \
103 /var/log/nagios \
104 /var/spool/nagios \
105 /var/lib/nagios \
106 /usr/share/nagios \
107 /etc/nagios/*
109 chmod 2775 "$1/var/lib/nagios/rw"
110 chroot "$1/" addgroup www nagios
112 # Start Nagios daemon if we are on running system
113 [ "$1" ] || /etc/init.d/nagios start
115 # post_install messges
116 echo -e "\nTo start $PACKAGE server you can run :\n"
117 echo "/etc/init.d/$PACKAGE start"
118 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
119 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
120 }
122 pre_remove()
123 {
124 [ "$1" ] || /etc/init.d/nagios stop
125 }