SUMMARY="A C/C++ cmis client"
DESCRIPTION="Libcmis aims at providing a C/C++ client library for the CMIS \
protocol. A cmis-client tool is maintained to help testing and showing libcmis features."
HOMEPAGE="https://github.com/tdf/libcmis"
COPYRIGHT="2011-2014 Cedric Bosdonnat, SUSE
	2013 Cao Cuong Ngo"
LICENSE="GNU LGPL v2
	GNU GPL v2
	MPL v1.1"
REVISION="5"
SOURCE_URI="https://github.com/tdf/libcmis/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="07ff0baaac717a4702ef7c9c22dddb7d55d8b639ea526a765f947f2b683ef36a"
PATCHES="libcmis-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libcmis$secondaryArchSuffix = $portVersion
	cmd:cmis_client$secondaryArchSuffix = $portVersion
	lib:libcmis_0.5$secondaryArchSuffix = 5.0.0 compat >= 5
	lib:libcmis_c_0.5$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libboost_date_time$secondaryArchSuffix
	lib:libboost_program_options$secondaryArchSuffix
	lib:libcrypto$secondaryArchSuffix
	lib:libcurl$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	libcmis${secondaryArchSuffix}_devel = $portVersion
	devel:libcmis_0.5$secondaryArchSuffix = 5.0.0 compat >= 5
	devel:libcmis_c_0.5$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES_devel="
	libcmis$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libboost_date_time$secondaryArchSuffix >= 1.69.0
	devel:libboost_program_options$secondaryArchSuffix >= 1.69.0
	devel:libcrypto$secondaryArchSuffix
	devel:libcurl$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	devel:libssl$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure --without-man --disable-tests

	make $jobArgs
}

INSTALL()
{
	make install-strip

	rm -rf $libDir/*.la

	prepareInstalledDevelLibs libcmis-0.5 \
		libcmis-c-0.5
	fixPkgconfig

	packageEntries devel \
		$developDir
}
