Differences between revisions 6 and 11 (spanning 5 versions)
Revision 6 as of 2012-12-28 00:44:24
Size: 2982
Editor: 5634c85f
Comment:
Revision 11 as of 2012-12-28 17:50:07
Size: 64
Editor: 5634c85f
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<TableOfContents>> #acl: All:read
Line 3: Line 3:
= Building a Simple Python Package =

Given a simple, i.e. no extra data or extensions, debian package with sub-packages this section explains how to make a Debian Python2 and Python3 package from it.

Assume that package `pack` has an `__init__.py`, some modules, and a hierarchy of sub-packages with their own `__init__.py` and modules. At the level of the folder `pack` put a `debian` folder with the files described in the following sections.

== Debian Policy Files ==

The following files are requred by the [[http://www.debian.org/doc/manuals/maint-guide/dreq.en.html|Chapter 4. Required files under the debian directory]] in the [[http://www.debian.org/doc/manuals/maint-guide/index.en.html|Debian New Maintainers' Guide]].

=== changelog ===

Following the debian changelog format described by [[http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog|4.4 Debian changelog: debian/changelog]] of the [[http://www.debian.org/doc/debian-policy/index.html|Debian Policy Manual]]. E.g.
{{{
math3d (2.0.0) unstable; urgency=low

  * Major upgrade.
  * Rudimentary reference system feature.
  * Much PEP8 update.
  * Prepared for Python3.
  * Header string replaces by __ variables.
  * Local imports by leading "." or "..".
  * Partly converted to np.float64 as basic type.
  * Use of properties, partially replacing __getattr__ and __setattr__.
  * Revised constructors for some classes.
  * New build system with debhelper, for both Python2 and Python3 packages.

 -- Morten Lind <morten@lind.dyndns.dk> Thu, 26 Dec 2012 00:45:00 +0100

math3d (1.3.1) unstable; urgency=low

  * Bugfix: Use of _eps imported from utils.

 -- Morten Lind <morten@lind.dyndns.dk> Thu, 20 Dec 2012 21:46:43 +0100

...
}}}

=== control ===

Specifies name, description, Python versions, etc. Source stanza and stancas for Python2 and Python3 must be given separately. E.g.
{{{
Source: math3d
Section: python
Priority: extra
Maintainer: Morten Lind <morten@lind.dyndns.dk>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.3
Homepage: http://launchpad.net/pymath3d
X-Python-Version: >= 2.6
X-Python3-Version: >= 3.1

Package: python-math3d
Architecture: all
Depends: ${python:Depends}, python-numpy, ${misc:Depends}
Description: 3D Special Euclidean mathematics package for Python.

Package: python3-math3d
Architecture: all
Depends: ${python3:Depends}, python3-numpy, ${misc:Depends}
Description: 3D Special Euclidean mathematics package for Python.
}}}

=== rules ===

This file can be immensly complex, and describes how dpkg-buildpackage is to build the package. It should be as simple as
{{{
%:
   dh $@ --with python2,python3
}}}

== Files for DebHelper ==

For package building with debhelper, the following files should also be found

 * `compat`: Contains a single number which determines the compatibility mode for debhelper. This should be 7 or higher.
 * `
<<ChildPages(title=<h2>Debian Howtos</h2>)>>

MortensPages/DebianHowtos (last edited 2012-12-28 17:50:07 by 5634c85f)