summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/python/python-2.4.3-r2.ebuild')
-rw-r--r--dev-lang/python/python-2.4.3-r2.ebuild98
1 files changed, 59 insertions, 39 deletions
diff --git a/dev-lang/python/python-2.4.3-r2.ebuild b/dev-lang/python/python-2.4.3-r2.ebuild
index 5e20056..dc3c4af 100644
--- a/dev-lang/python/python-2.4.3-r2.ebuild
+++ b/dev-lang/python/python-2.4.3-r2.ebuild
@@ -7,26 +7,24 @@
# in dev-lang/python. It _WILL_ stop people installing from
# Gentoo 1.4 images.
-inherit eutils flag-o-matic python multilib versionator toolchain-funcs
+inherit eutils flag-o-matic python multilib versionator toolchain-funcs alternatives
# we need this so that we don't depends on python.eclass
PYVER_MAJOR=$(get_major_version)
PYVER_MINOR=$(get_version_component_range 2)
PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
-PATCHTAR="${PN}-${PYVER}-patches-2"
-
MY_P="Python-${PV}"
S="${WORKDIR}/${MY_P}"
DESCRIPTION="Python is 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/${PATCHTAR}.tar.bz2"
+ mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
LICENSE="PSF-2.2"
SLOT="2.4"
#KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
-KEYWORDS="-x86 -amd64"
+KEYWORDS="~x86 -amd64"
IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc nocxx"
DEPEND=">=sys-libs/zlib-1.1.3
@@ -63,20 +61,20 @@ src_unpack() {
cd ${S}
# unnecessary termcap dep in readline (#79013)
- epatch ${FILESDIR}/patches/2.4.2-readline.patch
+ epatch ${WORKDIR}/${PV}/2.4.2-readline.patch
# db4.2 support
- epatch ${FILESDIR}/patches/${P}-db4.patch
+ epatch ${WORKDIR}/${PV}/2.4.3-db4.patch
# adds support for PYTHON_DONTCOMPILE shell environment to
# supress automatic generation of .pyc and .pyo files - liquidx (08 Oct 03)
- epatch ${FILESDIR}/patches/python-2.4-gentoo_py_dontcompile.patch
- epatch ${FILESDIR}/patches/python-2.4-disable_modules_and_ssl.patch
- epatch ${FILESDIR}/patches/2.4-mimetypes_apache.patch
+ epatch ${WORKDIR}/${PV}/2.4-gentoo_py_dontcompile.patch
+ epatch ${WORKDIR}/${PV}/2.4-disable_modules_and_ssl.patch
+ epatch ${WORKDIR}/${PV}/2.4-mimetypes_apache.patch
# prepends /usr/lib/portage/pym to sys.path
- epatch ${FILESDIR}/patches/python-2.4-add_portage_search_path.patch
+ epatch ${WORKDIR}/${PV}/2.4-add_portage_search_path.patch
- epatch ${FILESDIR}/patches/2.4.3-libdir.patch
+ epatch ${WORKDIR}/${PV}/2.4.3-libdir.patch
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
@@ -87,7 +85,7 @@ src_unpack() {
setup.py || die
# add support for struct stat st_flags attribute (bug 94637)
- epatch ${FILESDIR}/patches/2.4.1-st_flags.patch
+ epatch ${WORKDIR}/${PV}/2.4.1-st_flags.patch
# fix os.utime() on hppa. utimes it not supported but unfortunately
# reported as working - gmsoft (22 May 04)
@@ -95,11 +93,11 @@ src_unpack() {
[ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i ${S}/configure
if tc-is-cross-compiler ; then
- epatch ${FILESDIR}/patches/python-2.4.1-crosscompile.patch
+ epatch ${WORKDIR}/${PV}/2.4.1-crosscompile.patch
fi
# fix gentoo/obsd problems (bug 117261)
- epatch ${FILESDIR}/patches/python-2.4.3-gentoo_obsd-r1.patch
+ epatch ${WORKDIR}/${PV}/2.4.3-gentoo_obsd.patch
}
src_configure() {
@@ -191,10 +189,31 @@ src_install() {
# install our own custom python-config
exeinto /usr/bin
- newexe ${FILESDIR}/python-config-${PYVER} python-config
+ doexe ${FILESDIR}/python-config-${PYVER}
# Use correct libdir in python-config
- dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config
+ dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config-${PYVER}
+
+ # install python-updater in /usr/sbin
+ newsbin ${FILESDIR}/python-updater-r1 python-updater
+
+ if use build ; then
+ rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
+ use berkdb || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/bsddb
+ use tk || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/lib-tk
+ fi
+
+ # Fix slotted collisions
+ mv ${D}/usr/bin/pydoc ${D}/usr/bin/pydoc${PYVER}
+ mv ${D}/usr/bin/idle ${D}/usr/bin/idle${PYVER}
+ mv ${D}/usr/share/man/man1/python.1 \
+ ${D}/usr/share/man/man1/python${PYVER}.1
+ rm -f ${D}/usr/bin/smtpd.py
+
+ prep_ml_includes usr/include/python${PYVER}
+
# The stuff below this line extends from 2.1, and should be deprecated
# in 2.3, or possibly can wait till 2.4
@@ -210,25 +229,20 @@ src_install() {
dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
/usr/$(get_libdir)/python${PYVER}/config/Makefile
- # install python-updater in /usr/sbin
- #dosbin ${FILESDIR}/python-updater
- newsbin ${FILESDIR}/python-updater-r1 python-updater
-
- if use build ; then
- rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
- else
- use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
- use berkdb || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/bsddb
- use tk || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/lib-tk
- fi
-
- prep_ml_includes usr/include/python${PYVER}
}
pkg_postrm() {
python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/share/man/man1/python.1.gz" \
+ "python[0-9].[0-9].1.gz"
+
python_mod_cleanup /usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
}
pkg_postinst() {
@@ -236,9 +250,19 @@ pkg_postinst() {
myroot=$(echo $ROOT | sed 's:/$::')
python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/share/man/man1/python.1.gz" \
+ "python[0-9].[0-9].1.gz"
+
python_mod_optimize
- python_mod_optimize -x site-packages -x test ${myroot}/usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || python_mod_optimize -x site-packages -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_optimize -x site-packages \
+ -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
# workaround possible python-upgrade-breaks-portage situation
@@ -251,14 +275,10 @@ pkg_postinst() {
fi
fi
- # try to upgrade to new python automatically - something to think about
- #if [ "${ROOT}" = "/" ]; then
- # /usr/sbin/python-updater
- #fi
-
echo
ewarn
- ewarn "If you have just upgraded from an older version of python you will need to run:"
+ ewarn "If you have just upgraded from an older version of python you"
+ ewarn "will need to run:"
ewarn
ewarn "/usr/sbin/python-updater"
ewarn