SUMMARY="Ultra fast grep with interactive query UI"
DESCRIPTION="NEW ultra fast grep with interactive query UI: \
search file systems, source code, text, binary files, \
archives (cpio/tar/pax/zip), compressed files (gz/Z/bz2/lzma/xz/lz4), \
documents, fuzzy search, and more. \
A faster, user-friendly replacement for GNU/BSD grep."
HOMEPAGE="https://github.com/Genivia/ugrep/wiki"
COPYRIGHT="2019-2020 Robert van Engelen, Genivia Inc."
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/Genivia/ugrep/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="83f2017ba05f7ce7ded74097832df071d2be89d41b357f45c4dce801c2a0cae6"

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

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	$portName = $portVersion
	cmd:ugrep = $portVersion
	cmd:ug = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	lib:liblz4$secondaryArchSuffix
	lib:liblzma$secondaryArchSuffix
	lib:libpcre2_8$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libbz2$secondaryArchSuffix
	devel:liblz4$secondaryArchSuffix
	devel:liblzma$secondaryArchSuffix
	devel:libpcre2_8$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:ar
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autoreconf -fi
	runConfigure --omit-dirs binDir ./configure --bindir="$commandBinDir"
	make $jobArgs
}

INSTALL()
{
	make install
}

TEST()
{
	make test
}
