summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16257cc12b3859384fac6e4df76dbb93a03e3f51 (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
# Maintainer: Jeremy Audet <jerebear@protonmail.com>

pkgname='killjoy-notifier-logfile-git'
pkgver=0 # see pkgver()
pkgrel=1
pkgdesc='Log unit state changes on behalf of killjoy'
arch=('x86_64')
url="https://github.com/Ichimonji10/${pkgname%-git}"
license=('GPL3')
depends=('dbus')
makedepends=('git' 'rust')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/Ichimonji10/${pkgname%-git}.git")
sha256sums=('SKIP')

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

build() {
  cd "${pkgname%-git}"
  cargo build --locked --release
}

check() {
  cd "${pkgname%-git}"
  cargo test --locked --release
}

package() {
  install -Dm755 \
    -t "${pkgdir}/usr/bin" \
    "${pkgname%-git}/target/release/${pkgname%-git}"

  install -Dm644 \
    -t "${pkgdir}/usr/lib/systemd/user" \
    "${pkgname%-git}/package/session/${pkgname%-git}.service"

  install -Dm644 \
    -t "${pkgdir}/usr/share/dbus-1/services" \
    "${pkgname%-git}/package/session/name.jerebear.KilljoyNotifierLogfile1.service"
}

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