1DH_INSTALLDOCS(1) Debhelper DH_INSTALLDOCS(1)
2
3
4
6 dh_installdocs - install documentation into package build directories
7
9 dh_installdocs [debhelper options] [-A] [-Xitem] [file ...]
10
12 dh_installdocs is a debhelper program that is responsible for
13 installing documentation into usr/share/doc/package in package build
14 directories.
15
16 In compat 10 and earlier, dh_install(1) may be a better tool for
17 handling the upstream documentation, when upstream's own build system
18 installs all the desired documentation correctly. In this case,
19 dh_installdocs is still useful for installing packaging related
20 documentation (e.g. the debian/copyright file).
21
22 From debhelper compatibility level 11 on, dh_install will fall back to
23 looking in debian/tmp for files, if it does not find them in the
24 current directory (or wherever you've told it to look using
25 --sourcedir).
26
27 In compat 11 and later, dh_installdocs offers many of the features that
28 dh_install(1) also has. Furthermore, dh_installdocs also supports the
29 nodoc build profile to exclude documentation (regardless of compat
30 level).
31
33 debian/package.docs
34 List documentation files to be installed into package.
35
36 Supports substitution variables in compat 13 and later as
37 documented in debhelper(7).
38
39 debian/copyright
40 The copyright file is installed into all packages, unless a more
41 specific copyright file is available.
42
43 debian/package.copyright
44 debian/package.README.Debian
45 debian/package.TODO
46 Each of these files is automatically installed if present for a
47 package.
48
49 debian/README.Debian
50 debian/TODO
51 These files are installed into the first binary package listed in
52 debian/control.
53
54 Note that README.debian files are also installed as README.Debian,
55 and TODO files will be installed as TODO.Debian in non-native
56 packages.
57
58 debian/package.doc-base
59 Installed as doc-base control files. Note that the doc-id will be
60 determined from the Document: entry in the doc-base control file in
61 question. In the event that multiple doc-base files in a single
62 source package share the same doc-id, they will be installed to
63 usr/share/doc-base/package instead of usr/share/doc-base/doc-id.
64
65 debian/package.doc-base.*
66 If your package needs to register more than one document, you need
67 multiple doc-base files, and can name them like this. In the event
68 that multiple doc-base files of this style in a single source
69 package share the same doc-id, they will be installed to
70 usr/share/doc-base/package-* instead of usr/share/doc-base/doc-id.
71
72 Please be aware that this deduplication is currently done in memory
73 only, so for now it requires dh_installdocs to be called no more
74 than once during the package build. Calling dh_installdocs
75 -ppackage in combination with using debian/package.doc-base.* files
76 can lead to uninstallable packages. See
77 <https://bugs.debian.org/980903> for details.
78
80 -A, --all
81 Install all files specified by command line parameters in ALL
82 packages acted on.
83
84 -Xitem, --exclude=item
85 Exclude files that contain item anywhere in their filename from
86 being installed. Note that this includes doc-base files.
87
88 --sourcedir=dir
89 Look in the specified directory for files to be installed. This
90 option requires compat 11 or later (it is silently ignored in
91 compat 10 or earlier).
92
93 Note that this is not the same as the --sourcedirectory option used
94 by the dh_auto_* commands. You rarely need to use this option,
95 since dh_installman automatically looks for files in debian/tmp in
96 debhelper compatibility level 11 and above.
97
98 --doc-main-package=main-package
99 Set the main package for a documentation package. This is used to
100 install the documentation of the documentation package in
101 /usr/share/doc/main-package as recommended by the Debian policy
102 manual 3.9.7 in §12.3.
103
104 In compat 11 (or later), this option is only useful if debhelper's
105 auto-detection of the main package is wrong. The option can also
106 be used to silence a warning from debhelper when the auto-detection
107 fails but the default happens to be correct.
108
109 This option cannot be used when dh_installdocs is instructed to act
110 on multiple packages. If you need this option, you will generally
111 need to combine it with -p to ensure exactly one package is acted
112 on.
113
114 Please keep in mind that some documentation (the copyright file,
115 README.Debian, etc.) will be unaffected by this option.
116
117 --link-doc=package
118 Make the documentation directory of all packages acted on be a
119 symlink to the documentation directory of package. This has no
120 effect when acting on package itself, or if the documentation
121 directory to be created already exists when dh_installdocs is run.
122 To comply with policy, package must be a binary package that comes
123 from the same source package.
124
125 debhelper will try to avoid installing files into linked
126 documentation directories that would cause conflicts with the
127 linked package. The -A option will have no effect on packages with
128 linked documentation directories, and copyright, changelog,
129 README.Debian, and TODO files will not be installed.
130
131 (An older method to accomplish the same thing, which is still
132 supported, is to make the documentation directory of a package be a
133 dangling symlink, before calling dh_installdocs.)
134
135 Please note that this option only applies to the documentation
136 directory for the package itself. When the package ships
137 documentation for another package (e.g. see --doc-main-package), it
138 will not use a symlink for the documentation of the other package.
139
140 CAVEAT 1: If a previous version of the package was built without
141 this option and is now built with it (or vice-versa), it requires a
142 "dir to symlink" (or "symlink to dir") migration. Since debhelper
143 has no knowledge of previous versions, you have to enable this
144 migration itself.
145
146 This can be done by providing a "debian/package.maintscript" file
147 and using dh_installdeb(1) to provide the relevant maintainer
148 script snippets.
149
150 CAVEAT 2: The use of --link-doc should only be done when the
151 packages have same "architecture" type. A link from an
152 architecture independent package to an architecture dependent
153 package (or vice versa) will not work. Since compat 10, debhelper
154 will actively reject unsupported combinations.
155
156 file ...
157 Install these files as documentation into the first package acted
158 on. (Or in all packages if -A is specified).
159
161 This is an example of a debian/package.docs file:
162
163 README
164 TODO
165 debian/notes-for-maintainers.txt
166 docs/manual.txt
167 docs/manual.pdf
168 docs/manual-html/
169
171 Note that dh_installdocs will happily copy entire directory hierarchies
172 if you ask it to (similar to cp -a). If it is asked to install a
173 directory, it will install the complete contents of the directory.
174
176 debhelper(7)
177
178 This program is a part of debhelper.
179
181 Joey Hess <joeyh@debian.org>
182
183
184
18513.7.1 2022-04-22 DH_INSTALLDOCS(1)