Home QbRpmBuilder Downloads Quick start
Note: Some content of this page can be obvious for some readers. This page intends to introduce the context and the different components. The objective is checking that QbRpmBuilder matches your needs.

Use case

To describe the role and the content of QbRpmBuilder, we can imagine a project that contains a software source code and a bunch of scripts to generate the linux packages.


During the build process, the project is deployed on different build platform (physical hardware, VM or docker containers).
Depending on the type of linux distribution of each build platform, a DEB or RPM package is generated.


Unfortunately, DEB packaging uses 'debhelper' and RPM packaging uses 'rpm-build'. These two tools requires different kind of scripts and configuration.

Of course it is possible to create 2 packaging modules in each project:
- a set of scripts compatible with 'debhelper' to generate DEB packages
- a set of scripts compatible with 'rpm-build' to generate RPM packages

QbRpmBuilder provides a more effective solution by unifying the packaging scripts.

Why is it important ?

Unifying DEB and RPM package generation is important because:
- it simplifies all your projects (one packaging module instead of two)
- it prevents developpers and maintainers from learning 2 packaging systems
- it simplifies packaging maintenance and prevents bugs due to any inconstancy between the 2 packaging configurations

For example, if a dependency is declared in the 'deb' packaging module and is missing (or declared with a different version) in the 'rpm' module, a critical bug can occures during the software installation or the software execution on RPM platforms.

What is exactly QbRpmBuilder ?

QbRpmBuilder assumes that the packaging scripts are based on the DEB packaging system (debhelper + devscripts).


QbRpmBuilder is a software component installed on the RPM build platforms. Its role is converting the DEB packaging scripts into a RPM package.


QbRpmBuilder re-implements some devtools commands (debchange) and debhelper commands (dh_testroot, dh_prep, dh_installdirs, dh_install, dh_link, dh_installdeb, dh_gencontrol, dh_builddeb)

Warning:
QbRpmBuilder is a (very) partial porting of the devtools/debhelper commands.
It does NOT re-implements all of them and the re-implemented methods are not fully supported (all the options are not supported). Currently, QbRpmBuilder supports the minimal set of commands to build a RPM package. Nevertheless the list of supported commands and supported options is growing.
The list of the supported commands (and their syntaxes) is available here: List of supported commands
If you want to discuss about the next implementations, a GitHub discussion is available here: GitHub discussion

Scriptlet execution order and script parameters

Usually, a packaging module contains a main script/configuration and several scriptlets:
    - preinst: scriptlet executed before the package installation
    - postinst: scriptlet executed after the package installation
    - prerm: scriptlet executed before the package removal
    - postinst: scriptlet executed after the package removal

An important feature provided by QbRpmBuilder is the preserving of the scriptlet execution order and the parameters passed to each scriptlets when the DEB scriptlets are executed on a RPM-based platform.
More info here: Scriptlets execution order

Alternatives

QbRpmBuilder is not the only tool to unify packaging for various linux distributions.
It's important to quote some alternatives that could be more relevant in some cases.
- FPM : Link to FPM
- alien : Link to Alien

FPM is a very easy-to-use tool and supports more packaging systems (solaris, OSX, ...).
It's a good choice to generate packages of projects with no scriptlets (or very simple scriptlets).
For example, this tool can be used to generate source packages (QbRpmBuilder only generates binary packages).

Alien is a versatile tool for converting packages from and to various formats (deb, rpm, tgz, pkg).
The main advantage of Alien is that it doesn't require the project source code.

Nevertheless, keep in mind that these tools (FPM and ALIEN) doesn't preserve the scriplets executions order and their parameters. As a consequence, QbRpmBuilder is more relevant for projects with non-trivial scriptlets.