aboutsummaryrefslogtreecommitdiffstats
path: root/testing/stgit/APKBUILD
blob: b9310fdb1e160bad4bf8f94dd41e9888a7bf9255 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Contributor: Joseph Benden <joe@benden.us>
# Maintainer: Joseph Benden <joe@benden.us>
pkgname=stgit
pkgver=0.22
pkgrel=0
pkgdesc="Manage a stack of patches using GIT as a backend"
arch="noarch"
url="http://www.procode.org/stgit/"
license="GPL-2.0-or-later"
options="!check" # unit-tests fail due to iconv usage
depends="git python3"
makedepends="asciidoc xmlto perl"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/ctmarinas/stgit/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	# this will be a noop, as we are working with a tarball,
	# but throws git errors --> just get rid of it
	echo "version=\"$pkgver\"" > stgit/builtin_version.py
}

check() {
	make \
		PYTHON=python3 \
		prefix=/usr \
		mandir=/usr/share/man/ \
			test
}

build() {
	make \
		PYTHON=python3 \
		prefix=/usr \
		mandir=/usr/share/man/ \
			all doc
}

package() {
	make \
		DESTDIR="$pkgdir" \
		PYTHON=python3 \
		prefix=/usr \
		mandir=/usr/share/man/ \
			install install-doc
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
	mv "$pkgdir"/usr/share/stgit/completion/stgit.bash \
		"$subpkgdir"/usr/share/bash-completion/completions/stgit
	rmdir -p "$pkgdir"/usr/share/stgit/completion || true
}

zshcomp() {
	depends=""
	pkgdesc="Zsh compltions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions
	mv "$pkgdir"/usr/share/stgit/completion/stgit.zsh \
		"$subpkgdir"/usr/share/zsh/site-functions/_stgit
	rmdir -p "$pkgdir"/usr/share/stgit/completions || true
}

fishcomp() {
	depends=""
	pkgdesc="Fish completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	mkdir -p "$subpkgdir"/usr/share/fish/completions
	mv "$pkgdir"/usr/share/stgit/completion/stg.fish \
		"$subpkgdir"/usr/share/fish/completions/stg.fish
	rmdir -p "$pkgdir"/usr/share/stgit/completions || true
}

sha512sums="bfef074b952e01d9041a4ed5dfc6786c29ebb4b09a424ca09e9131ad21c418c4d79ec13eb908f5e8b015ebbc709aacb13824a1c9cad6d97e018a166b014c5e6f  stgit-0.22.tar.gz"