summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2313fe532c82f77977b6d0f718a6c23e11c3bd5c (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
# Maintainer: Simon Ser <contact@emersion.fr>

pkgname=drmdb-git
_pkgname=drmdb
pkgver=r155.d11aeba82736
pkgrel=1
pkgdesc='A Direct Rendering Manager database'
arch=('x86_64')
url='https://gitlab.freedesktop.org/emersion/drmdb'
license=('MIT')
makedepends=('git' 'go')
provides=('drmdb')
conflicts=('drmdb')
source=(
	"git+https://gitlab.freedesktop.org/emersion/drmdb.git"
	"drmdb.sysusers"
	"drmdb.service"
	"drmdb.tmpfiles"
)
sha256sums=(
	'SKIP'
	'7a83da6b3ad691f2b89fd104166187bb47deaf80cb20488d92f55887d6be5ce6'
	'709fa0be5ac627cd124950bce2e435f24bd9aabc26805ef0d412d15c521adaa8'
	'1fdeccbb6e8ef835c5c8529c1b9becd53c97f8d837d473570e4ff737f610a6a2'
)

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

build() {
	cd "$srcdir/drmdb"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
	make PREFIX=/usr
}

package() {
	cd "$srcdir/drmdb"
	make PREFIX=/usr DESTDIR=$pkgdir install
	install -Dm644 "$srcdir/drmdb.sysusers" "$pkgdir/usr/lib/sysusers.d/drmdb.conf"
	install -Dm644 "$srcdir/drmdb.service" "$pkgdir/usr/lib/systemd/system/drmdb.service"
	install -Dm644 "$srcdir/drmdb.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/drmdb.conf"
}