wok-6.x view nagios-nrpe/receipt @ rev 21478

updated mpc (0.25 -> 0.31)
author Hans-G?nter Theisgen
date Wed May 01 08:32:15 2019 +0100 (2019-05-01)
parents 8c314507df00
children 0fda98eeae85
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-nrpe"
4 VERSION="2.14"
5 CATEGORY="network"
6 SHORT_DESC="Service and network monitoring program, remote monitoring."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 SOURCE="nrpe"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="https://www.nagios.org/"
12 WGET_URL="$SF_MIRROR/nagios/$TARBALL"
14 BUILD_DEPENDS="libcrypto-dev openssl-dev openssl libwrap-dev"
15 DEPENDS="nagios-plugins libssl libcrypto"
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-$VERSION-Makefile.u
27 EOT
28 ./configure --prefix=/usr --infodir=/usr/share/info \
29 --localstatedir=/var \
30 --datadir=/usr/share/nagios \
31 --sysconfdir=/etc/nagios \
32 --sbindir=/usr/lib/nagios \
33 --bindir=/usr/bin \
34 --libexecdir=/usr/lib/nagios/plugins \
35 --enable-ssl \
36 --with-nagios-user=nagios \
37 --with-nagios-group=nagios \
38 --with-nrpe-user=nagios \
39 --with-nrpe-group=nagios \
40 --mandir=/usr/share/man $CONFIGURE_ARGS &&
41 make all &&
42 make install
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/etc/nagios/objects \
49 $fs/etc/init.d
51 cp -a $install/usr $fs
52 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
53 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
55 # Install config file nd init script
56 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
57 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
58 }
60 post_install()
61 {
62 if ! grep -q nagios "$1/etc/passwd"; then
63 echo
64 echo -n "Adding user nagios..."
65 chroot "$1/" adduser -S -D -H nagios
66 status
67 fi
69 # Set perms for files and directories
70 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
71 chroot "$1/" chown nagios.nagios /etc/nagios/*
73 # Add check_nrpe in nagios config file
74 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
75 }
77 post_remove()
78 {
79 [ -f "$1/etc/nagios/nagios.cfg" ] && sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
80 }