summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5ae1438ddedbb5d62a7617ed1d79d223efb34d46 (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
# Maintainer: Sergey Shatunov <me@prok.pw>
pkgname=zram-generator-git
pkgver=1.1.0+7+ga3660dd
pkgrel=1
pkgdesc="Systemd unit generator for zram devices"
arch=("x86_64" "arm" "arv6h" "armv7h" "aarch64" "i686" "pentium4")
url="https://github.com/systemd/zram-generator"
provides=('zram-generator')
conflicts=('zram-generator')
license=('MIT')
depends=("systemd")
makedepends=('git' 'rust' 'ruby-ronn-ng')
install='zram-generator.install'
source=("${pkgname%-git}::git+https://github.com/systemd/zram-generator.git#branch=main"
        'half-memory.conf.example'
        'zram-generator.install')
sha256sums=('SKIP'
            '1aa3e7a47303c0b2dff6d74cc569c12e8009ed4642301db67fb389cb313141cf'
            '17f510e96f763d1c9aa8c0de757ad38dbe089465fb802e3c34682793f060bf77')

pkgver() {
	cd "$srcdir/${pkgname%-git}"

	printf "%s" "$(git describe --tags | sed 's/^v//;s/-/+/g')"
}

build() {
	cd "$srcdir/${pkgname%-git}"

	make CARGOFLAGS="--target-dir=target" build man
}

check() {
	cd "$srcdir/${pkgname%-git}"

	make CARGOFLAGS="--target-dir=target" check
}

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

	make CARGOFLAGS="--target-dir=target" DESTDIR="$pkgdir" install
	install -Dpm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dpm644 "$srcdir/half-memory.conf.example" "$pkgdir/usr/share/doc/zram-generator/half-memory.conf.example"
}