A utility for creating Debian packages (.deb)
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 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.
Debreate & libdbr are licensed under MIT.
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:
Instructions for the build utilities are included within the source package in a directory labelled "debian".
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.
Debreate requires the following software:
These packages are recommended to enable some features:
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.
The build script is invoked as python3 build.py [args]
or ./build.py [args]
.
-h|--help
-v|--version
-V|--verbose
-l|--log-level <level>
-t|--task <task>
-p|--prefix <directory>
-d|--dir <directory>
stage
install
--prefix
argument.uninstall
--prefix
argument.dist-source
dist-bin
dist-deb
clean
clean-stage
clean-deb
clean-dist
update-version
test
check-code
changes
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.
If you have 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 or QAPT.
To run without installation simply execute the file named "init.py" (from a terminal ./init.py
or
python3 init.py
).
Sorry, not up-to-date usage information yet. But you can have a look at this old PDF document if you like.