# -*- 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: Portfile 79979 2011-07-01 08:22:38Z ryandesign@macports.org $

PortSystem          1.0

name                expat
version             2.0.1
revision            1
categories          textproc devel
platforms           darwin freebsd
maintainers         ryandesign
license             MIT

description         XML 1.0 parser written in C

long_description    Expat is an XML parser library written in C. It is a \
                    stream-oriented parser in which an application \
                    registers handlers for things the parser might find \
                    in the XML document (like start tags).
                    
homepage            http://expat.sourceforge.net/
master_sites        sourceforge:project/${name}/${name}/${version}

checksums           md5     ee8b492592568805593f81f8cdf2a04c \
                    sha1    663548c37b996082db1f2f2c32af060d7aa15c2d \
                    rmd160  d31bcb152adaff9e358968be1ea901e1b4ed3b2f

configure.args      --mandir=${prefix}/share/man

use_parallel_build  yes
build.type          gnu

pre-test {
    copy -force ${worksrcpath}/lib/expat.h ${worksrcpath}/lib/expat_external.h ${worksrcpath}/tests
}
# extract from tests/README.txt: "Expat must be built and installed
# before "make check" can be executed."
test.run            yes
test.target         check

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    set examplesdir ${destroot}${prefix}/share/examples/${name}
    xinstall -m 0755 -d ${examplesdir} ${docdir}/html
    
    xinstall -m 0644 -W ${worksrcpath} COPYING Changes README ${docdir}
    eval xinstall -m 0644 [glob ${worksrcpath}/doc/*] ${docdir}/html
    
    xinstall -m 0644 -W ${worksrcpath}/examples elements.c outline.c \
        ${examplesdir}
    
    ln -s libexpat.1.dylib ${destroot}${prefix}/lib/libexpat.0.dylib
}

livecheck.type      sourceforge
