SUMMARY="Simple set of classes for developing HTTP server applications in Qt"
DESCRIPTION="The design goals of QHttpEngine include:

* Reliability - extremely exhaustive test suite ensures that bugs are caught \
as soon as they are introduced
* Flexibility - classes are designed for easy integration with existing Qt code
* Simplicity - everything is intentionally kept as simple as possible
* Usability - documentation is provided for all classes

All of QHttpEngine's functionality is included in a single monolithic library."
HOMEPAGE="https://github.com/nitroshare/qhttpengine/"
COPYRIGHT="2017 Nathan Osman"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="6505cf889909dc29bab4069116656e7ca5a9e879f04935139439c5691a76c55e"
SOURCE_FILENAME="qhttpengine-$portVersion.tar.gz"

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

libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	qhttpengine$secondaryArchSuffix = $portVersion
	lib:libqhttpengine$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	"

PROVIDES_devel="
	qhttpengine${secondaryArchSuffix}_devel = $portVersion
	devel:libqhttpengine$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	qhttpengine$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Network$secondaryArchSuffix
	devel:libQt5Test$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage qhttpengine$secondaryArchSuffix \
	"$libDir"/libqhttpengine.so.$libVersion

BUILD()
{
	cmake . \
		-DBIN_INSTALL_DIR=$prefix \
		-DLIB_INSTALL_DIR=$relativeLibDir \
		-DINCLUDE_INSTALL_DIR=$relativeIncludeDir \
		-DBUILD_TESTS=ON \
		$cmakeDirArgs
	make $jobArgs
}

INSTALL()
{
	make install

	# prepare develop/lib
	prepareInstalledDevelLibs libqhttpengine
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir \
		$libDir/cmake
}

TEST()
{
	make tests
}
