# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.3-r3.ebuild,v 1.4 2012/12/02 18:21:49 mgorny Exp $ EAPI="2" WANT_AUTOMAKE="none" WANT_LIBTOOL="none" # Bootstrapping Python 2 requires Python 2. PYTHON_COMPAT=( python{2_5,2_6,2_7} ) inherit autotools eutils flag-o-matic multilib pax-utils python-any-r1 toolchain-funcs MY_P="Python-${PV}" PATCHSET_REVISION="1" DESCRIPTION="An interpreted, interactive, object-oriented programming language" HOMEPAGE="http://www.python.org/" SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2 mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2" LICENSE="PSF-2" SLOT="2.7" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" IUSE="-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" RDEPEND="app-arch/bzip2 >=sys-libs/zlib-1.1.3 virtual/libffi virtual/libintl !build? ( berkdb? ( || ( sys-libs/db:4.8 sys-libs/db:4.7 sys-libs/db:4.6 sys-libs/db:4.5 sys-libs/db:4.4 sys-libs/db:4.3 sys-libs/db:4.2 ) ) gdbm? ( sys-libs/gdbm[berkdb] ) ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) ) sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] ) ssl? ( dev-libs/openssl ) tk? ( >=dev-lang/tk-8.0 dev-tcltk/blt ) xml? ( >=dev-libs/expat-2.1 ) ) !! epython.py python_domodule epython.py } pkg_preinst() { if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then python_updater_warning="1" fi } eselect_python_update() { [[ -z "${EROOT}" || (! -d "${EROOT}" && -d "${ROOT}") ]] && EROOT="${ROOT%/}${EPREFIX}/" if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then eselect python update fi if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then eselect python update --python${PV%%.*} fi } pkg_postinst() { eselect_python_update if [[ "${python_updater_warning}" == "1" ]]; then ewarn "You have just upgraded from an older version of Python." ewarn "You should switch active version of Python ${PV%%.*} and run" ewarn "'python-updater [options]' to rebuild Python modules." fi } pkg_postrm() { eselect_python_update }