Your company here — click to reach over 10,000 unique daily visitors

debbuild - Man Page

Build Debian-compatible .deb packages from RPM .spec files

Short Description

Build .deb packages from RPM-style .spec files.

debbuild supports most package-building options rpmbuild does.


Build options with [ <specfile> | <tarball> | <source package> ]:

  -b.                        build from <specfile> ...
  -t.                        build from <tarball> ...
  -r.                        build from <source package> ...
        -.p      ... through %prep (unpack sources and apply patches)
        -.c      ... through %build (%prep, then compile)
        -.i      ... through %install (%prep, %build, then install)
        -.l      verify %files section
        -.a      ... source and binary packages
        -.b      ... binary package only
        -.s      ... source package only
  --rebuild (-rb)            build binary package from <source package>
  --recompile (-ri)          build through %install from <source package>
  --buildroot=DIRECTORY      override build root
  --short-circuit            skip straight to specified stage (only c,i)

Common options:

  -D, --define='MACRO EXPR'  define MACRO with value EXPR
  --with/--without FLAG      define build conditionals from FLAG
  -S, --scm=SCM              short for '--define "__scm SCM"'

debbuild-specific options:

  -i, --install              Unpack a .sdeb in the %_topdir tree
  --showpkgs                 Show package names that would be built.
  --nobuild                  Parse <specfile>, but do no processing


debbuild attempts to build Debian-friendly semi-native packages from RPM spec files, RPM-friendly tarballs, and RPM source packages (.src.rpm files).  It accepts most of the options rpmbuild does, and should be able to interpret most spec files usefully.  Perl modules should be handled via CPAN+dh-make-perl instead as it’s simpler than even tweaking a .spec template.

As far as possible, the command-line options are identical to those from rpmbuild, although several rpmbuild options are not supported:


Some of these could probably be trivially added.  Feel free to send me a patch.  ;)

Complex spec files will most likely not work well, if at all.  Rewrite them from scratch – you’ll have to make heavy modifications anyway.

If you see something you don’t like, mail me.  Send a patch if you feel inspired.  I don’t promise I’ll do anything other than say “Yup, that’s broken” or “Got your message”.

The source package container I invented for debbuild, the .sdeb file, can be installed with debbuild -i exactly the same way as a .src.rpm can be installed with rpm -i.  Both will unpack the file and place the source(s) and .spec file in the appropriate places in %_topdir/SOURCES and %_topdir/SPECS respectively.


As with rpmbuild, debbuild makes some assumptions about your system.


debbuild deliberately does a few things differently from rpmbuild.

Finding out what packages should be built (--showpkgs)

rpmbuild does not include any convenient method I know of to list the packages a spec file will produce.  Since I needed this ability for another tool, I added it.

It requires the .spec file for the package, and produces a list of full package filenames (without path data) that would be generated by one of --rebuild, -ta, -tb, -ra, -rb, -ba, or -bb.  This includes the .sdeb source package.


debbuild was written by Kris Deugau.  The present version was developed by Andreas Scherer, Neal Gompa, and others. It is available at <http://github.com/debbuild/debbuild>.


Funky Things Happen if you forget a command-line option or two.  I’ve been too lazy to bother fixing this.

Many macro expansions are supported, some are incompletely supported, some not at all.

The generated scriptlets don’t quite match those from rpmbuild exactly.  There are extra environment variables and preprocessing that I haven't needed (yet).

Documentation, such as it is, will likely remain perpetually out of date (in which way it follows in RPM’s tradition).

%_topdir and the five “working” directories under %_topdir could arguably be created by debbuild.  However, rpmbuild doesn't create these directories either.

See Also

rpm(8), rpmbuild(8), and pretty much any document describing how to write a .spec file.


2024-01-24 Release 20.04.0 System Manager's Manual