summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c4a120e762fea75ff5d5be4023642b4f9b5bd6ef (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
# Maintainer: Yauheni Kirylau <actionless dot loveless AT gmail.com>
# shellcheck disable=SC2034,SC2154

_pkgname=nohang
pkgname=${_pkgname}-git
pkgver=r150.g83ac238
pkgrel=1
pkgdesc="A highly configurable OOM preventer"
arch=('any')
url="https://github.com/hakavlad/nohang"
license=('MIT')
source=(
	"$pkgname::git+https://github.com/hakavlad/nohang.git#branch=master"
)
md5sums=('SKIP')
depends=(
	'python'
	'libnotify'
	'sudo'
	'procps-ng'
)
optdepends=(
)
conflicts=("${_pkgname}")

pkgver() {
	cd "${srcdir}/${pkgname}" || exit 2
	set -o pipefail
	git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || \
		echo "r$(git log --oneline | wc -l).g$(git describe --always)"
}

package() {
	cd "${srcdir}/${pkgname}" || exit 2
	make DESTDIR=${pkgdir} install

	cd ${pkgdir}
	mv usr/sbin usr/bin
	mv lib usr/lib
}