From e88c29aaa351a84747d7645cd12d9ef8a1c6a8c7 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Mon, 25 Apr 2016 19:35:24 +0200 Subject: [PATCH] python-ipython: use alternatives --- .../patches/no-versioned-scripts.patch | 12 ++++++++++ srcpkgs/python-ipython/template | 22 +++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/python-ipython/patches/no-versioned-scripts.patch diff --git a/srcpkgs/python-ipython/patches/no-versioned-scripts.patch b/srcpkgs/python-ipython/patches/no-versioned-scripts.patch new file mode 100644 index 00000000000..d43e1c971c7 --- /dev/null +++ b/srcpkgs/python-ipython/patches/no-versioned-scripts.patch @@ -0,0 +1,12 @@ +--- setupbase.py.orig ++++ setupbase.py +@@ -298,7 +298,7 @@ def find_entry_points(): + 'iptest%s = IPython.testing.iptestcontroller:main', + ] + suffix = str(sys.version_info[0]) +- return [e % '' for e in ep] + [e % suffix for e in ep] ++ return [e % '' for e in ep] + + script_src = """#!{executable} + # This script was automatically generated by setup.py + diff --git a/srcpkgs/python-ipython/template b/srcpkgs/python-ipython/template index 0b3bbb437b9..74884297a54 100644 --- a/srcpkgs/python-ipython/template +++ b/srcpkgs/python-ipython/template @@ -1,7 +1,7 @@ # Template file for 'python-ipython' pkgname=python-ipython version=4.2.0 -revision=1 +revision=2 noarch=yes wrksrc="ipython-${version}" build_style=python-module @@ -14,25 +14,33 @@ short_desc="Enhanced interactive Python2 shell" maintainer="Alessio Sergi " homepage="http://ipython.org/" license="3-clause-BSD" -distfiles="https://pypi.python.org/packages/4e/c7/519b95112dba6f3ae91530bcb8564454c575fcb1fdb323b2b0ee9eff1227/ipython-${version}.tar.gz" +distfiles="${PYPI_SITE}/i/ipython/ipython-${version}.tar.gz" checksum=dba42f182b5f6f26630d2202efd30383712d9f7d8d8d9896b37ae2145deca616 +alternatives=" + ipython:ipython:/usr/bin/ipython2.7 + ipython:ipython.1:/usr/share/man/man1/ipython2.7.1" + post_install() { # use decorators of numpy rm -f ${DESTDIR}/usr/lib/python*/site-packages/IPython/external/decorators/_decorators.py # remove iptest rm -f ${DESTDIR}/usr/bin/iptest* - # drop '2' suffix from ipython bin script - rm -f ${DESTDIR}/usr/bin/ipython - mv ${DESTDIR}/usr/bin/ipython{2,} - # create versioned ipython3 bin script and man page - mv ${DESTDIR}/usr/bin/ipython3{,.4} + # create ipython2 symlink + ln -sf ipython2.7 ${DESTDIR}/usr/bin/ipython2 + # create versioned man pages + mv ${DESTDIR}/usr/share/man/man1/ipython{,2.7}.1 vman docs/man/ipython.1 ipython3.4.1 # install license vlicense COPYING.rst LICENSE } python3.4-ipython_package() { + alternatives=" + ipython:ipython:/usr/bin/ipython3.4 + ipython:ipython.1:/usr/share/man/man1/ipython3.4.1 + ipython3:ipython3:/usr/bin/ipython3.4 + ipython3:ipython3.1:/usr/share/man/man1/ipython3.4.1" noarch=yes depends="python3.4-decorator python3.4-pexpect python3.4-pickleshare python3.4-simplegeneric python3.4-traitlets"