Converting python-support based package to dh_python2
Step by step
- Check if you can do the switch (all packages that use the same namespace have to be converted at the same time).
apt-file search -lix '(packages|pyshared)/foo' might help finding packages with the same namespace (replace foo with your namespace).
- In debian/control:
- Remove python-support from Build-Depends(-Indep).
Increase minimum required python-all (or python or python-all-dev) package version to 2.6.6-3~.
- (read /usr/share/doc/python/changelog.Debian.gz to check if you need newer version)
- Remove XB-Python-Version fields.
- if you use CDBS:
bump minimum required cdbs version to 0.4.90~
Remove the DEB_PYTHON_SYSTEM line, e.g. sed -i -e '/DEB_PYTHON_SYSTEM[[:space:]]*[?:]*=[[:space:]]*pysupport/d' debian/rules
- if any of the modules are in a (Debian binary) package whose name isn't "python-*", set DEB_PYTHON2_MODULE_PACKAGES in debian/rules to the space-separated list of (Debian binary) package names you're building.
- if you use dh sequencer:
- add "python2" to dh's --with
- if you use pure debhelper:
sed -i -e 's/dh_pysupport/dh_python2/' debian/rules
Remove debian/pyversions file and add an equivalent X-Python-Version field in debian/control instead.
(see policy for syntax, example: ">= 2.5")
XS-Python-Version is still supported, but consider replacing it with X-Python-Version (same syntax, except current and all keywords are gone).
If you don't know foo's minimum required Python version, don't add this field until a bug report informs you that foo doesn't work with an older Python version.
If you depend on python-support's "namespace feature", remember to provide namespace (__init__.py file) only in one binary package. Create a new binary package, python-foo-common, if you cannot use and existing binary package. dh_python2 will include all __init__.py files, including empty ones.