# $Id$

PortSystem              1.0

name                    redo
version                 0.06
revision                1
categories              devel
maintainers             nomaintainer
supported_archs         noarch

homepage                http://apenwarr.ca/log/?m=201012#14
platforms               darwin openbsd
license                 LGPL-2
fetch.type              git
git.url                 https://github.com/apenwarr/${name}.git
git.branch              ${name}-${version}
description             Smaller, easier, more powerful, and more reliable than make.
long_description        \
    redo is literally the most amazingly groundbreaking build system since \
    the original invention of 'make'. Claims: \
        it can do everything make can do\; \
        with no baked-in assumptions about what you're building\; \
        with much less code\; \
        with much greater parallelism\; \
        with finer-grained dependencies\; \
        with much less syntax (actually nothing but /bin/sh)\; \
        while supporting recursion and full dependency information simultaneously \
            (no Recursive Make Considered Harmful crap)\; \
        yet build scripts are highly modular and readable\; \
        and you can checksum your targets instead of using timestamps\; \
        and your build scripts run linearly instead of an orderless \"ruleset\"\; \
        with no implicit rules required\; \
        and implementing C header autodependencies is completely sane\; \
        and dependency checks involve no forking or parsing so it's crazy fast\; \
        and you can incrementally convert parts of your project\; \
        because it can play well with other build systems\; \
        including jobserver compatibility with make -j\; \
        oh, and you can write a plug-compatible toy implementation in 100 lines of shell.

use_configure           no
build.cmd               ${worksrcpath}/${name}
test.run                yes
destroot.destdir        ""
destroot.env-append     DESTDIR=${destroot} PREFIX=${prefix}
variant doc description {Build and install man pages} requires python27 {
    # The documentation requires some python modules to build
    depends_build       port:py27-beautifulsoup port:py27-markdown
}
variant bash_completion {
    depends_run-append  path:etc/bash_completion:bash-completion
    post-destroot {
        xinstall -d ${destroot}${prefix}/etc/bash_completion.d/
        xinstall -m 644 ${worksrcpath}/contrib/bash_completion.d/redo \
            ${destroot}${prefix}/etc/bash_completion.d/
    }
}
variant python27 description {Change shebang lines to use Macports Python 2.7 } {
    depends_lib port:python27
    configure {
        eval reinplace "s|#!/usr/bin/python|#!${prefix}/bin/python2.7|" [glob ${worksrcpath}/*]
    }
}
variant python_select description {Compatibility variant, requires python27} requires python27 {}
default_variants        +doc +bash_completion