SkillAgentSearch skills...

Debreate

A utility for creating Debian packages (.deb)

Install / Use

/learn @debreate/Debreate

README

Debreate - Debian Package Builder

<a name="toc"> <h2>Table of Contents</h2> </a> <a name="description"> <h2><a href="#toc">Description</a></h2> </a>

Debreate is a utility to aid in creating Debian (.deb) packages. Currently it only supports binary packaging (note that the term "binary package" is used loosely, as such packages can contain scripts & non-code items such as media images, audio, & more) for personal distribution. Plans for using backends such as dh_make & [debuild][pkg.devscripts] for creating source packages are in the works. But source packaging can be quite different & is a must if you want to get your packages into a distribution's official repositories or a Launchpad Personal Package Archive (PPA). The latter from which [Debreate is available][ppa.debreate].

<a name="licensing"> <h2><a href="#toc">Licensing</a></h2> </a>

Debreate & [libdbr][proj.gh.libdbr] are licensed under MIT.

<a name="explanation"> <h2><a href="#toc">Explanation</a></h2> </a>

The definition of "Debian source package" may be a little confusing, as it was for me, for those that are new to the Debian format, or perhaps new to packaging in general. Debian source packages are essentially no different than common tarballed source archives & they can be available in many of the popular formats such as Gzip (.tar.gz), BZip2 (.tar.bz2), XZ (tar.xz), Lzip (tar.lzip), et al.

To build Debian binary packages (.deb) from source, it must first be "debianized". A source package can be debianized using one of two methods:

  1. internal/native:

    Instructions for the build utilities are included within the source package in a directory labelled "debian".

  2. external:

    Instructions are contained within a separate package distributed alongside the original source.

The debian directory, or package, contains files with instructions & meta data on how the source is to be patched, compiled, & built into a binary format.

Source packaging is a must for inclusion of software in official repositories or PPAs. The debianized package is uploaded to repo/PPA host server where it is built into a binary package & published for release in .deb format. This differs from systems such as Arch's ABS & FreeBSD's Ports build systems where only the instructions files are stored on the host server. Downloading of source packages from the upstream maintainer is done as part of the build process.

<a name="requirements"> <h2><a href="#toc">Requirements</a></h2> </a>

Debreate requires the following software:

  • Python (>=3.10) ([Ubuntu package][pkg.python3])
  • wxPython (>=4.0.7, >=4.2.0 recommended)
    • Packaged as [python3-wxgtk*][pkg.wxpython] on Debian/Ubuntu.
    • Available via Pypi.
  • dpkg ([Ubuntu package][pkg.dpkg])
    • If you are running a Debian/Ubuntu based system this is most likely already installed.
  • fakeroot ([Ubuntu package][pkg.fakeroot])

These packages are recommended to enable some features:

  • lintian ([Ubuntu package][pkg.lintian])
<a name="build"> <h2><a href="#toc">Building</a></h2> </a> <a name="build-script"> <h3><a href="#toc">Build Script</a></h3> </a>

The software comes bundled with a build.py script to facilitate the build process & other tasks. Note that Debreate is written in a scripting language, so building does not include any compiling of source code. The build script is used for staging the necessary files into a directory structure for packaging & installation.

<a name="build-script-usage"> <h4>Script Usage</h4> </a>

The build script is invoked as python3 build.py [args] or ./build.py [args].

<a name="build-script-args"> Arguments: </a>
  • -h|--help
    • Show help information.
  • -v|--version
    • Show Debreate version.
  • -V|--verbose
    • Include detailed task information when printing to stdout.
  • -l|--log-level <level>
    • Logging output verbosity.
    • Levels are 0 (silent), 1 (error), 2 (warn), 3 (info), & 4 (debug).
  • -t|--task <task>
  • -p|--prefix <directory>
    • Path prefix to directory where files are to be installed.
  • -d|--dir <directory>
    • Target directory (defaults to system root). This is useful for directing the script to place files in a temporary directory rather than the intended installation path. It is equivalent to the "DESTDIR" environment variable used by GNU make.
<a name="build-script-tasks"> Build Tasks: </a>
  • stage
    • Prepare files for installation or distribution.
  • install
    • Install files to directory specified by --prefix argument.
  • uninstall
    • Uninstall files from directory specified by by --prefix argument.
  • dist-source
    • Build a source distribution package.
  • dist-bin
    • Build a portable binary .zip distribution package.
  • dist-deb
    • Build a binary Debian distribution package.
  • clean
    • Remove all temporary build files.
  • clean-stage
    • Remove temporary build files from 'build/stage' directory.
  • clean-deb
    • Remove temporary build files from 'debian' directory.
  • clean-dist
    • Remove built packages from 'build/dist' directory.
  • update-version
    • Update relevant files with version information from 'build.conf'.
  • test
    • Run configured unit tests from 'tests' directory.
  • check-code
    • Check code with [pylint][proj.pylint] & mypy.
  • changes
    • Print most recent changes from 'doc/changelog' to stdout.
<a name="build-make"> <h3><a href="#toc">Makefile</a></h3> </a>

A generic Makefile is included for building with a GNU compliant make command. It is simply a wrapper for the targets executed by the build.py script. Open a terminal in the directory where the source code is located & execute make install with superuser privileges. To uninstall, execute make uninstall. Use the environment variables prefix & DESTDIR to control the installation target directory.

<a name="build-deb"> <h3><a href="#toc">Building .deb Package</a></h3> </a>

If you have [devscripts][pkg.devscripts] installed, you can execute python3 build.py dist-deb to build the debian package (.deb). The package will be located in the 'build/dist' directory. To install execute dpkg --install build/dist/debreate_\<version\>_all.deb with superuser privileges. Or open the package with a GUI installer such as [gdebi][pkg.gdebi] or [QAPT][pkg.qapt].

<a name="portable"> <h2><a href="#toc">Standalone/Portable</a></h2> </a>

To run without installation simply execute the file named "init.py" (from a terminal ./init.py or python3 init.py).

<a name="usage"> <h2><a href="#toc">Usage</a></h2> </a>

Sorry, not up-to-date usage information yet. But you can have a look at this old PDF document if you like.

<a name="links"> <h2><a href="#toc">Links</a></h2> </a> <a name="links-proj"> <h3><a href="#toc">Project Pages</a></h3>
  • Homepage
  • [GitHub project][proj.gh]
  • [GitLab project][proj.gl]
  • [SourceForge project][proj.sf]
  • [PPA][ppa.debreate]
  • [Development PPA][ppa.debreate-dev]
<a name="links-dl"> <h3><a href="#toc">Downloads</a></h3> </a>
  • stable
  • latest
  • [PPA stable][ppa.debreate]
  • [PPA development][ppa.debreate-dev]
<a name="links-other"> <h3><a href="#toc">Other Pages</a></h3> </a>

Related Skills

View on GitHub
GitHub Stars134
CategoryDevelopment
Updated1mo ago
Forks23

Languages

Python

Security Score

100/100

Audited on Feb 8, 2026

No findings