SUMMARY="Library for Support Vector Machines"
DESCRIPTION="
Libsvm is a simple, easy-to-use, and efficient software for SVM \
classification and regression. It solves C-SVM classification, nu-SVM \
classification, one-class-SVM, epsilon-SVM regression, and nu-SVM \
regression. It also provides an automatic model selection tool for \
C-SVM classification."
HOMEPAGE="https://www.csie.ntu.edu.tw/~cjlin/libsvm/"
COPYRIGHT="2000-2018 Chih-Chung Chang and Chih-Jen Lin"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/cjlin1/libsvm/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="7a466f90f327a98f8ed1cb217570547bcb00077933d1619f3cb9e73518f38196"
SOURCE_FILENAME="libsvm-$portVersion.tar.gz"
SOURCE_DIR="libsvm-323"

ARCHITECTURES="all"

PROVIDES="
	libsvm = $portVersion
	lib:libsvm
	"
REQUIRES="
	haiku
	"

PROVIDES_devel="
	libsvm_devel = $portVersion
	devel:libsvm
	"
REQUIRES_devel="
	libsvm == $portVersion base
	"

PROVIDES_tools="
	libsvm_tools = $portVersion
	cmd:svm_checkdata
	cmd:svm_easy
	cmd:svm_grid
	cmd:svm_predict
	cmd:svm_scale
	cmd:svm_subset
	cmd:svm_train
	"
REQUIRES_tools="
	haiku
	cmd:python
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	haiku
	cmd:g++
	cmd:gcc
	cmd:make
	cmd:sed
	"

BUILD()
{
	make lib $jobArgs
	make $jobArgs
}

INSTALL()
{
	mkdir -p $binDir
	mkdir -p $libDir
	mkdir -p $includeDir

	cp svm-train			$binDir/svm-train
	cp svm-predict			$binDir/svm-predict
	cp svm-scale			$binDir/svm-scale
	cp tools/checkdata.py	$binDir/svm-checkdata
	cp tools/subset.py		$binDir/svm-subset
	cp tools/easy.py		$binDir/svm-easy
	cp tools/grid.py		$binDir/svm-grid
	packageEntries tools $binDir

	cp libsvm.so.2 $libDir
	cp svm.h $includeDir
	prepareInstalledDevelLibs libsvm
	packageEntries devel $developDir
}
