lib, src: Fold if with last previous else
[dpkg.git] / man / dpkg-buildtree.pod
blob660ebb0f1c0549c3941bdd58439300e1c8ab735f
1 # dpkg manual page - dpkg-buildtree(1)
3 # Copyright © 2023 Guillem Jover <guillem@debian.org>
5 # This is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
18 =encoding utf8
20 =head1 NAME
22 dpkg-buildtree - helper for build tree operations during package builds
24 =head1 SYNOPSIS
26 B<dpkg-buildtree> [I<option>...] [I<command>]
28 =head1 DESCRIPTION
30 B<dpkg-buildtree> is a tool to perform common operations on the build tree
31 for a source package.
33 This program was introduced in dpkg 1.22.3.
35 =head1 COMMANDS
37 =over
39 =item B<clean>
41 Removes all artifacts generated during a build by the various dpkg tools,
42 and pathnames used or controlled by dpkg tools that are safe to clean.
43 These files are used to track state between package build runs,
44 and are in many cases internal implementation details the packager should
45 not be concerned about,
46 or are staging directories containing build artifacts.
48 =item B<--help>
50 Show the usage message and exit.
52 =item B<--version>
54 Show the version and exit.
56 =back
58 =head1 FILES
60 =head2 Cleaned files
62 =over
64 =item F<debian/files>
66 =item F<debian/files.new>
68 Files generated by L<dpkg-distaddfile(1)>.
70 =item F<debian/substvars>
72 =item F<debian/substvars.new>
74 Files generated by L<dpkg-shlibdeps(1)>.
76 =item F<debian/tmp>
78 Staging directory containing the contents to be used when creating a package.
79 Both L<dpkg-gencontrol(1)> and L<dpkg-gensymbols(1)> generate files within.
81 =back
83 =head1 EXAMPLES
85 =head2 Usage in debian/rules
87 You can call B<dpkg-buildtree clean> from the F<debian/rules> B<clean> target,
88 after having performed other necessary cleanups.
90 For example for an autoconf-like build system:
92 =over
94   clean:
95         [ ! -f Makefile ] || $(MAKE) distclean
96         dpkg-buildtree clean
98 =back