aboutsummaryrefslogtreecommitdiffstats
path: root/main/nagios/APKBUILD
blob: 78d5c1fe7589082bb01373ff10a8220c10fb9d27 (plain) (blame)
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
74
75
76
77
78
79
80
# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=nagios
pkgver=4.4.6
pkgrel=3
pkgdesc="Popular monitoring tool"
url="https://www.nagios.org/"
arch="all"
license="GPL-2.0-only"
depends="perl"
install="$pkgname.pre-install"
makedepends="gd-dev perl-dev libpng-dev libjpeg perl-net-snmp unzip"
source="https://downloads.sourceforge.net/nagios/nagios-$pkgver.tar.gz
	nagios.confd
	nagios.initd
	lighttpd-nagios.conf
	cgi-pairlist-truncation-fix.patch"
subpackages="
	$pkgname-web::noarch
	$pkgname-openrc::noarch
	$pkgname-apache::noarch"
pkgusers="nagios"
pkggroups="nagios"
options="!check" #no checks

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/nagios \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--datadir=/usr/share/nagios \
		--localstatedir=/var \
		--bindir=/usr/sbin \
		--with-cgibindir=/usr/lib/nagios/cgi-bin \
		--datadir=/usr/share/nagios/htdocs \
		--libexecdir=/usr/lib/nagios/plugins \
		--localstatedir=/var/nagios \
		--with-nagios-user=nagios \
		--with-nagios-group=nagios \
		--enable-embedded-perl \
		--with-perlcache
	make all
}

package() {
	make DESTDIR="$pkgdir" install
	make DESTDIR="$pkgdir" install-config
	make DESTDIR="$pkgdir" install-commandmode

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}


web() {
	#depends="php lighttpd"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/share "$subpkgdir"/usr/
	install -m644 -D "$srcdir"/lighttpd-nagios.conf "$subpkgdir"/etc/lighttpd/nagios.conf
}

apache() {
	depends="apache2 apache2-utils"
	install -m644 -D "$srcdir"/nagios-$pkgver/sample-config/httpd.conf "$subpkgdir"/etc/apache2/sites-available/nagios.conf
}

sha512sums="6ceb582816ec741439963bde1fe8d85fa3bc4ed3c2238fb818db0c4f4224a4333d153040c11a7f4d783e919c11f9ff45907bdc478504e4155f64a4c575f80550  nagios-4.4.6.tar.gz
8575902dcb7252f195847f9997b424c1ef9bee7dfacdd124c922fc119f583923c34847ce77c505783662d91f7290b1a85dc5e382ac50d177406bfb3876d4e40a  nagios.confd
a004ed1cf8e7d9faeb849cd714095dbe5157c707618d2cce92c98c78604b896bb806b55aa69b2db8ca3e954bd629f9e3db5d2676015f87d6be5da32fa9ec5664  nagios.initd
6f1448db1964e378dbc7460a6d321638f4d0f7a08bc078824edca12fb6653fb0200b3be365fa519e7b2ff566802701878975bb97e65d65dc54d3da34dae21588  lighttpd-nagios.conf
06e4721acaa211f54a84022041b5fefbb6c31f5536bd97105946d5ea9dfc841169797940e272122f723d52fb85463c39d5ad342af5c901896278239295df3fa8  cgi-pairlist-truncation-fix.patch"