5 dh_prep - perform cleanups in preparation for building a binary package
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_prep> [S<I<debhelper options>>] [B<-X>I<item>]
18 B<dh_prep> is a debhelper program that performs some file cleanups in
19 preparation for building a binary package. (This is what B<dh_clean -k>
20 used to do.) It removes the package build directories, F<debian/tmp>,
21 and some temp files that are generated when building a binary package.
23 It is typically run at the top of the B<binary-arch> and B<binary-indep> targets,
24 or at the top of a target such as install that they depend on.
30 =item B<-X>I<item> B<--exclude=>I<item>
32 Exclude files that contain F<item> anywhere in their filename from being
33 deleted, even if they would normally be deleted. You may use this option
34 multiple times to build up a list of things to exclude.
42 foreach my $package (@{$dh{DOPACKAGES}}) {
43 my $tmp=tmpdir($package);
44 my $ext=pkgext($package);
46 doit("rm","-f","debian/${ext}substvars")
47 unless excludefile("debian/${ext}substvars");
49 # These are all debhelper temp files, and so it is safe to
51 complex_doit("rm -f debian/$ext*.debhelper");
53 doit ("rm","-rf",$tmp."/")
54 unless excludefile($tmp);
57 doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1) &&
58 ! excludefile("debian/tmp");
64 This program is a part of debhelper.
68 Joey Hess <joeyh@debian.org>