# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.3.ebuild,v 1.18 2014/03/18 16:43:13 ago Exp $ EAPI="4" WANT_AUTOMAKE="none" WANT_LIBTOOL="none" inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing MY_P="Python-${PV}" PATCHSET_REVISION="0" PREFIX_PATCHREV="-r2" 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.xz http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz http://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches${PREFIX_PATCHREV}.tar.bz2" LICENSE="PSF-2" SLOT="3.3" KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="aqua build +crypt doc elibc_uclibc examples gdbm hardened ipv6 +ncurses nis +readline sqlite +ssl +threads tk wininst +xml" # Do not add a dependency on dev-lang/python to this ebuild. # If you need to apply a patch which requires python for bootstrapping, please # run the bootstrap code on your dev box and include the results in the # patchset. See bug 447752. RDEPEND="app-arch/bzip2 app-arch/xz-utils >=sys-libs/zlib-1.1.3 virtual/libffi virtual/libintl !build? ( 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 ) ssl? ( dev-libs/openssl ) tk? ( >=dev-lang/tk-8.0 dev-tcltk/blt ) xml? ( >=dev-libs/expat-2.1 ) ) !!/dev/null) fi newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} sed \ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ -e "s:@PYDOC@:pydoc${SLOT}:" \ -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" # for python-exec python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR # if not using a cross-compiler, use the fresh binary if ! tc-is-cross-compiler; then local PYTHON=./python local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. fi echo "EPYTHON='${EPYTHON}'" > epython.py python_domodule epython.py } pkg_preinst() { if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then python_updater_warning="1" fi } eselect_python_update() { 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 ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." ewarn ewarn "For legacy packages, you should switch active version of Python and run 'python-updater [options]' to rebuild Python modules." fi } pkg_postrm() { eselect_python_update }