aboutsummaryrefslogtreecommitdiffstats
path: root/testing/pnp4nagios/APKBUILD
blob: f08d322e08ccbd3b2046fd1f39da34016cbd1172 (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
74
75
76
# Contributor: Peter de Zoeten <peter@dezoeten.mine.nu>
# Maintainer:  Peter de Zoeten <peter@dezoeten.mine.nu>
pkgname=pnp4nagios
pkgver=0.6.15
pkgrel=0
pkgdesc="PNP4Nagios"
url="http://www.pnp4nagios.org"
arch="all"
license="GPL"
depends="nagios perl-time-hires perl-rrd php-zlib"
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://sourceforge.net/projects/pnp4nagios/files/PNP-0.6/pnp4nagios-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
       local i
       cd "$_builddir"
       for i in $source; do
               case $i in
               *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
               esac
       done
}

build() {
       cd "$_builddir"
       ./configure --prefix=/usr/share/webapps/pnp4nagios \
       		--exec-prefix=/usr \
       		--libexecdir=/usr/lib/pnp4nagios \
       		--sysconfdir=/etc/pnp4nagios \
		--mandir=/usr/share/man \
       		--infodir=/usr/share/info \
       		--localstatedir=/var/run \
       		--datarootdir=/usr/share/webapps/pnp4nagios \
       		--with-perfdata-logfile=/var/pnp4nagios/perfdata/process_perfdata.pl \
       		--with-perfdata-dir=/var/pnp4nagios/perfdata \
       		--with-perfdata-spool-dir=/var/pnp4nagios/perfdata/spool \
       		|| return 1
       make all || return 1
}
doc() {
        arch="noarch"
        # Man pages
        mkdir -p "$subpkgdir"/usr/share/man || return 1
        mv "$pkgdir"/usr/share/webapps/pnp4nagios/man/man* "$subpkgdir"/usr/share/man/ \
        || return 1

        # Doc files
        _docs="INSTALL README"
        for _doc in $_docs; do
                install -Dm644 "$srcdir"/$pkgname-$pkgver/$_doc \
	        "$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
        done
	rmdir "$pkgdir"/usr/share/webapps/pnp4nagios/man
}

package() {
       cd "$_builddir"
       make fullinstall DESTDIR="$pkgdir" || return 1
       mkdir -p "$pkgdir"/usr/share/nagios/htdocs/ssi
       rm -f "$pkgdir"/usr/lib/*.la
       cp "$_builddir"/contrib/ssi/status-header.ssi "$pkgdir"/usr/share/nagios/htdocs/ssi/status-header.ssi
#       rm -rf "$pkgdir"/etc/httpd
       mkdir -p "$pkgdir"/etc/lighttpd
       cp "$_builddir"/sample-config/lighttpd.pnp4nagios.conf "$pkgdir"/etc/lighttpd/pnp4nagios.conf.sample
       install -D -m644 ../../npcd.cfg "$pkgdir"/etc/pnp4nagios/npcd.cfg
       rm -f "$pkgdir"/etc/init.d/npcd
       install -D -m755 ../../npcd "$pkgdir"/etc/init.d/npcd
       chown nagios.nagios "$pkgdir"/var/pnp4nagios
}


md5sums="27cdab96510e15cfa0f4b7c2bf15dd2b  pnp4nagios-0.6.15.tar.gz"