5

I am trying to package my Python software with stdeb:

python setup.py --command-packages=stdeb.command bdist_deb

which works fine.

Unfortunately, stdeb adds the variable ${python:Depends} to the debian/control file. This placeholder is automatically processed by dh_python2 from debhelper and gets replaced by a string containing multiple Python versions, e.g.: "python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8)".

How can I get rid of these automatically added Python versions or how can I override ${python:Depends}?

Note: The actual problem is the python dependency. The target system provides the package python2.7 with version 2.7.3, but python is still at 2.6.6.

w177us
  • 332
  • 5
  • 13

2 Answers2

1

What you actually need to do instead is to add something like X-Python-Version: >= 2.6 to source package in debian/control and to add python-all or python-all-dev to Build-Depends. This will work if you're building for the right suite where python-all depends on both python2.6 and python2.7. It is a good idea to use pbuilder in order to build for target system especially if it is different from your development environment. Please do not override ${python:Depends} -- it is wrong and will do no good.

Onlyjob
  • 5,692
  • 2
  • 35
  • 35
  • I ended up hacking the file `util.py` right within stdeb's source code. I replaced `${misc:Depends}` and `${python:Depends}` with the desired Python dependency I need. But you're correct: The best way would be to use `pbuilder`. – w177us Aug 05 '13 at 09:36
  • What you're doing is shocking. Just replace `${python:Depends}` in `debian/control` with `${my:Depends}` and add `override_dh_gencontrol` to `debian/rules` as follows: `dh_gencontrol -- -Vmy:Depends="pkg1, pkg2"` – Onlyjob Aug 06 '13 at 04:04
  • Can you give more details about using pbuilder? – Mu Mind Oct 25 '14 at 06:07
  • See http://pbuilder.alioth.debian.org, [pbuilder\(8\)](http://manpages.debian.org/cgi-bin/man.cgi?query=pbuilder&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en), https://wiki.debian.org/PbuilderTricks – Onlyjob Oct 27 '14 at 02:52
0

You can force the stdeb python dependencies through XS-Python-Version option. For instance, by creating stdeb.cfg file with:

[DEFAULT]
XS-Python-Version: 2.6

Other means to set this options may be setupg.cfg in [sdist_dsc] section, or in command line (sdist_desc --xs-python-version 2.6 bdist_deb) but it did not actually work for me.

FabienAndre
  • 4,514
  • 25
  • 38