SUMMARY="Ham radio backend rig control library"
DESCRIPTION="The purpose of this project is to provide stable, flexible, shared \
libraries that enable quicker development of Amateur Radio Equipment Control \
Applications.
Many Amateur Radio Transceivers come with serial interfaces that allows \
software to control the radio. This project will endeavour to provide shared \
libraries that greatly simplify the application programmer''s interaction \
with radio equipment and other controllable devices such as rotators, \
switches, etc."
HOMEPAGE="https://hamlib.github.io/"
COPYRIGHT="2000 Frank Singleton
	2000-2011 Stephane Fillod
	2000-2012 The Hamlib Group"
LICENSE="GNU LGPL v2
	GNU GPL v2"
REVISION="1"
SOURCE_URI="https://sourceforge.net/projects/hamlib/files/hamlib/$portVersion/hamlib-$portVersion.tar.gz"
CHECKSUM_SHA256="8bf0107b071f52f08587f38e2dee8a7848de1343435b326f8f66d95e1f8a2487"
PATCHES="hamlib-$portVersion.patchset"

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

PROVIDES="
	hamlib$secondaryArchSuffix = $portVersion compat >= 4
	cmd:ampctl$secondaryArchSuffix
	cmd:ampctld$secondaryArchSuffix
	cmd:rigctl$secondaryArchSuffix
	cmd:rigctlcom$secondaryArchSuffix
	cmd:rigctld$secondaryArchSuffix
	cmd:rigmem$secondaryArchSuffix
	cmd:rigsmtr$secondaryArchSuffix
	cmd:rigswr$secondaryArchSuffix
	cmd:rigtestlibusb$secondaryArchSuffix
	cmd:rotctl$secondaryArchSuffix
	cmd:rotctld$secondaryArchSuffix
	lib:libhamlib$secondaryArchSuffix = 4.0.4 compat >= 4
	lib:libhamlib++$secondaryArchSuffix = 4.0.4 compat >= 4
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libreadline$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	"

PROVIDES_devel="
	hamlib${secondaryArchSuffix}_devel = $portVersion compat >= 4
	devel:libhamlib$secondaryArchSuffix = 4.0.4 compat >= 4
	devel:libhamlib++$secondaryArchSuffix = 4.0.4 compat >= 4
	"
REQUIRES_devel="
	hamlib$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libreadline$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:makeinfo
	"

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

INSTALL()
{
	make install

	rm $libDir/libhamlib*.la $libDir/libhamlib*.a

	prepareInstalledDevelLibs libhamlib++ libhamlib
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir \
		$dataDir
}
