# $Id: Portfile 102584 2013-02-05 04:25:13Z larryv@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-gd
version			0.56
categories-append	graphics
maintainers		nomaintainer
platforms		darwin
description		py-gd is a python wrapper for the GD library
long_description	py-gd is a python wrapper for the graphics library GD \
				so you can use python to create/manipulate images \
				(png, jpeg) by drawing lines, text, doing flood-fills, \
				etc.

homepage		http://newcenturycomputers.net/projects/gdmodule.html
master_sites	http://newcenturycomputers.net/projects/download.cgi/
distname		gdmodule-${version}
checksums		md5     6a6db28a089d4caf5a921cd266a62b3d \
				sha1    519a64e14897599d879b82a5f5b0f308a14826e3 \
				rmd160  fb3c2e77a59840272d12c786d187b096e1eec53d

python.versions	24 25 26

if {$subport != $name} {
    patchfiles		patch-Setup.py.diff
    
    depends_lib-append	port:gd2 port:giflib
    
    post-patch	{
        file rename ${worksrcpath}/Setup.py ${worksrcpath}/_Setup.py
        file rename ${worksrcpath}/_Setup.py ${worksrcpath}/setup.py
        reinplace "s|PREFIX|${prefix}|g" ${worksrcpath}/setup.py
    }
    
    build.env	LDFLAGS="-L${prefix}/lib"
    
    post-destroot   {
        xinstall -m 644 -W ${worksrcpath} README gd-ref.html \
            install_notes.html ${destroot}${prefix}/share/doc/${subport}
        xinstall -m 644 ${worksrcpath}/gddemo.py \
            ${destroot}${prefix}/share/doc/${subport}/examples/
    }
}
