SUMMARY="LibDSK is a library for manipulating disk image files"
HOMEPAGE="http://www.seasip.demon.co.uk/Unix/LibDsk/"
SRC_URI="http://www.seasip.info/Unix/LibDsk/libdsk-1.3.3.tar.gz"
CHECKSUM_SHA256="a9186b167934ce5b847f74d2389b6c37084761ea255501dab481051336353606"
REVISION="2"
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"

PROVIDES="
	libdsk$secondaryArchSuffix = $portVersion
	lib:libdsk$secondaryArchSuffix = $portVersion
	"


if [ -z "$secondaryArchSuffix" ]; then
PROVIDES="$PROVIDES
	cmd:apriboot
	cmd:dskdump
	cmd:dskform
	cmd:dskid
	cmd:dskscan
	cmd:dsktrans
	cmd:dskutil
	cmd:md3serial
	"
fi

PROVIDES_devel="
	devel:libdsk$secondaryArchSuffix = $portVersion
"

REQUIRES_devel="
	libdsk$secondaryArchSuffix == $portVersion base
"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libz$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	haiku_devel >= $haikuVersion
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:libtoolize
	cmd:autoconf
	cmd:make
	cmd:gcc$secondaryArchSuffix
	"

BUILD()
{
	# Need to update the libtools in the package to build shared libraries
	libtoolize --install --copy --force
	autoconf
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	# remove command for secondary architecture
	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $binDir
	fi

	prepareInstalledDevelLib libdsk

	packageEntries devel $developDir
}

COPYRIGHT="2010 John Elliott"
LICENSE="GNU GPL v2"
DESCRIPTION="
LIBDSK is a library for accessing discs and disc image files. It is intended \
for use in:
* Emulator tools - converting between real floppy discs and disc images, as \
CPCTRANS / PCWTRANS do under DOS.
* Filesystem utilities - CPMTOOLS is configurable to use LIBDSK, thus allowing \
the use of CPMTOOLS on emulator .DSK images. To do this, install LIBDSK and \
then build CPMTOOLS, using \"./configure --with-libdsk\". For CPMTOOLS 1.9 or \
2.0, you will also need to apply this patch.
* Emulators - it is possible to use LIBDSK as part of an emulator's floppy \
controller emulation, thus giving the emulator transparent access to .DSK \
files or real discs.
"
