[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: packaging python modules with .so files?

On Wed, Mar 14, 2007 at 08:26:36PM +0100, martin f krafft wrote:
> I am trying to package lightblue.sf.net, which does the following
> during installation:
>   piper:.> python ./setup.py install --prefix=debian/python-lightblue/usr --no-compile
>   running install
>   running build
>   running build_py
>   running build_ext
>   running install_lib
>   creating debian/python-lightblue
>   creating debian/python-lightblue/usr
>   creating debian/python-lightblue/usr/lib
>   creating debian/python-lightblue/usr/lib/python2.4
>   creating debian/python-lightblue/usr/lib/python2.4/site-packages
>   copying build/lib.linux-x86_64-2.4/_lightblueutil.so -> debian/python-lightblue/usr/lib/python2.4/site-packages
>   copying build/lib.linux-x86_64-2.4/_obexutil.so -> debian/python-lightblue/usr/lib/python2.4/site-packages
>   creating debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/_obex.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/__init__.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/obex.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/_discoveryui.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/_lightbluecommon.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
>   copying build/lib.linux-x86_64-2.4/lightblue/_lightblue.py -> debian/python-lightblue/usr/lib/python2.4/site-packages/lightblue
> As you can see, it installs compiled .so files, making the package
> dependent on the python ABI, 2.4 in this case.
> How am I to deal with packages like this?

  You build two times, using python$VER ./setup.py install blablabla for
each $VER in pyversions -s. Then you call (if you're using debhelper)
dh_py{support,central}, just a matter of taste.

  If you use pycentral you will have to use quite complex debian/control
anotations, else you just have to put sth like 2.3- in your
debian/pyversions and let dh_pysupport do the work.

  In debian/control you have (for any of the previous) to use:
${python:Depends} in the Depends: line and ${python:Provides} in the
provides line.

  Doing that, you make your package binNMUable, and if ABI (meaning
supported versions) changes, a binNMU will do.

  Also don't forget to build-depends upon python-all-dev (that will pull
everything you need to build python packages) additionnaly to your usual
non python-ic build depends.

·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpViPXXhmHhu.pgp
Description: PGP signature

Reply to: