SUMMARY="A buildfactory for yab programs"
DESCRIPTION="The buildfactory allows you to generate standalone programs."
HOMEPAGE="https://software.besly.de/"
COPYRIGHT="2006-2015 Jan Bungeroth
	2015-2017 Jim Saxton
	2020-2022 Lorenz (lorglas) BeSly Software Solutions"
LICENSE="Artistic"
REVISION="2"
SOURCE_URI="https://github.com/lorglas/yab_buildfactory/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="32f2bbc27a6ff32bf3110c3bc486263cf2eadd7bb4d37bb7f21e60fbf7104c36"
SOURCE_FILENAME="yab_buildfactory-$portVersion.tar.gz"
ADDITIONAL_FILES="yab_buildfactory.sh
	yab.hvif"

ARCHITECTURES="all !x86"
DISABLE_SOURCE_PACKAGE="YES"

POST_INSTALL_SCRIPTS="$relativePostInstallDir/yab_buildfactory.sh"

PROVIDES="
	yab_buildfactory = $portVersion
	app:yab_buildfactory = $portVersion
	"
REQUIRES="
	haiku
	yab
	devel:libz
	devel:yab
	"
#devel:libz is needed both to build and for the BuildFactory to do its work.

BUILD_REQUIRES=""
BUILD_PREREQUIRES=""

INSTALL()
{
	mkdir -p $appsDir/yab-buildfactory
	addattr -t icon -f $portDir/additional-files/yab.hvif "BEOS:ICON" "BeSly_Buildfactory.yab"
	cp -R * $appsDir/yab-buildfactory
	chmod 777 $appsDir/yab-buildfactory/BeSly_Buildfactory.yab
	chmod 777 $appsDir/yab-buildfactory/BuildFactory.yab
	mkdir -p $dataDir/
	DIR_YAB_DESKBAR="${dataDir}/deskbar/menu/Applications/yab"
	mkdir -p ${DIR_YAB_DESKBAR}
	addAppDeskbarSymlink ${appsDir}/yab-buildfactory/BeSly_Buildfactory.yab "yab/BeSly-Buildfactory"
	DIR_YAB_LOCALE="${dataDir}/locale/catalogs/"
	mkdir -p ${DIR_YAB_LOCALE}
	cp -R language/x-vnd.BeSly_Buildfactory ${DIR_YAB_LOCALE}
	mkdir -p $postInstallDir
	install -t $postInstallDir -m 755 $portDir/additional-files/yab_buildfactory.sh
}
