SUMMARY="A collection of C functions implementing the http://oauth.net API"
DESCRIPTION="
liboauth provides functions to escape and encode stings according to \
OAuth specifications and offers high-level functionality built on top to sign \
requests or verify signatures using either NSS or OpenSSL for calculating \
the hash/signatures.
"
HOMEPAGE="http://liboauth.sourceforge.net"
COPYRIGHT="
	2007-2014 Robin Gareus
	"
LICENSE="
	GNU GPL v2
	MIT
	"
SOURCE_URI="http://downloads.sourceforge.net/project/liboauth/liboauth-$portVersion.tar.gz"
CHECKSUM_SHA256="0df60157b052f0e774ade8a8bac59d6e8d4b464058cc55f9208d72e41156811f"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="liboauth-$portVersion.patchset"

PROVIDES="
	liboauth$secondaryArchSuffix = $portVersion compat >= 1
	lib:liboauth$secondaryArchSuffix = 0.8.7 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcrypto$secondaryArchSuffix
	lib:libcurl$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libcrypto$secondaryArchSuffix
	devel:libcurl$secondaryArchSuffix
	devel:libssl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	
	rm $libDir/liboauth.la
	
	prepareInstalledDevelLibs liboauth
	fixPkgconfig

	# devel package
	packageEntries devel \
		$manDir/man3 \
		$developDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	liboauth${secondaryArchSuffix}_devel = $portVersion compat >= 1
	devel:liboauth$secondaryArchSuffix = 0.8.7 compat >= 0
	"
REQUIRES_devel="
	liboauth$secondaryArchSuffix == $portVersion base
	"
