SUMMARY="C++ libraries for multimedia streaming"
DESCRIPTION="live555 forms a set of C++ libraries for multimedia streaming \
using open standard protocols. The library can be used to build streaming \
applications using various audio and video codecs."
HOMEPAGE="http://www.live555.com/liveMedia/"
COPYRIGHT="Live Networks, Inc."
LICENSE="GNU LGPL v2.1"
REVISION="3"
SOURCE_URI="https://github.com/xanview/live555/archive/d9e97d7953d531a243a8372870bdb6c7a9bb80cb.tar.gz"
CHECKSUM_SHA256="c6cb4a6ad32a329b95cc16fa97b6c3ac43c70ac27c97bf1b2f56dc4a474759d7"
SOURCE_DIR="live555-d9e97d7953d531a243a8372870bdb6c7a9bb80cb"
PATCHES="live555-2016.01.29.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	live555$secondaryArchSuffix = $portVersion
	cmd:live555MediaServer
	cmd:live555ProxyServer
	cmd:MPEG2TransportStreamIndexer
	cmd:openRTSP
	cmd:playSIP
	cmd:registerRTSPStream
	cmd:sapWatch
	cmd:testAMRAudioStreamer
	cmd:testDVVideoStreamer
	cmd:testH264VideoStreamer
	cmd:testH264VideoToTransportStream
	cmd:testH265VideoStreamer
	cmd:testH265VideoToTransportStream
	cmd:testMKVStreamer
	cmd:testMP3Receiver
	cmd:testMP3Streamer
	cmd:testMPEG1or2AudioVideoStreamer
	cmd:testMPEG1or2ProgramToTransportStream
	cmd:testMPEG1or2Splitter
	cmd:testMPEG1or2VideoReceiver
	cmd:testMPEG1or2VideoStreamer
	cmd:testMPEG2TransportReceiver
	cmd:testMPEG2TransportStreamer
	cmd:testMPEG2TransportStreamTrickPlay
	cmd:testMPEG4VideoStreamer
	cmd:testOggStreamer
	cmd:testOnDemandRTSPServer
	cmd:testRelay
	cmd:testReplicator
	cmd:testRTSPClient
	cmd:testWAVAudioStreamer
	cmd:vobStreamer
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	live555${secondaryArchSuffix}_devel = $portVersion
	devel:libBasicUsageEnvironment$secondaryArchSuffix = $portVersion
	devel:libgroupsock$secondaryArchSuffix = $portVersion
	devel:libliveMedia$secondaryArchSuffix = $portVersion
	devel:libUsageEnvironment$secondaryArchSuffix = $portVersion
	devel:live555$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	live555$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:ar
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	./genMakefiles haiku
	make $jobArgs
}

INSTALL()
{
	make install PREFIX=$prefix INSTALLDIR=$prefix/bin LIBDIR=$developLibDir \
		MANDIR=$manDir/man1 BINDIR=$binDir DESTDIR=${DESTDIR}

	mkdir -p $includeDir

	# fixes hardcoded paths in makefile
	mv $prefix/include/* $includeDir
	rm $prefix/include -r

	# No need to call prepareInstalledDevelLibs

	# devel package
	packageEntries devel $developDir
}
