# $Id: Portfile 56184 2009-08-25 06:11:10Z ryandesign@macports.org $

PortSystem      1.0

name            unsermake
version         0.4-20070824
revision        1
categories      devel
maintainers     nomaintainer
description     Replacement for automake
long_description \
                Unsermake is an automake replacement from the KDE project.
platforms       darwin
homepage        http://www.kde.me.uk/index.php?page=unsermake
master_sites    http://ranger.befunk.com/fink \
                http://astrange.ithinksw.net/~astrange/ranger-fink \
                http://www.southofheaven.net/befunk
distfiles       ${name}-20070824.tar.bz2
use_bzip2       yes
checksums       md5 b794f83bdc3f6205d1fd731da4e96d89
worksrcdir      ${name}

depends_run     port:python25

patch {
    reinplace "s|exec python|exec ${prefix}/bin/python2.5|" ${worksrcpath}/unsermake
}

use_configure   no

build {}

destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/unsermake
    foreach f {*.um *.py} {
        eval xinstall -m 644 [glob ${worksrcpath}/${f}] ${destroot}${prefix}/share/unsermake/
    }
    xinstall -m 755 ${worksrcpath}/unsermake ${destroot}${prefix}/share/unsermake/
    ln -s ${prefix}/share/unsermake/unsermake ${destroot}${prefix}/bin/unsermake
}
post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} COPYING README TODO ${destroot}${prefix}/share/doc/${name}
}

platform darwin 7 {
    depends_run-append  port:coreutils
    post-patch {
        reinplace "s|`readlink|`greadlink|" ${worksrcpath}/unsermake
    }
}
