# $Id: Portfile 64823 2010-03-16 06:37:09Z jmr@macports.org $

PortSystem            1.0
PortGroup             archcheck 1.0

name                  libxml2
version               2.7.7
categories            textproc
description           gnome xml library
platforms             darwin
maintainers           gmail.com:cedric.luthi
homepage              http://xmlsoft.org/

master_sites          ftp://fr.rpmfind.net/pub/libxml/ \
                      ftp://gd.tuwien.ac.at/pub/libxml/ \
                      ${homepage}sources/ \
                      ftp://xmlsoft.org/${name}/

checksums           md5     9abc9959823ca9ff904f1fbcf21df066 \
                    sha1    8592824a2788574a172cbddcdc72f734ff87abe3 \
                    rmd160  9f72c778c3e9e348a68eada0cf624c012658c085

depends_lib           port:libiconv port:zlib

archcheck.files       lib/libiconv.dylib \
                      lib/libz.dylib

post-extract {
    reinplace "s|/etc|${prefix}/etc|g" \
        ${worksrcpath}/catalog.c \
        ${worksrcpath}/runtest.c \
        ${worksrcpath}/xmlcatalog.c \
        ${worksrcpath}/xmllint.c \
        ${worksrcpath}/doc/xmlcatalog.1 \
        ${worksrcpath}/doc/xmllint.1

}

configure.args          --enable-static \
                        --without-python

use_parallel_build      yes

destroot.keepdirs       ${destroot}${prefix}/etc/xml
post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/etc/xml
}

test.run              yes
test.target           check

variant debug description {Enable debug build} {
        configure.optflags -O0 -g -Wno-uninitialized
	configure.args-append --with-run-debug
}

long_description \
Libxml is the XML C library developed for the Gnome project.  \
XML itself is a metalanguage to design markup languages. \
Though the library is written in C, a variety of language bindings make it \
available in other environments.

livecheck.type  regex
livecheck.url   ${homepage}news.html
livecheck.regex {<h3>(\d+(?:\.\d+)*): .*</h3>}
