Merge remote-tracking branch 'github/pr/230'
[gentoo.git] / dev-util / wstool / wstool-9999.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
7
8 SCM=""
9 if [ "${PV#9999}" != "${PV}" ] ; then
10         SCM="git-r3"
11         EGIT_REPO_URI="https://github.com/vcstools/wstool"
12 fi
13
14 inherit ${SCM} distutils-r1
15
16 DESCRIPTION="Commands to manage several local SCM repositories for ROS"
17 HOMEPAGE="http://wiki.ros.org/wstool"
18 if [ "${PV#9999}" != "${PV}" ] ; then
19         SRC_URI=""
20         KEYWORDS=""
21 else
22         SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
23                 http://github.com/vcstools/wstool/archive/${PV}.tar.gz -> ${P}.tar.gz
24         "
25         KEYWORDS="~amd64 ~arm"
26 fi
27
28 LICENSE="BSD"
29 SLOT="0"
30 IUSE="test"
31
32 RDEPEND="
33         dev-python/pyyaml[${PYTHON_USEDEP}]
34         >=dev-python/vcstools-0.1.38[${PYTHON_USEDEP}]
35 "
36 DEPEND="${RDEPEND}
37         dev-python/sphinx
38         test? (
39                 dev-python/nose[${PYTHON_USEDEP}]
40                 dev-python/coverage[${PYTHON_USEDEP}]
41                 dev-vcs/git
42                 dev-vcs/bzr
43                 dev-vcs/mercurial
44                 dev-vcs/subversion
45         )
46 "
47
48 PATCHES=( "${FILESDIR}/prefix.patch" )
49 DISTUTILS_IN_SOURCE_BUILD="yes"
50
51 python_test() {
52         # From travis.yml
53         # Set git config to silence some stuff in the tests
54         git config --global user.email "foo@example.com"
55         git config --global user.name "Foo Bar"
56         # Set the hg user
57         echo -e "[ui]\nusername = Your Name <your@mail.com>" >> ~/.hgrc
58         # Set the bzr user
59         bzr whoami "Your Name <name@example.com>"
60         # command to run tests
61         nosetests --with-coverage --cover-package=wstool || die
62 }