# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=stoken
pkgver=0.92
pkgrel=0
pkgdesc="RSA SecurID-compatible software token for Linux/UNIX systems"
url="http://stoken.sf.net"
arch="all"
license="LGPL-2.1-or-later"
makedepends="autoconf automake libtool libxml2-dev nettle-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cernekee/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"
	./autogen.sh
}

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--datadir=/usr/share \
		--disable-static
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR=$pkgdir install
}

dev(){
	default_dev
	cd "$builddir"
	rm "$subpkgdir"/usr/share/doc/stoken/*
	rmdir "$subpkgdir"/usr/share/doc/stoken
	rmdir "$subpkgdir"/usr/share/doc
}

sha512sums="b41262320c24e487ece884fc431d835c787f057947a92e3d57ed2047bc02b576b072e8a69f4b58b47ab1f913b5ae8c3ee8108d3b55c1477f15848420b668fea3  stoken-0.92.tar.gz"
