# -*- 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 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem      1.0
PortGroup       python 1.0

name            py-impressive
version         0.10.2
revision        7
categories-append   graphics
license         GPL-2
maintainers     nomaintainer
description     slide presentation tool
long_description \
    Impressive is a program that displays presentation slides.       \
    But unlike OpenOffice.org Impress or other similar applications, \
    it does so with style. Smooth alpha-blended slide transitions    \
    are provided for the sake of eye candy, but in addition to this, \
    Impressive offers some unique tools that are really useful       \
    for presentations.
homepage        http://impressive.sourceforge.net/
platforms       darwin
supported_archs noarch
master_sites    sourceforge:impressive

distname        Impressive-${version}
checksums       md5    492eda5e3e09beb2f6dc997ed94f5349         \
                sha1   636515909f2b2e06bed46162a6f648ef0d348c84 \
                rmd160 44f5d6d7d76f3128f1780caba33432a4866cb1b2

python.versions 26

if {${name} ne ${subport}} {
    depends_lib     port:py${python.version}-opengl   \
                    port:py${python.version}-game     \
                    port:py${python.version}-pil      \
                    port:xpdf        \
                    port:ghostscript \
                    port:pdftk

    post-patch {
        reinplace "s|/usr/bin/env python|${python.bin}|" ${worksrcpath}/impressive.py
    }
    build {}

    python.link_binaries no
    # this is bad, a py27-impressive would conflict with py26-impressive
    # make non-conflicting or change name to just 'impressive'
    destroot {
        xinstall -d ${destroot}${prefix}/bin
        xinstall -d ${destroot}${prefix}/share/impressive
        xinstall -d ${destroot}${prefix}/share/doc/impressive
        xinstall -m 775 ${worksrcpath}/impressive.py \
                        ${worksrcpath}/demo.pdf \
                        ${destroot}${prefix}/share/impressive
        xinstall -m 644 ${worksrcpath}/impressive.1 \
                        ${destroot}${prefix}/share/man/man1
        xinstall -m 664 ${worksrcpath}/license.txt \
                        ${worksrcpath}/changelog.txt \
                        ${worksrcpath}/impressive.html \
                        ${destroot}${prefix}/share/doc/impressive
        ln -s ${prefix}/share/impressive/impressive.py ${destroot}${prefix}/bin/impressive
    }
}
