SUMMARY="An automated file management and sorting system"
DESCRIPTION="The Filer is a powerful, flexible automatic file organizer. It \
is an implementation of the 'Sorting Chute' idea conceived on the Glass \
Elevator mailing list for Haiku.

Filer takes the files it's opened with or that are dropped onto it's icon or \
replicatable dropzone and moves, renames, copies or does all sorts of other \
things with them according to rules created by the user.

Filer is accompanied by AutoFiler. Instead of working on a set of files \
provided by the user, it can be started together with Haiku to monitor certain \
folders and deal with new files appearing there according to the user-defined \
rules."
HOMEPAGE="https://github.com/HaikuArchives/Filer"
COPYRIGHT="2008 DarkWyrm
	2016 Humdinger, Pete Goodeve
	2017 Owen Pan
	2021 Jaidyn Levesque"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="e22e847347d4acc24679b87903b59b94e8221bab13be6927093de00131ab6bd8"
SOURCE_DIR="Filer-$portVersion"

ARCHITECTURES="all"

USER_SETTINGS_FILES="
	settings/Filer directory
	"

PROVIDES="
	filer = $portVersion
	app:AutoFiler = $portVersion
	app:Filer = $portVersion
	cmd:Filer = $portVersion
	"
REQUIRES="
	haiku
	cmd:zip
	lib:libsqlite3
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libsqlite3
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:g++
	cmd:make
	"

BUILD()
{
	cd sources
	make $jobArgs OBJ_DIR=objects
	make bindcatalogs OBJ_DIR=objects
	make -f Makefile_AutoFiler $jobArgs OBJ_DIR=objects
}

INSTALL()
{
	mkdir -p $appsDir/Filer $binDir
	cp -af documentation $appsDir/Filer

	cd sources
	cp -af objects/Filer $appsDir/Filer
	ln -s $appsDir/Filer/Filer $binDir

	cp -af objects/AutoFiler $appsDir/Filer

	addAppDeskbarSymlink $appsDir/Filer/Filer
}
