summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 184966461e19977decf4138f39bd2c620267ec71 (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: Bao Trinh <qubidt at gmail dot com>

pkgname=rc-sircmpwn
pkgver=r233.2e5495e
pkgrel=1
pkgdesc="an experimental shell for Unix inspired by Plan 9's rc"
arch=('x86_64' 'aarch64' 'riscv64')
url="https://git.sr.ht/~sircmpwn/rc"
license=('GPL-3.0-or-later')
depends=()
makedepends=('git' 'hare' 'hare-madeline' 'scdoc')
provides=("rc")
conflicts=("rc")
_commit='2e5495ec7d82bf187f65ff1bbb8aadee4472ad15'
source=("${pkgname}::git+${url}#commit=${_commit}")
sha256sums=('d6ee6614d7ca39f603b588f3d553cf29c29fe850454309a82de23928a8b69507')

pkgver() {
	cd "${pkgname}"
	local commits hash
	commits=$(git rev-list --count HEAD)
	hash=$(git rev-parse --short=7 HEAD)
	printf "r%s.%s" "${commits}" "${hash}"
}

build() {
	cd "${pkgname}"
	make docs
	make rc
}

check() {
	cd "${pkgname}"
	hare test
	./run-tests
}

package() {
	cd "${pkgname}"
	make DESTDIR="${pkgdir}/" PREFIX=/usr install
	install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "COPYING"
	install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "README.md"
	install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" "doc/grammar.txt"
}