# $Id: Portfile 102989 2013-02-11 19:25:07Z raimue@macports.org $

PortSystem    1.0
PortGroup     python27 1.0

name          bzr
version       2.5.1
set branch    [join [lrange [split ${version} .] 0 1] .]
revision      1
categories    devel python
platforms     darwin
license       GPL-2+
maintainers   raimue

description   The next-generation distributed version control system
long_description  Bazaar is an open source distributed version control \
    system that is powerful, friendly, and scalable. It manages trees of \
    files and subdirectories, In particular, it records revisions of trees, \
    representing their state at a particular point in time, and information \
    about those revisions and their relationships. Recording and retrieving \
    tree revisions is useful in several ways if you are writing software or \
    documents or doing similar creative work.

homepage      http://bazaar-vcs.org/
master_sites  https://launchpad.net/${name}/${branch}/${version}/+download/

checksums     rmd160  c577d1aff17782774f0335d317d776a03a464d26 \
              sha256  967346fa6cc52971a8dfd5171ec22e1928cf455fb4317013b05b0915ff927982

patchfiles    patch-setup.py.diff

depends_lib-append  port:py27-paramiko \
                    port:py27-crypto \
                    port:py27-curl \
                    port:py27-docutils \
                    port:py27-pyrex

test.run      yes
test.cmd      make
test.target   check

python.link_binaries no

post-destroot {
    ln -s ${python.prefix}/bin/bzr ${destroot}${prefix}/bin/
    ln -s ${python.prefix}/share/man/man1/bzr.1 \
        ${destroot}${prefix}/share/man/man1
    xinstall -m 644 -W ${worksrcpath} INSTALL NEWS README TODO \
        ${destroot}${prefix}/share/doc/${name}
}

variant bash_completion {
    depends_run-append  path:etc/bash_completion:bash-completion

    post-destroot {
        xinstall -d ${destroot}${prefix}/share/bash-completion/completions
        xinstall -m 644 ${worksrcpath}/contrib/bash/bzr \
            ${destroot}${prefix}/share/bash-completion/completions
    }
}

livecheck.type      regex
livecheck.url       https://launchpad.net/bzr/+download
livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}
