Differences between revisions 6 and 7
Revision 6 as of 2012-12-28 00:44:24
Size: 2982
Editor: 5634c85f
Comment:
Revision 7 as of 2012-12-28 10:01:42
Size: 3718
Editor: 5634c85f
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
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. Assume that an example, top-level package `math3d` has an `__init__.py`, some modules, and a hierarchy of sub-packages with their own `__init__.py` and modules. The example here has the tree layout as follows:
~-{{{
math3d/
├── interpolation
│   ├── __init__.py
│   ├── r3interpolation.py
│   ├── se3interpolation.py
│   └── so3interpolation.py
├── reference_system
│   ├── frame.py
│   └── __init__.py
├── __init__.py
├── orientation.py
├── quaternion.py
├── transform.py
├── utils.py
└── vector.py
}}}-~

At the level of the folder `math3d` put a `debian` folder with the files described in the following sections. A directory view of the `debian` folder reads as follows:
~-{{{
debian/
├── changelog
├── compat
├── control
├── python3-math3d.install
├── python-math3d.pyinstall
└── rules
}}}-~
Line 16: Line 44:
{{{ ~-{{{
Line 39: Line 67:
}}} }}}-~
Line 44: Line 72:
{{{ ~-{{{
Line 64: Line 92:
}}} }}}-~
Line 69: Line 97:
{{{ ~-{{{
Line 72: Line 100:
}}} }}}-~

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 an example, top-level package math3d has an __init__.py, some modules, and a hierarchy of sub-packages with their own __init__.py and modules. The example here has the tree layout as follows:

math3d/
├── interpolation
│   ├── __init__.py
│   ├── r3interpolation.py
│   ├── se3interpolation.py
│   └── so3interpolation.py
├── reference_system
│   ├── frame.py
│   └── __init__.py
├── __init__.py
├── orientation.py
├── quaternion.py
├── transform.py
├── utils.py
└── vector.py

At the level of the folder math3d put a debian folder with the files described in the following sections. A directory view of the debian folder reads as follows:

debian/
├── changelog
├── compat
├── control
├── python3-math3d.install
├── python-math3d.pyinstall
└── rules

Debian Policy Files

The following files are requred by the Chapter 4. Required files under the debian directory in the Debian New Maintainers' Guide.

changelog

Following the debian changelog format described by 4.4 Debian changelog: debian/changelog of the 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.

  • `

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