summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: feab1174847fbf65766348087f14ea38763d194c (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Eric Engestrom <aur [at] engestrom [dot] ch>
# Maintainer: Kenny Levinsen <aur [at] kl [dot] wtf>

pkgname=greetd-git
pkgver=r177.ca39e915af
pkgrel=1
pkgdesc="Generic greeter daemon"
arch=(x86_64)
url="https://git.sr.ht/~kennylevinsen/greetd"
license=(GPL3)
source=("git+$url")
sha256sums=('SKIP')
conflicts=(greetd)
provides=(greetd)
depends=(systemd pam)
makedepends=(rust scdoc)
optdepends=(
  'greetd-gtkgreet: Simple GTK based greeter'
  'greetd-dlm: Dumb Login Manager'
  'greetd-wlgreet: Wayland greeter'
)
backup=(
  'etc/greetd/config.toml'
)

pkgver() {
  cd greetd
  printf 'r%d.%s' \
    $(git rev-list --count HEAD) \
    $(git rev-parse HEAD | head -c10)
}

build() {
  cd greetd
  RUSTFLAGS="--remap-path-prefix=$(pwd)=/build/" cargo build --release --locked
  cd man
  for i in *.scd
  do
    scdoc < "$i" > "${i::-4}".roff
  done
}

package() {
  install -d "$pkgdir"/usr/bin
  install -m755 greetd/target/release/greetd "$pkgdir"/usr/bin/
  install -m755 greetd/target/release/agreety "$pkgdir"/usr/bin/

  install -d "$pkgdir"/usr/share/man/man1
  for i in greetd/man/*-1.roff
  do
    install -m755 "$i" "$pkgdir"/usr/share/man/man1/"${i:11:-7}.1"
  done

  install -d "$pkgdir"/usr/share/man/man5
  for i in greetd/man/*-5.roff
  do
    install -m755 "$i" "$pkgdir"/usr/share/man/man5/"${i:11:-7}.5"
  done

  install -d "$pkgdir"/usr/share/man/man7
  for i in greetd/man/*-7.roff
  do
    install -m755 "$i" "$pkgdir"/usr/share/man/man7/"${i:11:-7}.7"
  done

  install -d "$pkgdir"/usr/lib/systemd/system
  install -m644 greetd/greetd.service "$pkgdir"/usr/lib/systemd/system/

  echo 'u greeter - "greetd greeter user" - /bin/bash' |
    install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/greetd.conf"

  install -d "$pkgdir"/etc/greetd
  install -m644 greetd/config.toml "$pkgdir"/etc/greetd/
}