# Template file for 'lpsolve'
pkgname=lpsolve
version=5.5.2.11
revision=1
short_desc="Mixed Integer Linear Programming (MILP) solver"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL"
homepage="http://sourceforge.net/projects/lpsolve"
distfiles="${SOURCEFORGE_SITE}/$pkgname/lp_solve_${version}_source.tar.gz"
checksum=6d4abff5cc6aaa933ae8e6c17a226df0fc0b671c438f69715d41d09fe81f902f

do_configure() {
	sed -i \
		-e 's/^c=cc/c="$CC"/' \
		-e 's/dl=-ldl/dl="-ldl $LDFLAGS"/' \
		-e 's/^opts=.*/opts="$CFLAGS"/' \
		-e 's/^PLATFORM=.*/PLATFORM=/' \
		-e 's/-DNOISNAN//' \
	lp_solve/ccc lpsolve55/ccc
}

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

do_install() {
	vmkdir usr/bin
	vmkdir usr/lib
	vmkdir usr/include/lpsolve

	vbin lp_solve/bin/lp_solve
	vinstall lpsolve55/bin/liblpsolve55.so 755 usr/lib/
	vcopy lp*.h usr/include/lpsolve/
}

lpsolve-devel_package() {
	depends="lpsolve>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
	}
}
