SUMMARY="Secure RTP (SRTP) Reference Implementation"
DESCRIPTION="This package provides an implementation of the Secure Real-time \
Transport Protocol (SRTP), the Universal Security Transform (UST), and \
a supporting cryptographic kernel."
HOMEPAGE="https://github.com/cisco/libsrtp/"
COPYRIGHT="2001-2006 Cisco Systems, Inc."
LICENSE="BSD (3-clause)"
REVISION="2"
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="56a7b521c25134f48faff26b0b1e3d4378a14986a2d3d7bc6fefb48987304ff0"
PATCHES="libsrtp-$portVersion.patchset"

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

PROVIDES="
	libsrtp$secondaryArchSuffix = $portVersion
	lib:libsrtp$secondaryArchSuffix = 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libsrtp${secondaryArchSuffix}_devel = $portVersion
	devel:libsrtp$secondaryArchSuffix = 1
	"
REQUIRES_devel="
	libsrtp$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	# prepare development lib links
	prepareInstalledDevelLib libsrtp
	fixPkgconfig

	# devel package
	packageEntries devel $developDir
}
