DPATCH.MAKE(7)
π 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:
- include the file in
debian/rules - change the appropriate targets to depend on
patchandunpatch - 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 isdebian/patched. πDPATCH_STAMPFNβ the name of the stamp file, which contains the patch descriptions and other possible meta-data. default value ispatch-stamp. π·οΈDPATCH_PREDEPSβ a list ofmaketargets 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 todebian/patches/00listβ that is, if this variable is not empty, the contents of00listwill 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 phonypatchtarget directly from thebuildtarget may cause thebuildtarget to be reevaluated even when there is no change to be done. instead, try makingbuild-stampdepend onpatch-stampas 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
- Copyright (C) 2003 Gergely Nagy <algernon@bonehunter.rulez.org>
- Copyright (C) 2007 Junichi Uekawa <dancer@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms