SUMMARY="The GNU Readline library"
DESCRIPTION="
The GNU Readline library provides a set of functions for use by applications \
that allow users to edit command lines as they are typed in. Both Emacs and vi \
editing modes are available. The Readline library includes additional \
functions to maintain a list of previously-entered command lines, to recall \
and perhaps reedit those lines, and perform csh-like history expansion on \
previous commands.
The history facilites are also placed into a separate library, the History \
library, as part of the build process. The History library may be used without \
Readline in applications which desire its capabilities.
"
HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
COPYRIGHT="1989-2011 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
SRC_URI="ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz"
CHECKSUM_SHA256="79a696070a058c233c72dd6ac697021cc64abd5ed51e59db867d66d196a89381"
REVISION="5"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="readline-6.2.patch"

PROVIDES="
	readline$secondaryArchSuffix = $portVersion compat >= 6
	lib:libhistory$secondaryArchSuffix = $portVersion compat >= 6
	lib:libreadline$secondaryArchSuffix = $portVersion compat >= 6
	"
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libncurses$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libncurses$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"


BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	runConfigure ./configure \
		--with-curses
	make $jobArgs SHLIB_LIBS=-lncurses
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libhistory libreadline
	rmdir $binDir

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

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	readline${secondaryArchSuffix}_devel = $portVersion
	devel:libhistory$secondaryArchSuffix = $portVersion compat >= 6
	devel:libreadline$secondaryArchSuffix = $portVersion compat >= 6
	"
REQUIRES_devel="
	readline$secondaryArchSuffix == $portVersion base
	"
