wok view nagios-plugins/receipt @ rev 25682

Up libqcow (20240308)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 24 18:25:46 2024 +0000 (2 months ago)
parents afc372dd794f
children
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-plugins"
4 VERSION="2.4.0"
5 CATEGORY="network"
6 SHORT_DESC="Plugins for host, service and network monitoring program nagios."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://www.nagios-plugins.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://github.com/$PACKAGE/$PACKAGE/archive/refs/tags/release-$VERSION.tar.gz"
14 SUGGESTED="nagios-plugins-lang"
15 DEPENDS="fping libssl procps"
16 BUILD_DEPENDS="automake file libmysqlclient mysql-dev openldap-dev openssl-dev
17 procps radiusclient-ng radiusclient-ng-dev"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
23 sed '/tag\//!d;s|.*tag/[a-z-]*||;s|".*||;q'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 ./tools/setup &&
30 ./configure \
31 --prefix=/usr \
32 --libexecdir=/usr/lib/nagios/plugins \
33 --with-nagios-user=nobody \
34 --with-nagios-group=nogroup \
35 --with-ping-command="/bin/ping -w %d -c %d %s" \
36 --with-fping-command="/usr/sbin/fping" \
37 --mandir=/usr/share/man \
38 $CONFIGURE_ARGS &&
39 patch --strip=0 --input=$stuff/patches/check_load.c-2.4.0 &&
40 make &&
41 make install DESTDIR=$DESTDIR &&
42 make install-root DESTDIR=$DESTDIR
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 mkdir -p $fs/usr/lib
49 mkdir -p $fs/etc/nagios/objects
51 cp -a $install/usr/lib/nagios $fs/usr/lib
53 #
54 stuff/convertcfg $src/command.cfg commands > $fs/etc/nagios/objects/command.cfg
56 # Move mySQL plugins in a separate package.
57 rm -f $fs/usr/lib/nagios/plugins/*mysql*
58 }
60 post_install()
61 {
62 if ! grep -q nagios "$1/etc/passwd"
63 then
64 echo
65 echo -n "Adding user and group nagios..."
66 chroot "$1/" addgroup -S nagios
67 chroot "$1/" adduser -S -D -H -G nagios nagios
68 status
69 fi
71 if [ -f "$1/etc/nagios/resource.cfg" ]
72 then
73 sed -i 's|/usr/lib/nagios|/usr/lib/nagios/plugins|' \
74 "$1/etc/nagios/resource.cfg"
75 fi
77 # Set permissions for files and directories
78 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
79 chroot "$1/" chown -R nagios.nagios /etc/nagios/objects
80 }