SUMMARY="A library for number to number name conversion"
DESCRIPTION="Numbertext can convert numbers to their names, including cardinal \
and ordinal numbers, ordinal indicators and money amounts with currencies in \
more than 40 languages and numeral systems."
HOMEPAGE="https://numbertext.org/"
COPYRIGHT="2009–2020 László Németh et al."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/Numbertext/libnumbertext/archive/$portVersion.tar.gz"
SOURCE_FILENAME="libnumbertext-$portVersion.tar.gz"
CHECKSUM_SHA256="d03860c98ec01bc52a2a65f04b1fc4c7e7823c76d54dec800ca32ab2196023bc"
PATCHES="libnumbertext-$portVersion.patchset"

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

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

PROVIDES="
	libnumbertext$secondaryArchSuffix = $portVersion
	cmd:spellout = $portVersion
	lib:libnumbertext_1.0$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libnumbertext${secondaryArchSuffix}_devel = $portVersion
	devel:libnumbertext_1.0$secondaryArchSuffix = $libVersion
	"
REQUIRES_devel="
	libnumbertext$secondaryArchSuffix == $portVersion base
	"

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

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

INSTALL()
{
	make install

	rm $libDir/libnumbertext-1.0.a $libDir/libnumbertext-1.0.la

	prepareInstalledDevelLibs \
		libnumbertext-1.0
	fixPkgconfig

	packageEntries devel \
		$developDir
}

TEST()
{
	make -k check
}
