DH_INSTALLEXAMPLES(1)
π DH_INSTALLEXAMPLES β bestie, let's install some examples π
okay so this is a page from the debhelper manual, and it's all about dh_installexamples. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
dh_installexamples β the tool that puts your example files into your package build directories. she's giving "show them how it's done" energy. π
πΈ SYNOPSIS πΈ
dh_installexamples [debhelper options] [-A] [-Xitem] [file ...]
π¦ DESCRIPTION π¦
so like, dh_installexamples is a debhelper program and her whole job β her entire main character arc β is installing examples into usr/share/doc/package/examples inside your package build directories. that's it. that's the gig. π
and here's a lil something you need to know: starting from debhelper compatibility level 11 on, dh_install will fall back to looking in debian/tmp for files if it doesn't find them in the current directory (or wherever you told it to look with --sourcedir). so it's got a backup plan. she's prepared. β¨
π FILES π
debian/package.examplesβ this file lists the example files or directories you want installed. iykyk.
real talk though: if upstream ships an examples directory, you're usually gonna want to write examples/* in this file instead of just examples. why?? because the plain examples would create /usr/share/doc/package/examples/examples, which is lowkey never what you actually want. nested examples directories?? it's giving redundant. π
also it supports substitution variables in compat 13 and later, as documented over in debhelper(7). slay.
π§ OPTIONS π§
-A,--allβ install any files specified by the command line parameters in ALL packages acted on. all of them. every single one. no cap.--sourcedir=dirβ look in the directory dir for files to be installed. heads up bestie, this option requires compat 11 or later β in compat 10 or earlier it's just silently ignored. π
β οΈ and no, this is not the same as the--sourcedirectoryoption that thedh_auto_*commands use. don't mix them up, they're different girlies. also, you rarely even need this option, becausedh_installexamplesautomatically looks for files indebian/tmpin debhelper compatibility level 11 and above. so like, chill. π«Ά
--doc-main-package=main-packageβ set the main package for a documentation package. this is used to install the documentation of the documentation package into/usr/share/doc/main-package, as recommended by the Debian policy manual 3.9.7 in Β§12.3. very official. very demure. π
in compat 11 (or later), this option is only useful if debhelper's auto-detection of the main package is wrong. it can also be used to silence a warning from debhelper when the auto-detection fails but the default happens to be correct. so basically it's the "shhh, i got this" button. π€«
π¨ this option cannot be used whendh_installexamplesis instructed to act on multiple packages. if you need it, you'll generally need to combine it with-pto make sure exactly one package is acted on. one package. singular. periodt.
the X-Doc-Main-Package field can be used instead since debhelper/13.28. it has similar semantics but doesn't require command line options β so it's the low-effort, high-reward version. iconic. π
-Xitem,--exclude=itemβ exclude files that contain item anywhere in their filename from being installed. bye bye, you're not invited. πfile ...β install these files (or directories) as examples into the first package acted on. (or into all packages if-Ais specified.) so it's first-come-first-served unless you say otherwise. β¨
β NOTES β
okay important vibes check: dh_installexamples will happily copy entire directory hierarchies if you ask her to (similar to cp -a). if it's asked to install a directory, it installs the complete contents of the directory. all of it. every last file. she does not do things halfway. π₯
β οΈ so maybe don't point her at a giant directory unless that's actually the plan, bestie.
π SEE ALSO π
this program is a part of debhelper. one big happy family. π«Ά
π AUTHOR π
Joey Hess <joeyh@debian.org>
okay that's the whole page, you're officially educated, go forth and install those examples π β¨
much love from debhelper 14.5ubuntu1, dated 2026-09-21 β catch you on the next man page, bestie πππ¦
π¦ where this page comes from
- ubuntu stonking: debhelper 14.5ubuntu1 Β· 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