summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d80b6e85221fc07a348998660025de538903ce82 (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
# Maintainer: David Parrish <daveparrish@tutanota.com>

pkgname=check_zfs-git
pkgver=r62.e3cf94c
pkgrel=1
pkgdesc="Nagios-Plugin to check the status of a ZFS pool."
arch=('i686' 'x86_64')
url="https://github.com/zlacelle/nagios_check_zfs_linux"
license=('GPL3')
makedepends=('git')
depends=('python')
source=("${pkgname}::git+https://github.com/zlacelle/nagios_check_zfs_linux.git")
sha256sums=("SKIP")

pkgver() {
  cd "$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$pkgname"
  msg 'Fixing Python version...'
  find . -type f -print0 | xargs -0 sed -i 's#/usr/bin/python$#/usr/bin/python2#g'
}

package() {
  # Install License
  install -Dm644 "$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # Put code files into '/usr/share'
  install -Dm755 "$pkgname/check_zfs.py" "$pkgdir/usr/share/check_zfs/check_zfs.py"

  # Install binary
  install -d "${pkgdir}/usr/bin"
  ln -s "/usr/share/check_zfs/check_zfs.py" "${pkgdir}/usr/bin/check_zfs"
}