PortSystem              1.0

name                    redo
version                 0.42
revision                0
categories              devel
maintainers             {mails.ucas.ac.cn:chenguokai17 @chenguokai} openmaintainer
supported_archs         noarch

homepage                http://apenwarr.ca/log/?m=201012#14
platforms               any
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.target            build
build.cmd               ${worksrcpath}/do
test.run                no
destroot.cmd            DESTDIR=${destroot} PREFIX=${prefix} ${worksrcpath}/do 
destroot.target         install
destroot.post_args      
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 {
        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
