# $Id: Portfile 91707 2012-04-08 12:53:17Z raimue@macports.org $

PortSystem    1.0
PortGroup     python27 1.0

name          bzr
version       2.5.0
set branch    [join [lrange [split ${version} .] 0 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  3581accba3317b6f8b4ae889b0599d9546bb6877 \
              sha256  cb657fca640d3c36794a20e5a1d7398404189541b1290fa1bf19a5eb4e903133

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  port:bash-completion

    post-destroot {
        xinstall -d ${destroot}${prefix}/etc/bash_completion.d
        xinstall -m 644 ${worksrcpath}/contrib/bash/bzr \
            ${destroot}${prefix}/etc/bash_completion.d/bzr
    }
}

universal_variant no

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