# -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem 1.0
PortGroup python24 1.0

name                    py-libxml2
version                 2.6.21
categories              python textproc
platforms               darwin
maintainers             sfiera openmaintainer
description             Python bindings for libxml2
long_description        ${description}

homepage                http://xmlsoft.org/
master_sites            ftp://xmlsoft.org/libxml2/python/
distname                libxml2-python-${version}
checksums               md5 229dd2b3d110a77defeeaa73af83f7f3
patchfiles              patch-setup.py.diff

depends_lib-append      port:libxml2 \
                        port:zlib

build.env               LDFLAGS=-L${prefix}/lib

post-patch {
  reinplace "s|@PREFIX@|$prefix|" ${worksrcpath}/setup.py
}

post-destroot {
  # strip out anything related to libxslt, so py-libxml2 doesn't conflict with
  # py-libxslt
  fs-traverse file ${destroot} {
    if {[file isfile ${file}]} {
      if {[string match "*xslt*" ${file}]} {
          file delete ${file}
      }
    }
  }
  xinstall -m 644 -W ${worksrcpath} README TODO \
    ${destroot}${prefix}/share/doc/${name}
}

livecheck.type          md5
livecheck.url           ftp://xmlsoft.org/libxml2/python/
livecheck.md5           a2cc31311f1b3fb52a08cf1056efda11
