Home

debianrules

In Debian packaging, debian/rules refers to the build script that governs how a source package is built. It is a Makefile located in the debian directory of the upstream source tree and is invoked by packaging tools such as dpkg-buildpackage or debuild to produce binary packages.

The primary purpose of debian/rules is to orchestrate the sequence of steps used to configure, build, install,

Structure and style vary, but most rules files follow two broad approaches. The simple approach uses debhelper

Relations and usage: debian/rules interacts with other packaging metadata in the debian directory, such as debian/control

and
package
software.
The
file
can
be
small
and
delegate
most
work
to
debhelper,
a
collection
of
helper
programs,
or
it
can
be
a
larger,
custom
script
that
performs
specialized
build
steps.
A
common
modern
pattern
is
a
minimal
rules
file
that
delegates
to
the
dh
tool,
enabling
a
standard,
repeatable
build
process
across
many
packages.
Maintainers
can
still
customize
behavior
by
defining
override_dh_*
targets
to
adjust
specific
stages
such
as
auto_configure,
auto_build,
or
auto_install.
with
a
basic
skeleton,
while
more
complex
builds
implement
custom
logic
for
nonstandard
build
systems.
Regardless
of
style,
the
file
must
be
executable
and
is
designed
to
reflect
the
package’s
build
requirements,
including
dependencies
and
environment
flags.
and
debian/changelog,
and
with
the
build
environment
provided
by
tools
like
pbuilder
or
sbuild.
Correctly
maintained,
it
enables
reproducible
builds
and
consistent
packaging
across
architectures.