summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d81c52444be226b6d743f0d9c4851cd22911cf4f (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
# Maintainer: Christian Hesse <mail@eworm.de>

pkgname=libu2f-host-git
pkgver=1.1.3.r9.gc32e7a6
pkgrel=1
pkgdesc='Yubico Universal 2nd Factor (U2F) Host C Library - git checkout'
arch=('i686' 'x86_64')
url='https://github.com/Yubico/libu2f-host'
license=('BSD')
depends=('json-c' 'hidapi')
makedepends=('git' 'help2man' 'gtk-doc' 'gengetopt')
provides=('libu2f-host')
conflicts=('libu2f-host')
source=('git://github.com/Yubico/libu2f-host.git')
sha256sums=('SKIP')

pkgver() {
	cd libu2f-host/

	if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
		printf '%s.r%s.g%s' \
			"$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
			"$(git rev-list --count ${GITTAG}..)" \
			"$(git log -1 --format='%h')"
	else
		printf '0.r%s.g%s' \
			"$(git rev-list --count master)" \
			"$(git log -1 --format='%h')"
	fi
}

build() {
	cd libu2f-host/

	autoreconf -fi
	./configure \
		--prefix=/usr \
		--enable-gtk-doc \
		--with-udevrulesdir=/usr/lib/udev/rules.d/
	make
}


check() {
	cd libu2f-host/

	make check
}

package() {
	cd libu2f-host/

	make DESTDIR="${pkgdir}/" install

	install -D -m0644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}