SUMMARY="Sorts files on FAT16/32 partitions"
DESCRIPTION="FATSort is a small utilitiy for Linux that sorts directory \
structures of FAT12, FAT16 and FAT32 file systems. It is written in C and \
can be run from the command line."
HOMEPAGE="http://fatsort.sourceforge.net/"
COPYRIGHT="2004-2014 Boris Leidner"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://sf.net/projects/fatsort/files/fatsort-1.3.365.tar.gz"
CHECKSUM_SHA256="77acc374b189e80e3d75d3508f3c0ca559f8030f1c220f7cfde719a4adb03f3d"
PATCHES="fatsort-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	fatsort$secondaryArchSuffix = $portVersion
	cmd:fatsort$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libiconv$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:help2man
	cmd:make
	"

BUILD()
{
	make LDFLAGS=-ltextencoding
}

INSTALL()
{
	mkdir -p $manDir/man1

	make install MANDIR=$manDir/man1 SBINDIR=$sbinDir
}
