SUMMARY="Converts Apple DMG files to standard HFS+ images"
DESCRIPTION="dmg2img is a command line tool for converting .dmg files, \
popular on Mac OS X systems, to HFS+ disk images.
A companion command-line tool, vfdecrypt, allows to decrypt encrypted Mac OS X \
disk image files (also known as filevault disk)."
HOMEPAGE="http://vu1tur.eu.org/tools/"
COPYRIGHT="2007-2009 Jean-Pierre Demailly (dmg2img)
	2017 Peter Wu (dmg2img)
	2009-2013 vu1tur (dmg2img)
	2006 Ralf-Philipp Weinmann, Jacob Appelbaum, Christian Fromme \
(vfdecrypt)"
LICENSE="GNU GPL v2"
REVISION="3"
SOURCE_URI="http://vu1tur.eu.org/tools/dmg2img-$portVersion.tar.gz"
CHECKSUM_SHA256="02aea6d05c5b810074913b954296ddffaa43497ed720ac0a671da4791ec4d018"
PATCHES="
	dmg2img-$portVersion.patchset
	dmg2img-$portVersion-openssl11.patch
	"

ARCHITECTURES="all"

PROVIDES="
	dmg2img = $portVersion
	cmd:dmg2img = $portVersion
	cmd:vfdecrypt = $portVersion
	"
REQUIRES="
	haiku
	lib:libbz2
	lib:libcrypto
	lib:libz
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libbz2
	devel:libcrypto
	devel:libz
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:ld
	cmd:make
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	install -d $binDir $docDir $manDir/man1
	install -t $binDir -s dmg2img vfdecrypt
	install -t $docDir -m a=r README
	install -t $manDir/man1 -m a=r vfdecrypt.1
}
