diff -Nru cython-0.17~beta3/debian/changelog cython-0.17~beta3/debian/changelog --- cython-0.17~beta3/debian/changelog 2012-08-23 12:30:38.000000000 -0700 +++ cython-0.17~beta3/debian/changelog 2012-08-27 16:15:01.000000000 -0700 @@ -1,3 +1,10 @@ +cython (0.17~beta3-2) experimental; urgency=low + + * Install executables as cython.py2 and cython.py3 + * Use update-alternatives framework to manage cython script + + -- Bradley M. Froehle Mon, 27 Aug 2012 10:19:29 -0700 + cython (0.17~beta3-1) experimental; urgency=low * New upstream pre-release beta diff -Nru cython-0.17~beta3/debian/cython3.install cython-0.17~beta3/debian/cython3.install --- cython-0.17~beta3/debian/cython3.install 2012-08-23 12:30:38.000000000 -0700 +++ cython-0.17~beta3/debian/cython3.install 2012-08-27 15:38:13.000000000 -0700 @@ -1,3 +1,2 @@ -usr/bin/cython3 -usr/bin/cygdb3 +usr/bin/*.py3 usr/lib/python3*/*-packages/* diff -Nru cython-0.17~beta3/debian/cython3.postinst cython-0.17~beta3/debian/cython3.postinst --- cython-0.17~beta3/debian/cython3.postinst 1969-12-31 16:00:00.000000000 -0800 +++ cython-0.17~beta3/debian/cython3.postinst 2012-08-27 16:48:40.000000000 -0700 @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + update-alternatives \ + --install /usr/bin/cython cython /usr/bin/cython.py3 10 \ + --slave /usr/share/man/man1/cython.1.gz cython.1.gz /usr/share/man/man1/cython.py3.1.gz \ + --slave /usr/bin/cygdb cygdb /usr/bin/cygdb.py3 +fi + +#DEBHELPER# + +exit 0 diff -Nru cython-0.17~beta3/debian/cython3.prerm cython-0.17~beta3/debian/cython3.prerm --- cython-0.17~beta3/debian/cython3.prerm 1969-12-31 16:00:00.000000000 -0800 +++ cython-0.17~beta3/debian/cython3.prerm 2012-08-27 15:34:54.000000000 -0700 @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" != "upgrade" ]; then + update-alternatives --remove cython /usr/bin/cython.py3 +fi + +#DEBHELPER# + +exit 0 diff -Nru cython-0.17~beta3/debian/cython.install cython-0.17~beta3/debian/cython.install --- cython-0.17~beta3/debian/cython.install 2012-08-23 12:30:38.000000000 -0700 +++ cython-0.17~beta3/debian/cython.install 2012-08-27 15:38:03.000000000 -0700 @@ -1,3 +1,2 @@ -usr/bin/cython -usr/bin/cygdb +usr/bin/*.py2 usr/lib/python2*/*-packages/* diff -Nru cython-0.17~beta3/debian/cython.postinst cython-0.17~beta3/debian/cython.postinst --- cython-0.17~beta3/debian/cython.postinst 1969-12-31 16:00:00.000000000 -0800 +++ cython-0.17~beta3/debian/cython.postinst 2012-08-27 16:47:28.000000000 -0700 @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + update-alternatives \ + --install /usr/bin/cython cython /usr/bin/cython.py2 20 \ + --slave /usr/share/man/man1/cython.1.gz cython.1.gz /usr/share/man/man1/cython.py2.1.gz \ + --slave /usr/bin/cygdb cygdb /usr/bin/cygdb.py2 +fi + +#DEBHELPER# + +exit 0 diff -Nru cython-0.17~beta3/debian/cython.prerm cython-0.17~beta3/debian/cython.prerm --- cython-0.17~beta3/debian/cython.prerm 1969-12-31 16:00:00.000000000 -0800 +++ cython-0.17~beta3/debian/cython.prerm 2012-08-27 15:34:54.000000000 -0700 @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" != "upgrade" ]; then + update-alternatives --remove cython /usr/bin/cython.py2 +fi + +#DEBHELPER# + +exit 0 diff -Nru cython-0.17~beta3/debian/rules cython-0.17~beta3/debian/rules --- cython-0.17~beta3/debian/rules 2012-08-23 12:30:38.000000000 -0700 +++ cython-0.17~beta3/debian/rules 2012-08-27 15:53:16.000000000 -0700 @@ -37,10 +37,16 @@ python$$v-dbg setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \ done - : # Force the creation of cython3 and cygdb3 executables. - : # Shebang lines are fixed in override_dh_install. - cp debian/tmp/usr/bin/cython debian/tmp/usr/bin/cython3 - cp debian/tmp/usr/bin/cygdb debian/tmp/usr/bin/cygdb3 + : # Force the creation of cython.pyX and cygdb.pyX executables. + cp debian/tmp/usr/bin/cython debian/tmp/usr/bin/cython.py2 + cp debian/tmp/usr/bin/cygdb debian/tmp/usr/bin/cygdb.py2 + + cp debian/tmp/usr/bin/cython debian/tmp/usr/bin/cython.py3 + cp debian/tmp/usr/bin/cygdb debian/tmp/usr/bin/cygdb.py3 + + : # fix shebang + sed -i -e '1 s,#!.*python.*,#!/usr/bin/python,' debian/tmp/usr/bin/*.py2 + sed -i -e '1 s,#!.*python.*,#!/usr/bin/python3,' debian/tmp/usr/bin/*.py3 override_dh_installman: : # Generate a manpage using help2man @@ -50,15 +56,16 @@ bin/cython >| build/cython.1 : # Verify that manpage generated nicely -- no Errors reported grep -q 'ImportError:' build/cython.1 && exit 1 || : - dh_installman build/cython.1 + + cp build/cython.1 build/cython.py2.1 + dh_installman -pcython build/cython.py2.1 + + cp build/cython.1 build/cython.py3.1 + dh_installman -pcython3 build/cython.py3.1 override_dh_install: dh_install - : # fix shebang - sed -i -e '1 s,#!.*python.*,#!/usr/bin/python,' debian/cython/usr/bin/* - sed -i -e '1 s,#!.*python.*,#!/usr/bin/python3,' debian/cython3/usr/bin/* - : # remove files installed from cython.install that belong in -dbg find $(CURDIR)/debian/cython/ -name "*_d.so" -delete find $(CURDIR)/debian/cython3/ -name "*.cpython-3?d*.so" -delete @@ -100,6 +107,18 @@ rm -rf build find -name "*.py[oc]" -type f -delete + : # Remove Cython generated sources + rm -f \ + Cython/Compiler/Code.c \ + Cython/Compiler/FlowControl.c \ + Cython/Compiler/Lexicon.c \ + Cython/Compiler/Parsing.c \ + Cython/Compiler/Scanning.c \ + Cython/Compiler/Visitor.c \ + Cython/Plex/Actions.c \ + Cython/Plex/Scanners.c \ + Cython/Runtime/refnanny.c + # To fetch and update upstream Changelogs DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')