#!/usr/bin/perl -w =head1 NAME dh_autoreconf - Call autoreconf -f -i and keep track of the changed files. =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] [B<-X>I] [B<--mode=>I] [S B<--> I>] =head1 DESCRIPTION dh_autoreconf is responsible for calling autoreconf and creating the files debian/autoreconf.before and debian/autoreconf.after which contain checksums of all files before/after the build. It is complemented by dh_autoreconf_clean which creates a list of all changed and added files and removes them. =head1 OPTIONS =over 4 =item B<-X>I B<--exclude=>I Exclude files that contain "item" anywhere in their filename from being checked for changes. This means that those files won't be deleted by C even if there are changes. You may use this option multiple times to build up a list of things to exclude. =item B<--mode=>I Change the way in which modifications to files are detected. The default mode is I for using MD5 checksums, but there is also I for using the time of the last modification and the file size. =item I B<--> I Run the program given by I with the arguments given by I instead of autoreconf. If you need to run multiple commands, put them in a script and pass the script instead (or add a target to debian/rules). =back =head1 ENVIRONMENT For each tool executed by L, one can export a variable with the uppercase name of the tool to the specific program which shall be run, including B to prevent the tool in question from being run. The following example shows the beginning of a debian/rules for a package where automake 1.10 shall be run instead of the default automake version and libtoolize shall not be run: #!/usr/bin/make -f export AUTOMAKE = automake1.10 export LIBTOOLIZE = true =cut init(options => { "mode=s" => \$dh{MODE}}); my $find_options='! -ipath "./debian/*" -a '; if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $find_options .= "! \\( $dh{EXCLUDE_FIND} \\) -a"; } my %modes = ( 'md5' => "find $find_options -type f -exec md5sum {} \\;", 'timesize' => "find $find_options -type f -printf \"%s|%T@ %p\n\"" ); my $find = $modes{$dh{MODE} || "md5"} || error("Unknown value $dh{MODE} passed to --mode"); complex_doit("$find > debian/autoreconf.before"); # Run autoreconf to recreate the needed files. @ARGV ? doit(@ARGV) : doit('autoreconf', '-f', '-i'); complex_doit("$find > debian/autoreconf.after"); =head1 SEE ALSO L, L, L =head1 AUTHOR Julian Andres Klode =cut