wok-current view nagios/receipt @ rev 20980
amule source modified for cryptopp 8.0.0
author | Hans-G?nter Theisgen |
---|---|
date | Wed Mar 06 13:37:18 2019 +0100 (2019-03-06) |
parents | 753911d96458 |
children | baf354e69dbb |
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios"
4 VERSION="3.5.1"
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="https://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 while read patch_file; do
21 if [ ! -f done.$patch_file ]; then
22 patch -p1 < $stuff/$patch_file || return 1
23 touch done.$patch_file
24 fi
25 done <<EOT
26 $PACKAGE-Makefiles.u
27 EOT
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 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
46 #~ make all && make DESTDIR=$DESTDIR fullinstall \
47 #~ && make DESTDIR=$DESTDIR install-config
48 make all && make install \
49 && make install-config \
50 && make install-commandmode \
51 && make install-webconf \
52 && make install-classicui
54 }
56 # Rules to gen a SliTaz package suitable for Tazpkg.
57 genpkg_rules()
58 {
59 mkdir -p $fs/usr $fs/etc/init.d \
60 $fs/var/lib/nagios/rw \
61 $fs/var/log/nagios \
62 $fs/var/spool/nagios/checkresults \
63 $fs/etc/apache
65 cp -a $install/etc/apache $fs/etc
66 cp -a $install/etc/nagios $fs/etc
67 cp -a $stuff/nagios $fs/etc/init.d
68 install -o root -g root -m 644 $stuff/htpasswd.users $fs/etc/nagios/
70 cp -a $install/usr/bin $fs/usr
71 cp -a $install/usr/lib $fs/usr
72 cp -a $install/usr/share $fs/usr
74 # Put doc in separate package
75 rm -rf $fs/usr/share/nagios/docs
77 # Fix Apache config for Nagvis
78 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
80 # Fix permissions
81 chmod 755 $fs/usr/bin/nagios*
82 }
84 post_install()
85 {
86 if ! grep -q nagios "$1/etc/passwd"; then
87 echo -n "Adding user/group nagios..."
88 chroot "$1/" addgroup -S nagios
89 chroot "$1/" adduser -S -D -H -G nagios nagios
90 status
91 fi
93 # Fix perms for files and directories
94 chroot "$1/" chown -R nagios.nagios /var/log/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 [ "$1" ] || /etc/init.d/nagios start
107 # post_install messges
108 echo -e "\nTo start $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 }
114 pre_remove()
115 {
116 [ "$1" ] || /etc/init.d/nagios stop
117 }