On 26 June 2014 10:36, Brian May <br...@microcomaustralia.com.au> wrote:
> On 25 June 2014 16:27, Raphael Hertzog <hert...@debian.org> wrote: >> >> Not tested, but you get the idea I guess. And obviously we need strong (= >> ${binary:Version}) dependency between python*-django and >> python-django-common. >> > > # find -type f debian/python3-django/usr/lib/python3/dist-packages/ -not > -name '*.py' > find: paths must precede expression: > debian/python3-django/usr/lib/python3/dist-packages/ > Usage: find [-H] [-L] [-P] [-Olevel] [-D > help|tree|search|stat|rates|opt|exec] [path...] [expression] > > Am glad I am not the only one who makes this particular mistake. :-) > I committed a working version to subversion. +override_dh_python3: + dh_python3 + find debian/python3-django/usr/lib/python3/dist-packages/ -type f -not -name '*.py' | \ + (while read file; do \ + relname=$${file##debian/python3-django/usr/lib/python3/dist-packages/}; \ + reldirname=$$(dirname $$relname); \ + mkdir -p debian/python-django-common/usr/share/python-django-common/$$reldirname; \ + mv $$file debian/python-django-common/usr/share/python-django-common/$$reldirname/; \ + ln -sf /usr/share/python-django-common/$$relname $$file; \ + if test -e debian/python-django/usr/share/pyshared/$$relname; then \ + rm debian/python-django/usr/share/pyshared/$$relname; \ + ln -sf /usr/share/python-django-common/$$relname debian/python-django/usr/share/pyshared/$$relname; \ + else \ + rm debian/python-django/usr/lib/python2.7/dist-packages/$$relname; \ + ln -sf /usr/share/python-django-common/$$relname debian/python-django/usr/lib/python2.7/dist-packages/$$relname; \ + fi \ + done) + I had to use override_dh_python3 not override_dh_install, because the directory name is debian/python3-django/usr/lib/python3.4 then. The only problem with the package I can see only shows up when compiling against wheezy, suspect it might be because the dh-python I am using is old (1.20131021-1~bpo70+1) - I had problems building the latest version on wheezy. Whatever is doing it, it is kind of weird. $ cat debian/django-admin #!/bin/sh if test -x /usr/bin/python3 && test -e /usr/lib/python3/dist-packages/django/bin/django-admin.py then exec python3 /usr/lib/python3/dist-packages/django/bin/django-admin.py "$@" elif test -x /usr/bin/python2.7 && test -e /usr/lib/python2.7/dist-packages/django/bin/django-admin.py then exec python2.7 /usr/lib/python2.7/dist-packages/django/bin/django-admin.py "$@" else echo "Cannot find installed version of python-django or python3-django." >&2 exit 1 fi $ cat /usr/bin/django-admin #! /usr/bin/python3 && test -e /usr/lib/python3/dist-packages/django/bin/djan if test -x /usr/bin/python3 && test -e /usr/lib/python3/dist-packages/django/bin/django-admin.py then exec python3 /usr/lib/python3/dist-packages/django/bin/django-admin.py "$@" elif test -x /usr/bin/python2.7 && test -e /usr/lib/python2.7/dist-packages/django/bin/django-admin.py then exec python2.7 /usr/lib/python2.7/dist-packages/django/bin/django-admin.py "$@" else echo "Cannot find installed version of python-django or python3-django." >&2 exit 1 fi -- Brian May <br...@microcomaustralia.com.au>