wok-current view nagios-plugins/receipt @ rev 24083

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 10 11:40:16 2021 +0000 (2021-07-10)
parents b15cc3561ef8
children cf5131fd17f5
line source
1 # SliTaz package receipt.
3 PACKAGE="nagios-plugins"
4 VERSION="2.3.3"
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://www.nagios-plugins.org/download/$TARBALL"
14 DEPENDS="fping libssl procps"
15 BUILD_DEPENDS="libmysqlclient mysql-dev openldap-dev openssl-dev \
16 radiusclient-ng radiusclient-ng-dev procps"
18 current_version()
19 {
20 wget -O - $(dirname $WGET_URL) 2>/dev/null | \
21 sed "/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
22 }
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 ./configure \
28 --prefix=/usr \
29 --libexecdir=/usr/lib/nagios/plugins \
30 --with-nagios-user=nobody \
31 --with-nagios-group=nogroup \
32 --with-ping-command="/bin/ping -w %d -c %d %s" \
33 --with-fping-command="/usr/sbin/fping" \
34 --mandir=/usr/share/man \
35 $CONFIGURE_ARGS &&
36 make &&
37 make DESTDIR=$DESTDIR install &&
38 make DESTDIR=$DESTDIR install-root
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 mkdir -p $fs/usr/lib
45 mkdir -p $fs/etc/nagios/objects
47 cp -a $install/usr/lib/nagios $fs/usr/lib
49 #
50 stuff/convertcfg $src/command.cfg commands > $fs/etc/nagios/objects/command.cfg
52 # Move mySQL plugins in a separate package.
53 rm -f $fs/usr/lib/nagios/plugins/*mysql*
54 }
56 post_install()
57 {
58 if ! grep -q nagios "$1/etc/passwd"
59 then
60 echo
61 echo -n "Adding user/group nagios..."
62 chroot "$1/" addgroup -S nagios
63 chroot "$1/" adduser -S -D -H -G nagios nagios
64 status
65 fi
67 if [ -f "$1/etc/nagios/resource.cfg" ]
68 then
69 sed -i 's|/usr/lib/nagios|/usr/lib/nagios/plugins|' \
70 "$1/etc/nagios/resource.cfg"
71 fi
73 # Set permissions for files and directories
74 chroot "$1/" chown -R nagios.nagios /usr/lib/nagios/plugins
75 chroot "$1/" chown -R nagios.nagios /etc/nagios/objects
76 }