SUMMARY="The previous generation graphical download manager"
DESCRIPTION="yoDownet is an open-source && free graphical download manager
project that tries to be simple and minimal.

Basic features:
- Increases download speeds (It just does!);
- Concurrent file downoading;
- Safe Pause/Resume On Files;
- Multilingual."
HOMEPAGE="https://sourceforge.net/projects/yodownet/"
COPYRIGHT="2012-2014 Alir3z4"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/Alir3z4/yoDownet/archive/$portVersion.tar.gz"
SOURCE_DIR="yoDownet-$portVersion"
CHECKSUM_SHA256="ebe872bdb0a076968bf2d5078966513e035e05c80c140cc1e2cdf980bbf87b2f"
PATCHES="yodownet-$portVersion.patchset"
ADDITIONAL_FILES="
	yodownet.rdef.in"

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

PROVIDES="
	yodownet$secondaryArchSuffix=$portVersion
	app:yoDownet=$portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"

BUILD_PREREQUIRES="
	cmd:make
	cmd:qmake$secondaryArchSuffix >= 5
	cmd:sed
	"

BUILD()
{
	qmake -config release
	make
}

INSTALL()
{
	make install
	mkdir -p $appsDir
	cp yoDownet $appsDir/yoDownet

	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
	local MINOR="`echo "$portVersion" | cut -d. -f3`"
	sed \
		-e "s|@MAJOR@|$MAJOR|" \
		-e "s|@MIDDLE@|$MIDDLE|" \
		-e "s|@MINOR@|$MINOR|" \
		$portDir/additional-files/yodownet.rdef.in > yodownet.rdef

	addResourcesToBinaries yodownet.rdef \
		$appsDir/yoDownet

	addAppDeskbarSymlink $appsDir/yoDownet
}
