[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Add Python3 support to python-support packages: howto?



[Sandro Tosi, 2010-09-14]
> how to do that for a package using python-support?

* add python3 or python3-all or python3-all-dev to Build-Depends(-Indep)
  (+ python3-all-dbg for -dbg package)
* add python3-foo binary package (with ${python3:Depends} in Depends)
* optionally: set minimum required Python 3 version via X-Python3-Version
* build extensions for all `py3versions -vr` versions
* for dh "rules.tiny" packages:
  - add "--with python3" to dh call (`--with python2,python3` will also 
    use dh_python2), or:
  - override_dh_pysupport:
    	dh_pysupport
	dh_python3
* for all other debian/rules (including CDBS for now):
  invoke dh_python3 (make sure to do that before dh_strip in arch:any
  packages)

Notes:
* you can use -p and -N with dh_py* tools to decide which one should
  handle private directories, dh_python3 ignores public Python 2.X locations
* if you need to change files in dist-packages directory, you can use
  py_libdir & py_pkgname¹ macros to get the right directory or use
  something like:

    pkgdir = $(CURDIR)/debian/python$(if $(patsubst 3.%,,$(1)),,3)-mako

[¹] available in /usr/share/python/python.mk since python 2.6.6-2
    and in /usr/share/python3/python.mk since 3.1.2-7
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: