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

pkgname=yubico-c-git
pkgver=1.13.r2.g167cb06
pkgrel=1
pkgdesc='Yubico YubiKey C library - git checkout'
arch=('i686' 'x86_64')
url='https://github.com/Yubico/yubico-c'
license=('BSD')
depends=('curl' 'libusb')
provides=('libyubikey' 'yubico-c')
conflicts=('libyubikey' 'yubico-c')
makedepends=('git' 'asciidoc')
source=('git://github.com/Yubico/yubico-c.git')

pkgver() {
	cd yubico-c/

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

build() {
	cd yubico-c/

	autoreconf -fi
	./configure --prefix=/usr
	make
}

check() {
	cd yubico-c/

	make check
}

package() {
	cd yubico-c/

	install -D -m0644 COPYING "${pkgdir}/usr/share/licenses/yubico-c/COPYING"
	install -D -m0644 README "${pkgdir}/usr/share/doc/yubico-c/README"
	make DESTDIR="${pkgdir}/" install
}

sha256sums=('SKIP')