Merge remote-tracking branch 'remotes/zpuskas/youtube-viewer-3.2.0'
[gentoo.git] / app-eselect / eselect-python / eselect-python-20111108.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 ESVN_PROJECT="eselect-python"
9 ESVN_REPO_URI="https://overlays.gentoo.org/svn/proj/python/projects/eselect-python/trunk"
10
11 if [[ ${PV} == "99999999" ]] ; then
12         inherit autotools subversion
13 else
14         SRC_URI="mirror://gentoo/${P}.tar.bz2"
15         KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
16 fi
17
18 DESCRIPTION="Eselect module for management of multiple Python versions"
19 HOMEPAGE="https://www.gentoo.org/proj/en/Python/"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 IUSE=""
24
25 RDEPEND=">=app-admin/eselect-1.2.3"
26 # Avoid autotool deps for released versions for circ dep issues.
27 if [[ ${PV} == "99999999" ]] ; then
28         DEPEND="sys-devel/autoconf"
29 else
30         DEPEND=""
31 fi
32
33 src_unpack() {
34         unpack ${A}
35         cd "${S}"
36         [[ -x configure ]] || eautoreconf
37 }
38
39 src_install() {
40         keepdir /etc/env.d/python
41         emake DESTDIR="${D}" install || die
42 }
43
44 pkg_preinst() {
45         if has_version "<${CATEGORY}/${PN}-20090804" || ! has_version "${CATEGORY}/${PN}"; then
46                 run_eselect_python_update="1"
47         fi
48 }
49
50 pkg_postinst() {
51         if [[ "${run_eselect_python_update}" == "1" ]]; then
52                 ebegin "Running \`eselect python update\`"
53                 eselect python update --ignore 3.0 --ignore 3.1 --ignore 3.2 > /dev/null
54                 eend "$?"
55         fi
56 }