SUMMARY="libusb 0.1 API wrapper for libusb"
DESCRIPTION="
libusb is a C library that provides generic access to USB devices. \
It is intended to be used by developers to facilitate the production \
of applications that communicate with USB hardware.

libusb-compat is a wrapper library for software that use the 0.1 API.
"
LICENSE="GNU LGPL v2"
COPYRIGHT="
2008 Daniel Drake
"
HOMEPAGE="http://libusb.info/"
SOURCE_URI="http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/libusb-compat-0.1.5/libusb-compat-0.1.5.tar.bz2"
CHECKSUM_SHA256="404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a"
REVISION="2"
ARCHITECTURES="x86 x86_64 x86_gcc2"
SECONDARY_ARCHITECTURES="!x86"

PROVIDES="
	libusb_compat$secondaryArchSuffix = $portVersion
	lib:libusb_0.1$secondaryArchSuffix = $portVersion
	lib:libusb$secondaryArchSuffix = $portVersion
	cmd:libusb_config$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	lib:libusb_1.0$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libusb_1.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:autoconf
	cmd:automake
	cmd:libtool
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:sed
	"
SOURCE_DIR=libusb-compat-$portVersion

PATCHES="libusb_compat-0.1.5.patchset"

BUILD()
{
	#sh bootstrap.sh
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	# set up the develop directory correctly
	prepareInstalledDevelLibs libusb-0.1 libusb
	fixPkgconfig libusb-0.1

	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	libusb_compat${secondaryArchSuffix}_devel = $portVersion
	devel:libusb_0.1${secondaryArchSuffix} = $portVersion
	devel:libusb$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	libusb_compat${secondaryArchSuffix} == $portVersion base
	"
