SUMMARY="AVR Downloader/UploaDEr"
DESCRIPTION="
AVRDUDE is an utility to download/upload/manipulate the ROM and EEPROM contents \
of AVR microcontrollers using the in-system programming technique (ISP).
"
HOMEPAGE="http://www.nongnu.org/avrdude/"
LICENSE="GNU GPL v2"
COPYRIGHT="2003-2013 Brian S. Dean <bsd@bdmicro.com>"
SOURCE_URI="http://download.savannah.gnu.org/releases/avrdude/avrdude-6.0.1.tar.gz"
CHECKSUM_SHA256="c6804668dfa96b23185dfe2e8239089af4e4ae0b11aa7435bebb28c3260ede41"
REVISION="2"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
PATCHES="avrdude-6.0.1.patch"

GLOBAL_WRITABLE_FILES="
	settings/avrdude.conf keep-old
	"

PROVIDES="
	avrdude$secondaryArchSuffix = $portVersion
	cmd:avrdude$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libusb_1.0$secondaryArchSuffix
	lib:libftdi1$secondaryArchSuffix
	lib:libelf$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libusb_1.0$secondaryArchSuffix
	devel:libftdi1$secondaryArchSuffix
	devel:libelf$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:automake
	cmd:autoconf
	cmd:make
	cmd:yacc
	cmd:flex
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	export PKG_CONFIG_LIBDIR=/system/develop/lib/x86/pkgconfig/
	aclocal
	autoconf
	automake
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
}
