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 dh_prep is a debhelper program that performs some file cleanups in
19 preparation for building a package. (This is what dh_clean -k used to do.)
20 It removes the package build directories, debian/tmp, and some temp files
21 that are generated during the build. Putting this at the start of the build
22 process makes the build process idempotent.
28 =item B<-X>I<item> B<--exclude=>I<item>
30 Exclude files that contain "item" anywhere in their filename from being
31 deleted, even if they would normally be deleted. You may use this option
32 multiple times to build up a list of things to exclude.
40 foreach my $package (@{$dh{DOPACKAGES}}) {
41 my $tmp=tmpdir($package);
42 my $ext=pkgext($package);
44 doit("rm","-f","debian/${ext}substvars")
45 unless excludefile("debian/${ext}substvars");
47 # These are all debhelper temp files, and so it is safe to
49 complex_doit("rm -f debian/$ext*.debhelper");
51 doit ("rm","-rf",$tmp."/")
52 unless excludefile($tmp);
55 doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1) &&
56 ! excludefile("debian/tmp");
62 This program is a part of debhelper.
66 Joey Hess <joeyh@debian.org>