python-ipython: use alternatives

This commit is contained in:
Alessio Sergi 2016-04-25 19:35:24 +02:00
parent b0b8bdac50
commit e88c29aaa3
2 changed files with 27 additions and 7 deletions

View File

@ -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

View File

@ -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 <al3hex@gmail.com>"
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"