A cookiecutter template to make a Debian package from an application's existing Python package as released to PyPI or a private repository. It creates a project to build a self-contained Python virtualenv wrapped into a Debian package (an "omnibus" package, all passengers on board). The packaged virtualenv is kept in sync with the host's interpreter automatically.
The similar dh-virtualenv-mold adds packaging metadata to an existing Python project under your control. That one should also be used when you want to contribute Debian packaging to an upstream project.
In case you don't have the
cookiecutter command line tool yet, here's
how to install it.
Using the template
Creating the packaging project goes like this (make sure you're in a suitable directory like
cookiecutter https://github.com/Springerle/debianized-pypi-mold.git cd ‹projectname› dch -r "" # add a proper distro and date to the changelog
It makes sense to
git init the created directory directly afterwards, and
git add all files,
so that you have the template version of files saved in the git staging area.
Do that before any additional files are generated, that you don't want to have in your repository.
Next check all the files for necessary changes regarding the software your're packaging.
The template makes some assumptions that often fit, but there's always some differences in details.
Delete anything you do not need, e.g. from the list of build dependencies.
TODO to make sure you did not overlook things that typically have to be changed.
For Python3, you should look into the files
and adapt them accordingly.
The license used for the packaging project is “BSD 3-clause”, change the
file and “BSD” references in
setup.py as needed.
See the template's README for more information on how to actually build the DEB package.