deb-src-rules(5)

πŸ’… deb-src-rules β€” the manual page, but make it make sense ✨

okay so this is deb-src-rules(5) from the dpkg suite, bestie β€” it's the whole guide to that one file every Debian packager has a love-hate relationship with 🫢


🌸 NAME 🌸

deb-src-rules β€” the Debian source package rules file, aka the blueprint of your whole build πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

debian/rules

that's it. that's the file. it lives at debian/rules and it runs the show πŸ‘‘


✨ DESCRIPTION ✨

okay so picture this: this file contains the instructions necessary to build the binary packages from the source package. like, the whole recipe. the main character of your packaging directory, fr fr 🌈

The debian/rules file is an executable Makefile β€” yes, an actual Makefile β€” with a shebang that is usually set to this exact line:

#!/usr/bin/make -f

and it must support the following make targets. not "should", not "ideally" β€” must. these are non-negotiable bestie πŸ’…

  • clean β€” Clean up the source tree, by undoing any change done by any of the build and binary targets. like, full reset, no crumbs left behind 🧹 This target will be called with root privileges. yeah, root. be careful.
  • build-indep β€” Build architecture independent files required to build any architecture independent binary package. If there are no architecture independent binary packages to generate, the target must still exist but do nothing β€” it just vibes there, existing, doing nothing, and that's valid ✨ This target must not require root privileges.
  • build-arch β€” Build architecture dependent files required to build any architecture dependent binary package. If there are no architecture dependent binary packages to generate, the target must still exist but do nothing. same deal, it has to be there even if it's empty πŸ¦‹ This target must not require root privileges.
  • build β€” Build architecture independent and dependent files, either by depending (at least transitively) on build-indep and/or build-arch or by inlining what those targets would do. pick your fighter, both are valid πŸ’€ This target must not require root privileges.
  • binary-indep β€” Build architecture independent binary packages. This target must depend (at least transitively) on either build-indep or build, no exceptions. This target will be called with root privileges πŸ‘‘
  • binary-arch β€” Build architecture dependent binary packages. This target must depend (at least transitively) on either build-arch or build. This target will be called with root privileges πŸ”₯
  • binary β€” Build architecture independent and dependent binary packages, either by depending (at least transitively) on binary-indep and/or binary-arch or by inlining what those targets would do. big finale energy. This target will be called with root privileges ⭐
ngl the root privileges thing is not a drill β€” clean, binary-indep, binary-arch and binary all get called as root, while build-indep, build-arch and build must not require root. keep that vibe check in mind before you do anything wild 😭

πŸ’œ SEE ALSO πŸ’œ

the whole friend group, go say hi:


and that's the page, bestie πŸŽ€ this lil drop is version 1.23.11-dirty, dated 2026-09-09 β€” go build something iconic, ily, slay πŸ’–πŸ¦‹

πŸ“¦ where this page comes from