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

mpg123: Replaced libtool depend with libtdl.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Apr 25 19:12:16 2011 +0000 (2011-04-25)
parents 0b4cf0d9e1b5
children d1768332cee0
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-nrpe"
4 VERSION="2.12"
5 CATEGORY="network"
6 SHORT_DESC="Service and network monitoring program, remote monitoring."
7 MAINTAINER="erjo@slitaz.org"
8 SOURCE="nrpe"
9 TARBALL="$SOURCE-$VERSION.tar.gz"
10 WEB_SITE="http://www.nagios.org/"
11 WGET_URL="$SF_MIRROR/nagios/$TARBALL"
12 BUILD_DEPENDS="libcrypto-dev openssl-dev openssl libwrap-dev"
13 DEPENDS="nagios-plugins libssl libcrypto"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 while read patch_file; do
20 if [ ! -f done.$patch_file ]; then
21 patch -p1 < ../stuff/$patch_file || return 1
22 touch done.$patch_file
23 fi
24 done <<EOT
25 $PACKAGE-$VERSION-Makefile.u
26 EOT
27 ./configure --prefix=/usr --infodir=/usr/share/info \
28 --localstatedir=/var \
29 --datadir=/usr/share/nagios \
30 --sysconfdir=/etc/nagios \
31 --sbindir=/usr/lib/nagios \
32 --bindir=/usr/bin \
33 --libexecdir=/usr/lib/nagios/plugins \
34 --with-nagios-user=nagios \
35 --with-nagios-group=nagios \
36 --with-nrpe-user=nagios \
37 --with-nrpe-group=nagios \
38 --mandir=/usr/share/man $CONFIGURE_ARGS &&
39 make all &&
40 make DESTDIR=$PWD/_pkg install
41 }
43 # Rules to gen a SliTaz package suitable for Tazpkg.
44 genpkg_rules()
45 {
46 mkdir -p $fs/etc/nagios/objects \
47 $fs/etc/init.d \
48 $fs/var/run/nagios
50 cp -a $_pkg/usr $fs
51 install -m 0644 $src/sample-config/nrpe.cfg $fs/etc/nagios
52 sed -i 's|/var/run|/var/run/nagios|' $fs/etc/nagios/nrpe.cfg
54 # Install config file nd init script
55 install -o root -g root -m 644 stuff/nrpe.cfg $fs/etc/nagios/objects
56 install -o root -g root -m 755 stuff/nrpe $fs/etc/init.d
57 }
59 post_install()
60 {
61 if ! grep -q nagios $1/etc/passwd; then
62 echo -n "Adding user nagios..."
63 chroot $1/ adduser -S -D -H nagios
64 status
65 fi
67 # Set perms for files and directories
68 chroot $1/ chown -R nagios.nagios /usr/lib/nagios/plugins /var/run/nagios
69 chroot $1/ chown nagios.nagios /etc/nagios/*
71 # Add check_nrpe in nagios config file
72 echo "cfg_file=/etc/nagios/objects/nrpe.cfg" >> $1/etc/nagios/nagios.cfg
73 }
75 post_remove()
76 {
77 [ -f $1/etc/nagios/nagios.cfg ] && sed -i 's/.*nrpe.cfg//' $1/etc/nagios/nagios.cfg
78 }