rev |
line source |
erjo@8331
|
1 # SliTaz package receipt.
|
erjo@8331
|
2
|
erjo@8331
|
3 PACKAGE="nagios-nrpe"
|
Hans-G?nter@24947
|
4 VERSION="4.0.3"
|
erjo@8331
|
5 CATEGORY="network"
|
erjo@8331
|
6 SHORT_DESC="Service and network monitoring program, remote monitoring."
|
erjo@8331
|
7 MAINTAINER="erjo@slitaz.org"
|
pascal@15584
|
8 LICENSE="GPL2"
|
Hans-G?nter@21511
|
9 WEB_SITE="https://www.nagios.org/"
|
Hans-G?nter@24947
|
10 REPOLOGY="nrpe"
|
Hans-G?nter@21511
|
11
|
erjo@8331
|
12 SOURCE="nrpe"
|
erjo@8331
|
13 TARBALL="$SOURCE-$VERSION.tar.gz"
|
Hans-G?nter@23211
|
14 WGET_URL="https://github.com/NagiosEnterprises/$SOURCE/releases/download/$SOURCE-$VERSION/$TARBALL"
|
pascal@15584
|
15
|
Hans-G?nter@24947
|
16 DEPENDS="libcrypto libssl nagios-plugins"
|
Hans-G?nter@21511
|
17 BUILD_DEPENDS="libcrypto-dev libwrap-dev openssl openssl-dev"
|
erjo@8331
|
18
|
pascal@24055
|
19 current_version()
|
pascal@24055
|
20 {
|
pascal@24055
|
21 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
|
pascal@24055
|
22 sed '/archive.*tar/!d;s|.*/nrpe-\(.*\).tar.*|\1|;q'
|
pascal@24055
|
23 }
|
pascal@24055
|
24
|
erjo@8331
|
25 # Rules to configure and make the package.
|
erjo@8331
|
26 compile_rules()
|
erjo@8331
|
27 {
|
Hans-G?nter@21511
|
28 while read patch_file
|
Hans-G?nter@23211
|
29 do
|
Hans-G?nter@23211
|
30 if [ ! -f done.$patch_file ]
|
Hans-G?nter@23211
|
31 then
|
slaxemulator@9700
|
32 patch -p1 < $stuff/$patch_file || return 1
|
erjo@8331
|
33 touch done.$patch_file
|
erjo@8331
|
34 fi
|
Hans-G?nter@23211
|
35 done <<EOT
|
erjo@8331
|
36 $PACKAGE-$VERSION-Makefile.u
|
erjo@8331
|
37 EOT
|
Hans-G?nter@21511
|
38
|
Hans-G?nter@23211
|
39 addgroup nagios
|
Hans-G?nter@23211
|
40 adduser -D -G nagios nagios
|
Hans-G?nter@24947
|
41
|
Hans-G?nter@21511
|
42 ./configure \
|
Hans-G?nter@21511
|
43 --prefix=/usr \
|
Hans-G?nter@21511
|
44 --infodir=/usr/share/info \
|
Hans-G?nter@21511
|
45 --localstatedir=/var \
|
Hans-G?nter@21511
|
46 --datadir=/usr/share/nagios \
|
Hans-G?nter@21511
|
47 --sysconfdir=/etc/nagios \
|
Hans-G?nter@21511
|
48 --sbindir=/usr/lib/nagios \
|
Hans-G?nter@21511
|
49 --bindir=/usr/bin \
|
Hans-G?nter@21511
|
50 --libexecdir=/usr/lib/nagios/plugins \
|
Hans-G?nter@21511
|
51 --enable-ssl \
|
Hans-G?nter@21511
|
52 --with-nagios-user=nagios \
|
Hans-G?nter@21511
|
53 --with-nagios-group=nagios \
|
Hans-G?nter@21511
|
54 --with-nrpe-user=nagios \
|
Hans-G?nter@21511
|
55 --with-nrpe-group=nagios \
|
Hans-G?nter@21511
|
56 --mandir=/usr/share/man \
|
Hans-G?nter@21511
|
57 $CONFIGURE_ARGS &&
|
erjo@8331
|
58 make all &&
|
Hans-G?nter@21511
|
59 make install
|
erjo@8331
|
60 }
|
erjo@8331
|
61
|
erjo@8331
|
62 # Rules to gen a SliTaz package suitable for Tazpkg.
|
erjo@8331
|
63 genpkg_rules()
|
erjo@8331
|
64 {
|
Hans-G?nter@21511
|
65 mkdir -p $fs/etc/nagios/objects
|
Hans-G?nter@21511
|
66 mkdir -p $fs/etc/init.d
|
Hans-G?nter@21511
|
67
|
Hans-G?nter@21511
|
68 cp -a $install/usr $fs
|
Hans-G?nter@21511
|
69 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
|
Hans-G?nter@21511
|
70
|
erjo@8331
|
71 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
|
Hans-G?nter@21511
|
72
|
Hans-G?nter@21511
|
73 # Install configuration file and init script
|
Hans-G?nter@21511
|
74 install -o root -g root -m 644 $stuff/nrpe.cfg $fs/etc/nagios/objects
|
Hans-G?nter@21511
|
75 install -o root -g root -m 755 $stuff/nrpe $fs/etc/init.d
|
erjo@8331
|
76 }
|
erjo@8331
|
77
|
erjo@8331
|
78 post_install()
|
erjo@8331
|
79 {
|
Hans-G?nter@23211
|
80 if ! grep -q nagios "$1/etc/passwd"
|
Hans-G?nter@23211
|
81 then
|
pascal@20319
|
82 echo
|
erjo@8331
|
83 echo -n "Adding user nagios..."
|
pascal@18730
|
84 chroot "$1/" adduser -S -D -H nagios
|
erjo@8331
|
85 status
|
erjo@8331
|
86 fi
|
erjo@8331
|
87
|
Hans-G?nter@21511
|
88 # Set permissions for files and directories
|
Hans-G?nter@21511
|
89 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
|
Hans-G?nter@21511
|
90 chroot "$1/" chown nagios.nagios /etc/nagios/*
|
erjo@8331
|
91
|
Hans-G?nter@21511
|
92 # Add check_nrpe in nagios configuration file
|
pascal@18730
|
93 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> "$1/etc/nagios/nagios.cfg"
|
erjo@8331
|
94 }
|
erjo@8331
|
95
|
erjo@8331
|
96 post_remove()
|
erjo@8331
|
97 {
|
Hans-G?nter@23211
|
98 [ -f "$1/etc/nagios/nagios.cfg" ] &&
|
Hans-G?nter@23211
|
99 sed -i 's/.*nrpe.cfg//' "$1/etc/nagios/nagios.cfg"
|
erjo@8331
|
100 }
|