summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1843e7ed4e8836d3c5e3dfc98c6c45dd73526161 (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
pkgname=softu2f
pkgver=0.4.0.r3.g14a6ed0
pkgrel=1
pkgdesc="Software U2F HID token daemon (rust-u2f)"
arch=(x86_64)
depends=(libdbus libsystemd openssl)
optdepends=(
  # TODO: remove once systemd-udevd v244 (with fido_id) is out
  # NOTE: this cannot be a required dependency as long as it conflicts with libu2f-host
  "u2f-hidraw-policy: Automatically grant permissions to /dev/hidraw* (systemd <= v243)"
)
makedepends=(clang llvm rust)
_commit=14a6ed0ffb63a4c440d27edd5ffc132f6f3ee623
source=("git+https://github.com/danstiner/rust-u2f#commit=$_commit")
sha256sums=(SKIP)

pkgver() {
  cd rust-u2f
  git describe --tags | sed 's/^v//; s/-/.r/; s/-/./'
}

build() {
  cd rust-u2f/linux
  cargo build --release
}

package() {
  cd rust-u2f/linux

  install -Dm 755 target/release/softu2f-user-daemon \
                  "$pkgdir"/usr/libexec/softu2f/user-daemon

  install -Dm 755 target/release/softu2f-system-daemon \
                  "$pkgdir"/usr/libexec/softu2f/system-daemon

  install -Dm 644 user-daemon/softu2f.service \
                  "$pkgdir"/usr/lib/systemd/user/softu2f.service

  install -Dm 644 system-daemon/softu2f.service \
                  "$pkgdir"/usr/lib/systemd/system/softu2f.service

  install -Dm 644 system-daemon/softu2f.socket \
                  "$pkgdir"/usr/lib/systemd/system/softu2f.socket

  install -Dm 644 system-daemon/softu2f-tmpfiles.conf \
                  "$pkgdir"/usr/lib/tmpfiles.d/softu2f.conf
}

# vim: ts=2:sw=2:et