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

Re: how to package python module as shared lib??



tomcato@iname.com writes:
> If I want to follow the policy, can I let one package install all .py files,
> libsolfege.so and data and documentation files, or do I have to make
> libsolfege0.deb (and maybe libsolfege0-dev.deb)? The library is simple
> and no other software project want to depend on a library created by
> me...

Put it all in one package.  C-modules for Python are not libraries
which non-Python applications can link so (they are equivalent, in
every way but what language they are written in, to Python modules),
so there is no need to put them in /usr/lib or to make -dev packages.

A few other hints:

  - for Python to be able to import a .so module, you should name it
    either <name>.so  or  <name>module.so, for instance if I want to
    be able to access a particular module as "import pisock" I should
    call it "pisock.so" or "pisockmodule.so" and put it in an
    appropriate place on the Python module path
    (i.e. /usr/lib/python1.5/site-packages).

  - For building your module, check out
    /usr/lib/python1.5/config/Makefile.pre.in if you have not done so
    already.

If you want to see examples, most of the packages I maintain have
Python C modules in them, and are fairly simple.  For example, see:
python-kjbuckets, python-mxstack, python-mxtools, python-mxdatetime,
or for larger examples python-xml or pyrite.

--Rob

-- 
Rob Tillotson  N9MTB  <robt@debian.org>


Reply to: