summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 89be83b487e5190abf8666904e1255c4ea7fc757 (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
# Maintainer: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

pkgname=pdudaemon-git
pkgver=r168.1f34626
pkgrel=1
pkgdesc='Daemon for controlling PDUs (Power Distribution Units)'
arch=(any)
url="https://github.com/pdudaemon/pdudaemon"
license=('GPL2')
depends=('python' 'python-requests' 'python-pexpect'
         'python-systemd' 'python-paramiko' 'python-pyserial'
         'python-hidapi' 'python-pysnmp' 'python-pycryptodomex'
         'python-pyusb')
makedepends=('python-setuptools')
conflicts=('pdudaemon')
provides=('pdudaemon')
backup=('etc/pdudaemon/pdudaemon.conf')
source=('pdudaemon::git+https://github.com/pdudaemon/pdudaemon.git'
        'sysusers.d'
        'tmpfiles.d')
sha256sums=('SKIP'
            '889b97b347ae9b3d27f507ed9c40212e8e7e741d0ba5a5a36d28c2a5935e59c1'
            'fc725d7ffe871d08e53c36ec1495e602dc0e5595f94f0ecec6c097987c78b411')

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

build() {
  cd "${pkgname%-git}"
  python setup.py build
}

package() {
  cd "${pkgname%-git}"

  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build

  install -D -m755 "pduclient" "${pkgdir}/usr/bin/pduclient"
  install -D -m644 "share/pdudaemon.conf" "${pkgdir}/etc/pdudaemon/pdudaemon.conf"
  install -D -m644 "share/pdudaemon.service" "${pkgdir}/usr/lib/systemd/system/pdudaemon.service"
  install -D -m644 "${srcdir}/tmpfiles.d" "${pkgdir}/usr/lib/tmpfiles.d/pdudaemon.conf"
  install -D -m644 "${srcdir}/sysusers.d" "${pkgdir}/usr/lib/sysusers.d/pdudaemon.conf"

  sed "s/DynamicUser=yes/User=pdudaemon/" -i "${pkgdir}/usr/lib/systemd/system/pdudaemon.service"
}