summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0fe651a412b39ac95f71cb89fbc0ef4c04f2389c (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
# Maintainer: maximumadmin <mxmadm at protonmail dot com>

pkgname=zramd
pkgver=0.8.9
pkgrel=1
pkgdesc="Automatically setup swap on zram ✨"
arch=('any')
url="https://github.com/maximumadmin/zramd"
license=('MIT')
depends=('util-linux')
makedepends=('go')
optdepends=('earlyoom: userspace oom daemon')
conflicts=('systemd-swap'
           'zramswap'
           'zram-generator'
           'zram-generator-git')
backup=('etc/default/zramd')
source=("https://github.com/maximumadmin/$pkgname/archive/v$pkgver.tar.gz")
sha256sums=('2b91f02ae4e957d0cc49af8a31a1592a47fd310ce6779b8cad31cf85dadb594a')

build() {
  cd "$pkgname-$pkgver"
  local commit_date="${COMMIT_DATE:-$(date --iso-8601=seconds)}"
  GOPATH="${srcdir}/go" VERSION="$pkgver" COMMIT_DATE="$commit_date" make
}

check() {
  cd "$pkgname-$pkgver"
  GOPATH="${srcdir}/go" make test
}

package() {
  cd "$pkgname-$pkgver"
  PREFIX="$pkgdir" make install
}