DPATCH.MAKE(7)

πŸ“¦ version 2.0.41, in ubuntu jammy

πŸ’… DPATCH.MAKE β€” the manual page, bestie edition πŸ’…

okay so this is dpatch.make(7), part of the dpatch manual. it's the little makefile glue that lives at /usr/share/dpatch/dpatch.make and it is literally just here to make your debian/rules life easier. she's simple, she's iconic, she's deprecated (we'll get to that 😭).


✨ NAME ✨

dpatch.make β€” a simplistic wrapper around dpatch(1) for make(1).

no cap. that's the whole job description.


πŸŽ€ SYNOPSIS πŸŽ€

include /usr/share/dpatch/dpatch.make

that's it. that's the summoning ritual. πŸ•―οΈ


πŸ¦‹ DESCRIPTION πŸ¦‹

so for backwards compatibility and general ease of use, dpatch.make ships right alongside dpatch(1). her whole purpose? to implement generic patch and unpatch rules that you can just reuse in your debian/rules scripts. main character energy: she does the boring stuff so you don't have to. πŸ’–


⚠️ WARNING ⚠️

dpatch is DEPRECATED, bestie. please switch to the 3.0 (quilt) Debian source package format instead. fr fr, it's time. 🚨

there's a short guide on how to do it right here:

http://wiki.debian.org/Projects/DebSrc3.0#FAQ

go read it. i'll wait. πŸ™ˆ


🌸 USAGE 🌸

using dpatch.make is rather straightforward:

  1. include the file in debian/rules
  2. change the appropriate targets to depend on patch and unpatch
  3. that's it. that's all it takes. periodt. πŸ’…

figuring out what the appropriate target is? that's where the thinking comes in, and honestly it's giving ✨brain teaser✨. generally you've got a build target, or config.status, or configure (or any of these with a -stamp suffix). most of the time these get called first during the build, so one of these β€” the one that exists and is not depended upon by another one β€” has to be modified to depend on the patch target in dpatch.make.

doing the same for the clean target is way easier, thank god. you literally just rename the old rule to, say, clean-patched, then make a brand new one that has clean-patched and unpatch in its list of prerequisites. slay. 🫢


πŸ’œ CUSTOMISATION πŸ’œ

there are a few variables used by dpatch.make that you can set before including it, so you can nudge the system's behaviour a little. here they are, bestie:

  • DEB_SOURCE_PACKAGE β€” the name of the source package, used when creating the stamp file. by default, it is empty. (she's mysterious like that.)
  • DPATCH_STAMPDIR β€” the directory where stamp files get put. default is debian/patched. πŸ“
  • DPATCH_STAMPFN β€” the name of the stamp file, which contains the patch descriptions and other possible meta-data. default value is patch-stamp. 🏷️
  • DPATCH_PREDEPS β€” a list of make targets to call before applying the dpatch.
  • DPATCH_WORKDIR β€” the target directory to apply patches to. by default, it is the current directory. πŸ“
  • PATCHLIST β€” the list of patches to apply. this is an alternative to debian/patches/00list β€” that is, if this variable is not empty, the contents of 00list will be ignored, and this variable will be used instead. choose your fighter. βš”οΈ

🌈 EXAMPLE 🌈

here's the vibe, verbatim, no edits:

include /usr/share/dpatch/dpatch.make

build: build-stamp
build-stamp: patch-stamp
    ${MAKE}
    touch build-stamp

clean: clean1 unpatch
clean1:
    ${MAKE} clean
    rm -rf debian/files debian/substvars debian/imaginary-package

.PHONY: patch unpatch ...
    .
    .
    .

see how build-stamp depends on patch-stamp and not on the phony patch target? that's the move. πŸ‘‘


😭 SIDE EFFECTS 😭

using dpatch.make instead of calling dpatch directly has one side effect: it will create a file called patch-stamp containing some meta-information extracted from the scriptlets. she leaves a little footprint. 🐾

depending on a phony patch target directly from the build target may cause the build target to be reevaluated even when there is no change to be done. instead, try making build-stamp depend on patch-stamp as specified in this example. trust. πŸ™

πŸ‘‘ AUTHOR πŸ‘‘

originally by Gergely Nagy. modified by Junichi Uekawa. legends, honestly. 🫑


πŸ’– SEE ALSO πŸ’–


and that's the whole page, bestie!! this was DPATCH 2, dated Dec 13 2011 β€” yeah, she's a vintage icon, an elder statesgirl of Debian packaging πŸŽ€βœ¨ go forth and migrate to 3.0 (quilt), i'm rooting for you πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from
  • ubuntu jammy: dpatch 2.0.41 Β· GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms