Merge remote-tracking branch 'github/pr/795'.
[gentoo.git] / app-eselect / eselect-python / eselect-python-20131210.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # Keep the EAPI low here because everything else depends on it.
6 # We want to make upgrading simpler.
7
8 if [[ ${PV} == "99999999" ]] ; then
9         inherit autotools git-r3
10         EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git"
11 else
12         SRC_URI="mirror://gentoo/${P}.tar.bz2
13                 https://dev.gentoo.org/~floppym/dist/${P}.tar.bz2"
14         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
15 fi
16
17 DESCRIPTION="Eselect module for management of multiple Python versions"
18 HOMEPAGE="https://www.gentoo.org/proj/en/Python/"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 IUSE=""
23
24 RDEPEND=">=app-admin/eselect-1.2.3"
25 # Avoid autotool deps for released versions for circ dep issues.
26 if [[ ${PV} == "99999999" ]] ; then
27         DEPEND="sys-devel/autoconf"
28 else
29         DEPEND=""
30 fi
31
32 src_unpack() {
33         if [[ ${PV} == "99999999" ]] ; then
34                 git-r3_src_unpack
35                 cd "${S}"
36                 eautoreconf
37         else
38                 unpack ${A}
39         fi
40 }
41
42 src_install() {
43         keepdir /etc/env.d/python
44         emake DESTDIR="${D}" install || die
45 }
46
47 pkg_postinst() {
48         local ret=0
49         ebegin "Running 'eselect python update'"
50         eselect python update --python2 --if-unset || ret=1
51         eselect python update --python3 --if-unset || ret=1
52         eend ${ret}
53 }