# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                autoconf
epoch               1
version             2.69
revision            5
categories          devel
# the license is GPL-3+ with an exception:
# http://www.gnu.org/licenses/autoconf-exception.html
platforms           darwin
supported_archs     noarch
license             {Autoconf GPL-3+}
maintainers         larryv

description         Automatically configures software for compilation
long_description    Autoconf is an extensible package of m4 macros \
                    that produce shell scripts to automatically \
                    configure software source code packages. These \
                    scripts can adapt the packages to many kinds of \
                    UNIX-like systems without manual user \
                    intervention. Autoconf creates a configuration \
                    script for a package from a template file that \
                    lists the operating system features that the \
                    package can use, in the form of m4 macro calls.
homepage            http://www.gnu.org/software/autoconf/

depends_lib         port:gettext
installs_libs       no

master_sites        gnu
use_xz              yes
checksums           rmd160  666aa45a58e856968c651e2a3b44be38de9c14e4 \
                    sha256  64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684

patchfiles          use-macports-tools.patch
post-patch {
    # Stop build from trying to regenerate this after patching.
    touch ${worksrcpath}/man/autoreconf.1
}

# Backport a testsuite fix from upstream.
patchfiles-append \
        0001-tests-avoid-spurious-test-failure-with-libtool-2.4.3.patch

# The README prescribes GNU M4 1.4.6 or later, which Leopard and later
# have. Tiger only provides 1.4.2.
if {${os.platform} eq "darwin" && ${os.major} >= 9} {
    configure.env       M4=/usr/bin/m4
} else {
    depends_lib-append  port:m4
}

# It should be safe to use the system Perl, since the scripts only use
# core modules. The README prescribes 5.6 or later, and Tiger has 5.8.6.
configure.perl      /usr/bin/perl

test.run            yes
test.env            CC=${configure.cc}
test.target         check

livecheck.type      regex
livecheck.url       http://ftp.gnu.org/gnu/${name}/?C=M&O=D
livecheck.regex     ${name}-(\\d+\\.\\d+)