Convert all URIs for launchpad.net from http to https
[gentoo.git] / dev-vcs / bzr / bzr-2.6.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 )
7 PYTHON_REQ_USE="threads,ssl,xml"
8
9 inherit bash-completion-r1 distutils-r1 eutils flag-o-matic versionator
10
11 MY_P=${PN}-${PV}
12 SERIES=$(get_version_component_range 1-2)
13
14 DESCRIPTION="Bazaar is a next generation distributed version control system"
15 HOMEPAGE="http://bazaar-vcs.org/"
16 SRC_URI="https://launchpad.net/bzr/${SERIES}/${PV}/+download/${MY_P}.tar.gz"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris"
21 IUSE="curl doc +sftp test"
22
23 RDEPEND="curl? ( dev-python/pycurl[${PYTHON_USEDEP}] )
24         sftp? ( dev-python/paramiko[${PYTHON_USEDEP}] )"
25
26 DEPEND="test? (
27                 ${RDEPEND}
28                 >=dev-python/pyftpdlib-0.7.0[${PYTHON_USEDEP}]
29                 dev-python/subunit
30                 >=dev-python/testtools-0.9.5[${PYTHON_USEDEP}]
31         )"
32
33 S="${WORKDIR}/${MY_P}"
34
35 # Fails tests bug#487216
36 # Upstream is not exactly keen on fixing it
37 RESTRICT="test"
38
39 python_configure_all() {
40         # Generate the locales first to avoid a race condition.
41         esetup.py build_mo
42 }
43
44 python_compile() {
45         if [[ ${EPYTHON} != python3* ]]; then
46                 local CFLAGS=${CFLAGS}
47                 append-cflags -fno-strict-aliasing
48         fi
49         distutils-r1_python_compile
50 }
51
52 src_test() {
53         # Race due to conflicting ports in
54         # blackbox.test_serve.TestBzrServe.test_bzr_serve*.
55         DISTUTILS_NO_PARALLEL_BUILD=1 distutils-r1_src_test
56 }
57
58 python_test() {
59         # Some tests expect the usual pyc compiling behaviour.
60         local -x PYTHONDONTWRITEBYTECODE
61
62         # Define tests which are known to fail below.
63         local skip_tests="("
64         # https://bugs.launchpad.net/bzr/+bug/850676
65         skip_tests+="per_transport.TransportTests.test_unicode_paths.*"
66         skip_tests+=")"
67         if [[ -n ${skip_tests} ]]; then
68                 einfo "Skipping tests known to fail: ${skip_tests}"
69         fi
70
71         LC_ALL="C" "${PYTHON}" bzr --no-plugins selftest -v \
72                 ${skip_tests:+-x} "${skip_tests}" || die "Tests fail with ${EPYTHON}"
73 }
74
75 python_install_all() {
76         distutils-r1_python_install_all
77
78         # Fixup manpages manually; passing --install-data causes locales to be
79         # installed in /usr/share/share/locale
80         dodir /usr/share
81         mv "${ED%/}"/usr/{man,share/man} || die
82
83         dodoc doc/*.txt
84
85         if use doc; then
86                 docinto developers
87                 dodoc -r doc/developers/* || die
88                 for doc in mini-tutorial tutorials user-{guide,reference}; do
89                         docinto ${doc}
90                         dodoc -r doc/en/${doc}/* || die
91                 done
92         fi
93
94         dobashcomp contrib/bash/bzr || die
95 }