# $Id: Portfile 102063 2013-01-26 21:00:07Z landonf@macports.org $

PortSystem          1.0

name                avarice
version             2.13
revision            1
categories          cross
license             GPL-2
maintainers         nomaintainer
description         AVR JTAG-ICE control software
long_description \
    AVaRICE is a program which interfaces the GNU Debugger \
    GDB with the AVR JTAG ICE available from Atmel.
platforms           darwin
homepage            http://avarice.sourceforge.net/
master_sites        sourceforge:project/avarice/avarice/avarice-${version}

use_bzip2           yes

checksums           rmd160  dbba18767365c5f8ef302380842f3a6a2fb06a7a \
                    sha256  a14738fe78e1a0a9321abcca7e685a00ce3ced207622ccbcd881ac32030c104a

depends_lib         port:gettext port:libusb-compat port:zlib \
                    port:avr-binutils

configure.args      --mandir=${prefix}/share/man \
                    --enable-target-programming
configure.ldflags-append    -lz \
                            -L${prefix}/avr/host/lib -lbfd -liberty

# PACKAGE/PACKAGE_VERSION are required to work around an
# #ifdef check added in recent versions of binutils. This broke
# a lot of software, assumes a very specific use of autotools, and
# is entirely gratitous, but the binutils guys aren't backing down.
#
# See also: http://sourceware.org/bugzilla/show_bug.cgi?id=14072
# and: http://sourceware.org/bugzilla/show_bug.cgi?id=14243
configure.cppflags-append -I${prefix}/avr/host/include \
                            "-DPACKAGE=${name}" "-DPACKAGE_VERSION=${version}"

livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
