wok annotate nagios/receipt @ rev 25503

f3: include extra programs
author Hans-G?nter Theisgen
date Fri Jan 27 10:37:43 2023 +0100 (15 months ago)
parents afae00265386
children d3556b8f5c3d
rev   line source
erjo@8330 1 # SliTaz package receipt.
erjo@8330 2
erjo@8330 3 PACKAGE="nagios"
Hans-G?nter@24946 4 VERSION="4.4.7"
erjo@8330 5 CATEGORY="network"
Hans-G?nter@21510 6 SHORT_DESC="Host and network monitoring."
erjo@8330 7 MAINTAINER="erjo@slitaz.org"
pascal@15584 8 LICENSE="GPL2"
Hans-G?nter@21510 9 WEB_SITE="https://www.nagios.org/"
Hans-G?nter@21510 10
erjo@8330 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@8330 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
Hans-G?nter@21510 13
erjo@8330 14 SUGGESTED="nagios-nrpe"
Hans-G?nter@21510 15 DEPENDS="apache libjpeg libltdl libpng nagios-plugins"
Hans-G?nter@24946 16 BUILD_DEPENDS="jpeg-dev libgd-dev libpng-dev libtool openssl-dev procps unzip"
Hans-G?nter@21510 17 # busybox ps and unzip do not supply the required options
pascal@15584 18
pascal@24402 19 # What is the latest version available today?
pascal@24402 20 current_version()
pascal@24402 21 {
pascal@24402 22 wget -O - https://sourceforge.net/projects/nagios/files/ 2>/dev/null | \
pascal@24402 23 sed '/scope="row/!d;/nagios-/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
pascal@24402 24 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
pascal@24402 25 sed '/scope="row/!d;s|.*/nagios-||;s|.tar.*||;q'
pascal@24402 26 }
pascal@24402 27
erjo@8330 28 # Rules to configure and make the package.
erjo@8330 29 compile_rules()
erjo@8330 30 {
Hans-G?nter@21510 31 while read patch_file
Hans-G?nter@24946 32 do
Hans-G?nter@23210 33 if [ ! -f done.$patch_file ]
Hans-G?nter@23210 34 then
slaxemulator@9700 35 patch -p1 < $stuff/$patch_file || return 1
erjo@8330 36 touch done.$patch_file
erjo@8330 37 fi
Hans-G?nter@24946 38 done <<EOT
pascal@20376 39 $PACKAGE-Makefiles.u
erjo@8330 40 EOT
Hans-G?nter@21510 41
Hans-G?nter@21510 42 ./configure \
Hans-G?nter@21510 43 --prefix=/usr \
Hans-G?nter@21510 44 --infodir=/usr/share/info \
Hans-G?nter@21510 45 --mandir=/usr/share/man \
Hans-G?nter@21510 46 --with-nagios-user=nagios \
Hans-G?nter@21510 47 --with-nagios-group=nagios \
Hans-G?nter@21510 48 --with-lockfile=/var/run/nagios/nagios.pid \
Hans-G?nter@21510 49 --with-checkresult-dir=/var/spool/nagios/checkresults \
Hans-G?nter@21510 50 --sysconfdir=/etc/nagios \
Hans-G?nter@21510 51 --with-httpd-conf=/etc/apache/conf.d \
Hans-G?nter@21510 52 --libexecdir=/usr/lib/nagios/plugins \
Hans-G?nter@21510 53 --sbindir=/usr/lib/nagios/cgi \
Hans-G?nter@21510 54 --datadir=/usr/share/nagios \
Hans-G?nter@21510 55 --localstatedir=/var/lib/nagios \
erjo@8330 56 $CONFIGURE_ARGS
Hans-G?nter@24946 57
Hans-G?nter@24946 58 # 4.4.7 not required
Hans-G?nter@24946 59 # sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
erjo@9865 60
pascal@15584 61 #~ make all && make DESTDIR=$DESTDIR fullinstall \
pascal@15584 62 #~ && make DESTDIR=$DESTDIR install-config
Hans-G?nter@21510 63 make all &&
Hans-G?nter@21510 64 make install &&
Hans-G?nter@21510 65 make install-config &&
Hans-G?nter@21510 66 make install-commandmode &&
Hans-G?nter@21510 67 make install-webconf &&
Hans-G?nter@21510 68 make install-classicui
erjo@8330 69 }
erjo@8330 70
erjo@8330 71 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@8330 72 genpkg_rules()
erjo@8330 73 {
Hans-G?nter@24946 74 mkdir -p $fs/etc/apache
Hans-G?nter@24946 75 mkdir -p $fs/etc/init.d
Hans-G?nter@24946 76 mkdir -p $fs/usr
Hans-G?nter@23210 77 mkdir -p $fs/var/lib/nagios/rw
Hans-G?nter@23210 78 mkdir -p $fs/var/log/nagios
Hans-G?nter@23210 79 mkdir -p $fs/var/spool/nagios/checkresults
Hans-G?nter@24946 80
Hans-G?nter@21510 81 cp -a $install/etc/apache $fs/etc
Hans-G?nter@21510 82 cp -a $install/etc/nagios $fs/etc
Hans-G?nter@21510 83 cp -a $stuff/nagios $fs/etc/init.d
Hans-G?nter@23210 84 install -o root -g root -m 644 $stuff/htpasswd.users \
Hans-G?nter@23210 85 $fs/etc/nagios/
erjo@8330 86
Hans-G?nter@21510 87 cp -a $install/usr/bin $fs/usr
Hans-G?nter@21510 88 cp -a $install/usr/lib $fs/usr
Hans-G?nter@21510 89 cp -a $install/usr/share $fs/usr
erjo@8330 90
Hans-G?nter@21510 91 # Put documentation in a separate package
Hans-G?nter@23210 92 rm -rf $fs/usr/share/nagios/docs
erjo@8330 93
Hans-G?nter@23210 94 # Mofify Apache configuration for nagvis
Hans-G?nter@23210 95 sed -i 's/Options None/Options FollowSymLinks/' \
Hans-G?nter@23210 96 $fs/etc/apache/conf.d/nagios.conf
Hans-G?nter@21510 97
erjo@8700 98 # Fix permissions
Hans-G?nter@23210 99 chmod 755 $fs/usr/bin/nagios*
erjo@8330 100 }
erjo@8330 101
erjo@8330 102 post_install()
erjo@8330 103 {
Hans-G?nter@23210 104 if ! grep -q nagios "$1/etc/passwd"
Hans-G?nter@23210 105 then
Hans-G?nter@24946 106 echo -n "Adding user and group nagios..."
pascal@18730 107 chroot "$1/" addgroup -S nagios
pascal@18730 108 chroot "$1/" adduser -S -D -H -G nagios nagios
erjo@8330 109 status
erjo@8330 110 fi
erjo@8330 111
Hans-G?nter@21510 112 # Fix permissions for files and directories
Hans-G?nter@23210 113 chroot "$1/" chown -R nagios.nagios \
Hans-G?nter@23210 114 /var/log/nagios \
Hans-G?nter@23210 115 /var/spool/nagios \
Hans-G?nter@23210 116 /var/lib/nagios \
Hans-G?nter@23210 117 /usr/share/nagios \
Hans-G?nter@23210 118 /etc/nagios/*
erjo@8330 119
pascal@18730 120 chmod 2775 "$1/var/lib/nagios/rw"
pascal@18730 121 chroot "$1/" addgroup www nagios
erjo@8330 122
erjo@8330 123 # Start Nagios daemon if we are on running system
pascal@18730 124 [ "$1" ] || /etc/init.d/nagios start
erjo@8330 125
erjo@8330 126 # post_install messges
erkan@20375 127 echo -e "\nTo start $PACKAGE server you can run :\n"
erjo@8330 128 echo "/etc/init.d/$PACKAGE start"
erjo@8330 129 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
Hans-G?nter@24946 130 echo -e "Default user and password for the Web GUI is nagiosadmin and nagios"
erjo@8330 131 }
erjo@8330 132
pascal@14466 133 pre_remove()
pascal@14466 134 {
pascal@18730 135 [ "$1" ] || /etc/init.d/nagios stop
pascal@14466 136 }