wok view nagios/receipt @ rev 24940

f2c: add libf2c (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 15 16:39:27 2022 +0000 (2022-04-15)
parents eb5518b1b094
children c145e26c3fc5
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios"
4 VERSION="4.4.6"
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 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - https://sourceforge.net/projects/nagios/files/ 2>/dev/null | \
23 sed '/scope="row/!d;/nagios-/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
24 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
25 sed '/scope="row/!d;s|.*/nagios-||;s|.tar.*||;q'
26 }
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 while read patch_file
32 do
33 if [ ! -f done.$patch_file ]
34 then
35 patch -p1 < $stuff/$patch_file || return 1
36 touch done.$patch_file
37 fi
38 done <<EOT
39 $PACKAGE-Makefiles.u
40 EOT
42 ./configure \
43 --prefix=/usr \
44 --infodir=/usr/share/info \
45 --mandir=/usr/share/man \
46 --with-nagios-user=nagios \
47 --with-nagios-group=nagios \
48 --with-lockfile=/var/run/nagios/nagios.pid \
49 --with-checkresult-dir=/var/spool/nagios/checkresults \
50 --sysconfdir=/etc/nagios \
51 --with-httpd-conf=/etc/apache/conf.d \
52 --libexecdir=/usr/lib/nagios/plugins \
53 --sbindir=/usr/lib/nagios/cgi \
54 --datadir=/usr/share/nagios \
55 --localstatedir=/var/lib/nagios \
56 $CONFIGURE_ARGS
58 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
60 #~ make all && make DESTDIR=$DESTDIR fullinstall \
61 #~ && make DESTDIR=$DESTDIR install-config
62 make all &&
63 make install &&
64 make install-config &&
65 make install-commandmode &&
66 make install-webconf &&
67 make install-classicui
68 }
70 # Rules to gen a SliTaz package suitable for Tazpkg.
71 genpkg_rules()
72 {
73 mkdir -p $fs/usr $fs/etc/init.d
74 mkdir -p $fs/var/lib/nagios/rw
75 mkdir -p $fs/var/log/nagios
76 mkdir -p $fs/var/spool/nagios/checkresults
77 mkdir -p $fs/etc/apache
79 cp -a $install/etc/apache $fs/etc
80 cp -a $install/etc/nagios $fs/etc
81 cp -a $stuff/nagios $fs/etc/init.d
82 install -o root -g root -m 644 $stuff/htpasswd.users \
83 $fs/etc/nagios/
85 cp -a $install/usr/bin $fs/usr
86 cp -a $install/usr/lib $fs/usr
87 cp -a $install/usr/share $fs/usr
89 # Put documentation in a separate package
90 rm -rf $fs/usr/share/nagios/docs
92 # Mofify Apache configuration for nagvis
93 sed -i 's/Options None/Options FollowSymLinks/' \
94 $fs/etc/apache/conf.d/nagios.conf
96 # Fix permissions
97 chmod 755 $fs/usr/bin/nagios*
98 }
100 post_install()
101 {
102 if ! grep -q nagios "$1/etc/passwd"
103 then
104 echo -n "Adding user/group nagios..."
105 chroot "$1/" addgroup -S nagios
106 chroot "$1/" adduser -S -D -H -G nagios nagios
107 status
108 fi
110 # Fix permissions for files and directories
111 chroot "$1/" chown -R nagios.nagios \
112 /var/log/nagios \
113 /var/spool/nagios \
114 /var/lib/nagios \
115 /usr/share/nagios \
116 /etc/nagios/*
118 chmod 2775 "$1/var/lib/nagios/rw"
119 chroot "$1/" addgroup www nagios
121 # Start Nagios daemon if we are on running system
122 [ "$1" ] || /etc/init.d/nagios start
124 # post_install messges
125 echo -e "\nTo start $PACKAGE server you can run :\n"
126 echo "/etc/init.d/$PACKAGE start"
127 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
128 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
129 }
131 pre_remove()
132 {
133 [ "$1" ] || /etc/init.d/nagios stop
134 }