summaryrefslogtreecommitdiffstats
path: root/main/nagios-plugins/APKBUILD
blob: 18d9b5ed0c09361abac4b52b14aaa2b67dee1358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: Jeff Bilyk <jbilyk@gmail.com>
pkgname=nagios-plugins
pkgver=1.4.16
pkgrel=8
pkgdesc="Plugins for Nagios to check services on hosts"
url="http://nagiosplugins.org"
arch="all"
license="GPL-2"
depends="fping net-snmp-tools bind-tools nrpe-plugin perl-net-snmp"
makedepends="net-snmp-tools openssl-dev openldap-dev mysql-dev postgresql-dev libpq"
source="https://www.nagios-plugins.org/download/nagios-plugins-$pkgver.tar.gz"
pkgusers="nagios"
pkggroups="nagios"
subpackages="$pkgname-contrib"

prepare() {
	cd "$srcdir/$pkgname-$pkgver"
	update_config_sub || return 1
	# fix eglibc-2.16 build issue
	sed -i -e '/gets is a/d' \
		gl/stdio.in.h || return 1
}

build() {
	cd "$srcdir/$pkgname-$pkgver"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--bindir=/usr/sbin \
		--libexecdir=/usr/lib/nagios/plugins \
		--localstatedir=/var/nagios \
		--with-ps-command="/bin/ps" \
		--with-ps-format="%d %s %s %s" \
		--with-ps-varlist="&procpid,&procuid,&procpcpu,procprog" \
		--with-ps-cols=4 \
		--with-ping-command="/bin/ping -c %d %s" \
		|| return 1
	make all || return 1
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/lib/charset.alias
	rmdir -p "$pkgdir"/usr/lib 2>/dev/null
	return 0
}

contrib() {
	pkgdesc="Contrib Plugins for Nagios"
	arch="noarch"
	cd "$pkgdir"
	mkdir -p ${pkgdir}-contrib
	cd ${pkgdir}-contrib
	mkdir -p "${pkgdir}"-contrib/usr/lib/nagios/plugins/
	cp "$srcdir"/$pkgname-$pkgver/contrib/*.sh "${pkgdir}"-contrib/usr/lib/nagios/plugins/
	cp "$srcdir"/$pkgname-$pkgver/contrib/*.pl "${pkgdir}"-contrib/usr/lib/nagios/plugins/
	cp "$srcdir"/$pkgname-$pkgver/contrib/*.pm "${pkgdir}"-contrib/usr/lib/nagios/plugins/
	cp "$srcdir"/$pkgname-$pkgver/contrib/*.py "${pkgdir}"-contrib/usr/lib/nagios/plugins/
	chmod a+x "${pkgdir}"-contrib/usr/lib/nagios/plugins/*.sh
	chmod a+x "${pkgdir}"-contrib/usr/lib/nagios/plugins/*.pl
	chmod a+x "${pkgdir}"-contrib/usr/lib/nagios/plugins/*.pm
	chmod a+x "${pkgdir}"-contrib/usr/lib/nagios/plugins/*.py
}
	

md5sums="862f5e44fb5bc65ce7e5d86d654d4da0  nagios-plugins-1.4.16.tar.gz"
sha256sums="b0caf07e0084e9b7f10fdd71cbd3ebabcd85ad78df64da360b51233b0e73b2bd  nagios-plugins-1.4.16.tar.gz"
sha512sums="7a1401964b881c3db3e1e3f2a49dcf517ff7214724cc05c3ad629651b7e3eeb823b02abe0c6379d29996ac1e8a1208d918fd12e36cca46c7d36d9b1ebacdb2b3  nagios-plugins-1.4.16.tar.gz"