summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 302ec1914485ed9e98b0cf9d5ee2b0e89a7a0fc1 (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
# Maintainer: Kloenk <kloenk@kloenk.de>
pkgname=phrased-git
pkgver=v0.1.1.r13.4b68f7e
pkgrel=1
pkgdesc="Generate awesome passphrases from a set of dictionaries."
arch=('x86_64' 'i686')
url="https://phrased.org/"
license=('GPL')
groups=()
depends=()
makedepends=('git' 'go') # 'bzr', 'git', 'mercurial' or 'subversion'
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
source=('phrased::git+https://github.com/phrased-org/phrased.git')
noextract=()
md5sums=('SKIP')

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

# Git, tags available
	printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"

# Git, no tags available
#	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"

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

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

package() {
	cd "$srcdir/${pkgname%-git}"
	if [[ $arch == 'x86_64' ]]; then
		install -Dm0755 dist/linux_amd64/phrased $pkgdir/usr/bin/phrased
	elif [[ $arch == 'i686' ]]; then
		install -Dm0755 dist/linux_386/phrased $pkgdir/usr/bin/phrased
	fi
	
	install -Dm0644 README.md $pkgdir/usr/share/doc/${pkgname%-git}/README.md
}