# $Id: Portfile 154 2009-06-21 11:17:38Z kimuraw $

PortSystem      1.0
PortGroup       python24 1.0
name            py-webkit2png
version         0.4
revision        0
platforms       darwin
maintainers     rsky0711@gmail.com
description     webkit2png is a command line tool that creates png screenshots of webpages.
long_description \
    webkit2png is a command line tool that creates png screenshots of webpages. \
    \
    With tall or wide pages that would normally require scrolling, it takesscreenshots \
    of the whole webpage, not just the area that would be visible in a browser window. \
    \
    webkit2png makes use of webkit, the rendering engine used in Safari.

homepage        http://www.paulhammond.org/webkit2png/
master_sites    http://www.paulhammond.org/2005/08/webkit2png/
distfiles       webkit2png-${version}.txt
checksums       md5 e65531dd3d9e6285b22bcae852883e67 \
                sha1 5504922fd9d05ccb2d2e7b8162a2838638e584c9 \
                rmd160 08e4dbd88fae1dcd76dfa31cd77c0a36365e7e61

categories-append   graphics www
depends_lib-append  port:py-pyobjc

extract {
    file mkdir ${worksrcpath}
    file copy ${distpath}/webkit2png-${version}.txt ${worksrcpath}/webkit2png.py
    file copy ${filespath}/setup.py ${worksrcpath}
    reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/setup.py
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/bin
    xinstall -m 755 ${filespath}/webkit2png ${destroot}${prefix}/bin
    reinplace "s|@PREFIX@|${prefix}|" ${destroot}${prefix}/bin/webkit2png
}
