summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f0a556a38fc27ecbc591479ab6f9ec02298ffe3e (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
# Maintainer: Christopher Kreft <email@christopherkreft.de>

pkgname=check-nwc-health-git
pkgver=12.10.1.r0.g52ca174
pkgrel=1
pkgdesc="Monitoring plugin for various network equipment (git version)"
arch=('any')
url='https://labs.consol.de/nagios/check_nwc_health/'
license=('GPL-2.0-only')
depends=('perl' 'perl-json' 'perl-json-xs' 'perl-file-slurp')
makedepends=('git' 'autoconf' 'automake')
optdepends=('perl-net-snmp: checks based on SNMP'
            'perl-soap-lite: checks based on UPnP'
            'perl-xml-libxml: checks based on UPnP'
            'perl-xml-treebuilder: FritzBox checks')
provides=('check-nwc-health')
conflicts=('check-nwc-health')
source=("${pkgname}::git+https://github.com/lausser/check_nwc_health.git"
        "GLPlugin::git+https://github.com/lausser/GLPlugin.git")
sha256sums=('SKIP' 'SKIP')

pkgver() {
  cd "$pkgname"
  git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$pkgname"

  git config submodule.GLPlugin.url "$srcdir/GLPlugin"
  git -c protocol.file.allow=always submodule update --init

  autoreconf
}

build() {
  cd "$srcdir/GLPlugin"

  perl Makefile.PL INSTALLDIRS=vendor
  make

  cd "$srcdir/$pkgname"
  ./configure --prefix=/usr --libexecdir=/usr/lib/monitoring-plugins --disable-standalone
  make
}

check() {
  cd "$srcdir/GLPlugin"
  make test

  cd "$srcdir/$pkgname"
  export PERL5LIB="$srcdir/GLPlugin/blib/lib:$srcdir/GLPlugin/blib/arch:$PERL5LIB"
  ./plugins-scripts/check_nwc_health --help > /dev/null
}

package() {
  cd "$srcdir/GLPlugin"
  make DESTDIR="$pkgdir" install

  cd "$srcdir/$pkgname"
  make DESTDIR="$pkgdir" install
}