HOWTO convert package to python-central ======================================= 1) debian/control * source package: - add XS-Python-Version: header with list of python versions that package supports. Examples: all / >=2.3 / 2.3, 2.4 / >=2.3, <<2.6 / current - extend Build-Depends: header with: debhelper (>= 5.0.38), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6) - for Egg support (optional) extend Build-Depends: header with: python-setuptools (>= 0.6b3-1) * binary package: - add/extend headers: Depends: ${python:Depends} XB-Python-Version: ${python:Versions} - change Architecture: to "all" ("any" if package contains arch dep files) - if previous package version had python2.X-foo packages, add: Conflicts: python2.X-foo (<< current_version) Replaces: python2.X-foo (<< current_version) - extend Provides: header with: + ${python:Provides} if your package is arch "any" + list of pythonX.Y-foo packages that external packages still depend on [1] * remove python2.X-foo binary packages 2) debian/rules * build modules for all python versions specified in XS-Python-Version, example rules: PYVERS=$(shell pyversions -vr) build: $(PYVERS:%=build-python%) touch $@ build-python%: python$* setup.py build touch $@ install: build $(PYVERS:%=install-python%) install-python%: python$* setup.py install --root $(CURDIR)/debian/python-foo * replace dh_python with dh_pycentral in binary rule * If the public modules can't be shared, add export DH_PYCENTRAL=nomove at the top of debian/rules * Egg support (optional): - add "--single-version-externally-managed" option to setup.py install command - remove python's version from Egg's dirname - remove *-nspkg.pth file 3) debian/{postinst,prerm} * remove unneeded postinst and prerm files, debhelper will generate them now 4) example packages http://wiki.debian.org/DebianPython/NewPolicy#head-361ba69b3cd19d9b6bab84fbac6099268ddb3366 # package without .so files apt-get source pyparallel # package with .so files apt-get source python-imaging # package with .so files and Egg support apt-get source pyenchant 5) useful links: http://www.debian.org/doc/packaging-manuals/python-policy/ http://wiki.debian.org/DebianPython/NewPolicy [1] remove that list as soon as external packages will depend on python-foo only