Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an ubuntu/debian package for a twistd/twisted plugin?

As a follow-up to How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?, how does one make a debian package for a twisted plugin?

Assuming the setup.py is properly written, using cdbs/python-central/dh_python2 should just work, but I haven't had much luck so far.

The trick with those tools is that they basically run 'python setup.py install --root=' and then package up whatever ends up in '', so perhaps once the previous question is properly answered, then this question becomes moot?

Anyone here has successfully packaged a twisted plugin for debian?

like image 882
Sidnei Avatar asked Sep 01 '11 19:09

Sidnei


2 Answers

Apparently the issue is with 'python-support', which is plain broken when it comes to twisted plugins.

This message from Ubuntu's Matthias Klose explains the issue and offers a solution:

packaging of twisted plugins with python-support is broken by design. Even python policy mentions explicitly that you should use the same packaging helper for packages sharing the same python namespace.

You should use dh_python2 for that, or (deprecated) build with dh_pycentral using `include-links'.

-- Matthias Klose

like image 126
Sidnei Avatar answered Oct 31 '22 19:10

Sidnei


Argh, I've tried to do this and failed. I think it's possible depending on which Debian/Ubuntu releases you want to target, and how much effort you want to put in.

There are two approaches:

  1. Have your package stick the plugin file in twisted/plugins/ in the twisted tree. This is a pain because Twisted is packaged using different methods in different releases (python-support in Lucid vs dh_python2 in Natty IIRC) and (roughly speaking) your package needs to be packaged the same way as Twisted is to make this work.
  2. Have a twisted/plugins/ directory installed alongside your code. Then, IIRC, the problem becomes having the forest of symlinks that gets created include the twisted directory (as it's not a package).
like image 30
mwhudson Avatar answered Oct 31 '22 20:10

mwhudson