SUMMARY="A Mixed Integer Linear Programming (MILP) solver library"
DESCRIPTION="It is a free (see LGPL for the GNU lesser general public license)\
 linear (integer) programming solver based on the revised simplex method \
and the Branch-and-bound method for the integers.
lp_solve solves pure linear, (mixed) integer/binary, semi-continuous and \
special ordered sets (SOS) models."
HOMEPAGE="https://sourceforge.net/projects/lpsolve/"
COPYRIGHT="2006-2016 Michael Berkelaar, Kjell Eikland, Peter Notebaert"
LICENSE="GNU LGPL v2.1"
REVISION="3"
SOURCE_URI="http://downloads.sourceforge.net/lpsolve/lpsolve/$portVersion/lp_solve_${portVersion}_source.tar.gz"
CHECKSUM_SHA256="201a7c62b8b3360c884ee2a73ed7667e5716fc1e809755053b398c2f5b0cf28a"
SOURCE_DIR="lp_solve_5.5"
PATCHES="lpsolve-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	lpsolve$secondaryArchSuffix = $portVersion
	cmd:lp_solve$secondaryArchSuffix
	lib:liblpsolve55$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	lpsolve${secondaryArchSuffix}_devel = $portVersion
	devel:liblpsolve55$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	lpsolve$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:sed
	"

BUILD()
{
	cd lpsolve55
	sh -x ccc
	cd ../lp_solve
	sh -x ccc
}

INSTALL()
{
	mkdir -p $binDir $libDir $includeDir/lpsolve
	install lp_solve/bin/ux*/lp_solve $binDir/
	install lpsolve55/bin/ux*/liblpsolve55.so $libDir/
	install lp*.h $includeDir/lpsolve/

	prepareInstalledDevelLibs liblpsolve55

	# devel package
	packageEntries devel \
		$developDir
}
