SUMMARY="Yubico C client library"
DESCRIPTION="YubiKey C Client Library (libykclient) is a C library used \
to validate an Yubikey OTP against Yubico’s servers."
HOMEPAGE="https://developers.yubico.com/yubico-c-client/"
COPYRIGHT="2008-2015 Yubico AB"
LICENSE="BSD (2-clause)"
REVISION="3"
SOURCE_URI="https://developers.yubico.com/yubico-c-client/Releases/ykclient-$portVersion.tar.gz"
CHECKSUM_SHA256="f461cdefe7955d58bbd09d0eb7a15b36cb3576b88adbd68008f40ea978ea5016"

ARCHITECTURES="all ?x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	ykclient$secondaryArchSuffix = $portVersion
	cmd:ykclient$secondaryArchSuffix = $portVersion
	lib:libykclient$secondaryArchSuffix = 3.6.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcurl$secondaryArchSuffix
	"

PROVIDES_devel="
	ykclient${secondaryArchSuffix}_devel = $portVersion
	devel:libykclient$secondaryArchSuffix = 3.6.0 compat >= 0
	"
REQUIRES_devel="
	ykclient$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libcurl$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:grep
	cmd:help2man
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:sed
	"

BUILD()
{
	runConfigure ./configure --disable-dependency-tracking
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libykclient.la

	prepareInstalledDevelLib libykclient
	fixPkgconfig

	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $manDir
	fi

	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
