wok-current annotate nagios/receipt @ rev 23456
updated pure-ftpd and pure-ftpd-pam (1.0.48 -> 1.0.49)
author | Hans-G?nter Theisgen |
---|---|
date | Fri Apr 03 13:56:35 2020 +0100 (2020-04-03) |
parents | baf354e69dbb |
children | eb5518b1b094 |
rev | line source |
---|---|
erjo@8330 | 1 # SliTaz package receipt. |
erjo@8330 | 2 |
erjo@8330 | 3 PACKAGE="nagios" |
Hans-G?nter@23210 | 4 VERSION="4.4.5" |
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@21510 | 16 BUILD_DEPENDS="jpeg-dev libgd-dev libpng-dev libtool procps unzip" |
Hans-G?nter@21510 | 17 # busybox ps and unzip do not supply the required options |
pascal@15584 | 18 |
erjo@8330 | 19 # Rules to configure and make the package. |
erjo@8330 | 20 compile_rules() |
erjo@8330 | 21 { |
Hans-G?nter@21510 | 22 while read patch_file |
Hans-G?nter@21510 | 23 do |
Hans-G?nter@23210 | 24 if [ ! -f done.$patch_file ] |
Hans-G?nter@23210 | 25 then |
slaxemulator@9700 | 26 patch -p1 < $stuff/$patch_file || return 1 |
erjo@8330 | 27 touch done.$patch_file |
erjo@8330 | 28 fi |
Hans-G?nter@21510 | 29 done <<EOT |
pascal@20376 | 30 $PACKAGE-Makefiles.u |
erjo@8330 | 31 EOT |
Hans-G?nter@21510 | 32 |
Hans-G?nter@21510 | 33 ./configure \ |
Hans-G?nter@21510 | 34 --prefix=/usr \ |
Hans-G?nter@21510 | 35 --infodir=/usr/share/info \ |
Hans-G?nter@21510 | 36 --mandir=/usr/share/man \ |
Hans-G?nter@21510 | 37 --with-nagios-user=nagios \ |
Hans-G?nter@21510 | 38 --with-nagios-group=nagios \ |
Hans-G?nter@21510 | 39 --with-lockfile=/var/run/nagios/nagios.pid \ |
Hans-G?nter@21510 | 40 --with-checkresult-dir=/var/spool/nagios/checkresults \ |
Hans-G?nter@21510 | 41 --sysconfdir=/etc/nagios \ |
Hans-G?nter@21510 | 42 --with-httpd-conf=/etc/apache/conf.d \ |
Hans-G?nter@21510 | 43 --libexecdir=/usr/lib/nagios/plugins \ |
Hans-G?nter@21510 | 44 --sbindir=/usr/lib/nagios/cgi \ |
Hans-G?nter@21510 | 45 --datadir=/usr/share/nagios \ |
Hans-G?nter@21510 | 46 --localstatedir=/var/lib/nagios \ |
erjo@8330 | 47 $CONFIGURE_ARGS |
erjo@8330 | 48 |
erjo@9865 | 49 sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile |
erjo@9865 | 50 |
pascal@15584 | 51 #~ make all && make DESTDIR=$DESTDIR fullinstall \ |
pascal@15584 | 52 #~ && make DESTDIR=$DESTDIR install-config |
Hans-G?nter@21510 | 53 make all && |
Hans-G?nter@21510 | 54 make install && |
Hans-G?nter@21510 | 55 make install-config && |
Hans-G?nter@21510 | 56 make install-commandmode && |
Hans-G?nter@21510 | 57 make install-webconf && |
Hans-G?nter@21510 | 58 make install-classicui |
erjo@8330 | 59 } |
erjo@8330 | 60 |
erjo@8330 | 61 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@8330 | 62 genpkg_rules() |
erjo@8330 | 63 { |
Hans-G?nter@23210 | 64 mkdir -p $fs/usr $fs/etc/init.d |
Hans-G?nter@23210 | 65 mkdir -p $fs/var/lib/nagios/rw |
Hans-G?nter@23210 | 66 mkdir -p $fs/var/log/nagios |
Hans-G?nter@23210 | 67 mkdir -p $fs/var/spool/nagios/checkresults |
Hans-G?nter@23210 | 68 mkdir -p $fs/etc/apache |
erjo@8330 | 69 |
Hans-G?nter@21510 | 70 cp -a $install/etc/apache $fs/etc |
Hans-G?nter@21510 | 71 cp -a $install/etc/nagios $fs/etc |
Hans-G?nter@21510 | 72 cp -a $stuff/nagios $fs/etc/init.d |
Hans-G?nter@23210 | 73 install -o root -g root -m 644 $stuff/htpasswd.users \ |
Hans-G?nter@23210 | 74 $fs/etc/nagios/ |
erjo@8330 | 75 |
Hans-G?nter@21510 | 76 cp -a $install/usr/bin $fs/usr |
Hans-G?nter@21510 | 77 cp -a $install/usr/lib $fs/usr |
Hans-G?nter@21510 | 78 cp -a $install/usr/share $fs/usr |
erjo@8330 | 79 |
Hans-G?nter@21510 | 80 # Put documentation in a separate package |
Hans-G?nter@23210 | 81 rm -rf $fs/usr/share/nagios/docs |
erjo@8330 | 82 |
Hans-G?nter@23210 | 83 # Mofify Apache configuration for nagvis |
Hans-G?nter@23210 | 84 sed -i 's/Options None/Options FollowSymLinks/' \ |
Hans-G?nter@23210 | 85 $fs/etc/apache/conf.d/nagios.conf |
Hans-G?nter@21510 | 86 |
erjo@8700 | 87 # Fix permissions |
Hans-G?nter@23210 | 88 chmod 755 $fs/usr/bin/nagios* |
erjo@8330 | 89 } |
erjo@8330 | 90 |
erjo@8330 | 91 post_install() |
erjo@8330 | 92 { |
Hans-G?nter@23210 | 93 if ! grep -q nagios "$1/etc/passwd" |
Hans-G?nter@23210 | 94 then |
erjo@8330 | 95 echo -n "Adding user/group nagios..." |
pascal@18730 | 96 chroot "$1/" addgroup -S nagios |
pascal@18730 | 97 chroot "$1/" adduser -S -D -H -G nagios nagios |
erjo@8330 | 98 status |
erjo@8330 | 99 fi |
erjo@8330 | 100 |
Hans-G?nter@21510 | 101 # Fix permissions for files and directories |
Hans-G?nter@23210 | 102 chroot "$1/" chown -R nagios.nagios \ |
Hans-G?nter@23210 | 103 /var/log/nagios \ |
Hans-G?nter@23210 | 104 /var/spool/nagios \ |
Hans-G?nter@23210 | 105 /var/lib/nagios \ |
Hans-G?nter@23210 | 106 /usr/share/nagios \ |
Hans-G?nter@23210 | 107 /etc/nagios/* |
erjo@8330 | 108 |
pascal@18730 | 109 chmod 2775 "$1/var/lib/nagios/rw" |
pascal@18730 | 110 chroot "$1/" addgroup www nagios |
erjo@8330 | 111 |
erjo@8330 | 112 # Start Nagios daemon if we are on running system |
pascal@18730 | 113 [ "$1" ] || /etc/init.d/nagios start |
erjo@8330 | 114 |
erjo@8330 | 115 # post_install messges |
erkan@20375 | 116 echo -e "\nTo start $PACKAGE server you can run :\n" |
erjo@8330 | 117 echo "/etc/init.d/$PACKAGE start" |
erjo@8330 | 118 echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" |
erjo@8330 | 119 echo -e "Default login/password for the Web GUI is nagiosadmin/nagios" |
erjo@8330 | 120 } |
erjo@8330 | 121 |
pascal@14466 | 122 pre_remove() |
pascal@14466 | 123 { |
pascal@18730 | 124 [ "$1" ] || /etc/init.d/nagios stop |
pascal@14466 | 125 } |