Converting python-central based package to dh_python2
Step by step
- in debian/control:
- remove python-central from Build-Depends(-Indep)
- bump 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 a newer version)
- remove XB-Python-Version line(s)
- check if debian/*.install and other files need additions. dh_python2 ships the actual files in /usr/share/pyshared, plus the symlinks in /usr/lib/python2.x/*-packages.
- 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:]]*pycentral/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_pycentral/dh_python2/' debian/rules
remove debian/pyversions file and add X-Python-Version 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 what's foo's minimum required Python version, don't add this field and wait for bug report to bump it
(This ought to be merged into the python-support page too, and perhaps consolidated with the above.)
Some packages include /usr/share/pycentral-data/pycentral.mk for its sitedir definition. py_libdir from /usr/share/python/python.mk serves the same purpose, but note that it includes the /usr/lib/pythonX.Y/ prefix.
DH_PYCENTRAL=include-links can be dropped; dh_python2 does this by default.
Be careful to run a test build! In some cases this reveals new dependencies, because dh_python2 guesses dependencies from egg-info metadata, so if that metadata is wrong then new dependencies may appear. Sometimes the correct fix is to fix the metadata; in other cases the path of least resistance may be to use dh_python2 --no-guessing-deps.
- dh_python2 was released with squeeze. Backports to squeeze with these changes should work there too.
Bug and Status Tracking
Packages which Build-Dep on python-central: