summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e624e5eb75c1d79833742d1a435c330e1d6e76e3 (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
# Maintainer: Julian Brost <julian@0x4a42.net>
# Maintainer: Christopher Kreft <email@christopherkreft.de>

pkgname=check-nwc-health
pkgver=12.11
pkgrel=1
pkgdesc="Monitoring check for various network equipment"
arch=('any')
url='https://labs.consol.de/nagios/check_nwc_health/'
license=('GPL-2.0-only' 'Artistic-2.0')
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')
conflicts=('check-nwc-health-git')
source=("${pkgname}::git+https://github.com/lausser/check_nwc_health.git#tag=${pkgver}"
        "GLPlugin::git+https://github.com/lausser/GLPlugin.git")
sha256sums=('de399ddb4a9a58ef169057e9152b043690781454418c053d3b2717430944eac7'
            'SKIP')
# GLPlugin is pinned via the superproject tag's submodule commit; checksums for the
# superproject verify that exact commit, so a separate checksum here is redundant.

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
}