dh-autoreconf-9/0000755000000000000000000000000012170604100010637 5ustar dh-autoreconf-9/dh_autoreconf_clean0000755000000000000000000000370612170604100014555 0ustar #!/usr/bin/perl -w =head1 NAME dh_autoreconf_clean - Clean all changes made by dh_autoreconf =cut use strict; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION dh_autoreconf_clean removes all files which have been created or changed during the autoreconf call executed by L. It also reverts any ltmain.sh patch applied by dh_autoreconf. =cut init(); # autoreconf failed, just remove the 'before' file. if (-r 'debian/autoreconf.before' && ! -r 'debian/autoreconf.after') { doit("rm", "debian/autoreconf.before"); exit 0; } if (! -r 'debian/autoreconf.before' || ! -r 'debian/autoreconf.after') { exit 0; } # Mapping of filename => md5sum. my %file = (); # An array of the names of the files which should be removed. my @delete = (); # Read the old files in open(FILE, 'debian/autoreconf.before') or die($!); while() { chomp($_); my ($checksum, $filename) = split(' ', $_, 2); $file{$filename} = $checksum; } close(FILE); # Read the new files open(FILE, 'debian/autoreconf.after') or die($!); my $ltcheck = ""; while() { chomp($_); my ($checksum, $filename) = split(' ', $_, 2); if ($filename eq "/usr/share/libtool/config/ltmain.sh") { $ltcheck = $checksum; } elsif (!defined($file{$filename}) || $file{$filename} ne $checksum) { # Remove non-excluded, changed files push @delete, $filename; } elsif ($checksum eq $ltcheck) { # A valid ltmain.sh, reverse patch doit("patch", "-R", "-f", "--no-backup-if-mismatch", "-i", "/usr/share/dh-autoreconf/ltmain-as-needed.diff", $filename); } } close(FILE); # Cleanup doit("rm", "-f", "--", @delete) if @delete; doit("rm", "-f", "debian/autoreconf.before", "debian/autoreconf.after"); =head1 SEE ALSO L, L, L =head1 AUTHOR Julian Andres Klode =cut dh-autoreconf-9/dh-autoreconf.pod0000644000000000000000000000523712170604100014110 0ustar =head1 NAME dh-autoreconf - debhelper add-on to run autoreconf during build =head1 DESCRIPTION The dh-autoreconf package provides a sequence addon for debhelper 7 which can be used in the following way: #!/usr/bin/make -f %: dh $@ --with autoreconf This will call dh_autoreconf prior to dh_auto_configure and will call dh_autoreconf_clean before dh_clean. For more information on how to control the autoreconf process or how to other possible options, read the L and L manual pages. =head1 CDBS INTEGRATION This package also provides F for packages using B. The variable C can be used to pass extra arguments to dh_autoreconf, and the variable C to pass arguments to dh_autoreconf_clean. See their manual pages for information on available arguments. =head1 TIPS AND EXAMPLES =head2 PATCHING LTMAIN.SH FOR AS-NEEDED LINKER FLAGS You can add support for -Wl,--as-needed to ltmain.sh (at least for those ltmain.sh scripts changed during autoreconf) by passing the argument B<--as-needed> to dh_autoreconf, as demonstrated in the following example: #!/usr/bin/make -f %: dh $@ --with autoreconf override_dh_autoreconf: dh_autoreconf --as-needed and for CDBS, by adding it to the correct variable such as: DEB_DH_AUTORECONF_ARGS = --as-needed For more information about this feature, see L =head2 RUNNING MULTIPLE COMMANDS WITH DH_AUTORECONF Please note that you may run dh_autoreconf only once. If you need to run multiple commands, you can put the commands into a script or your debian/rules file and then pass the name of your script to dh_autoreconf. For example, if your script is called debian/autogen.sh, you can put the following into your debian/rules if you use dh: override_dh_autoreconf: dh_autoreconf debian/autogen.sh Or, if you use CDBS: DEB_DH_AUTORECONF_ARGS += debian/autogen.sh =head1 CAVEATS dh_autoreconf is a superset of the autotools-dev debhelper addons, so you do not need --with=autotools_dev if you use --with=autoreconf. In fact, in most cases they should not be used together, as it may lead to unpredictable behaviour. From time to time, there might be a short breakage for those using automatic ltmain.sh patching, when the patch now longer applies to the ltmain.sh. You can only run dh_autoreconf once. Future versions may be able to be run multiple times, but this requires slightly more planning. =head1 SEE ALSO L, L, L, L =head1 AUTHOR Julian Andres Klode dh-autoreconf-9/autoreconf.pm0000644000000000000000000000026512170604100013345 0ustar #!/usr/bin/perl use warnings; use strict; use Debian::Debhelper::Dh_Lib; insert_before("dh_auto_configure", "dh_autoreconf"); insert_before("dh_clean", "dh_autoreconf_clean"); 1; dh-autoreconf-9/ltmain-as-needed.diff0000644000000000000000000000153112170604100014600 0ustar Bug-Debian: http://bugs.debian.org/347650 Last-Update: 2011-06-14 --- a/ltmain.sh +++ b/ltmain.sh @@ -5800,6 +5800,11 @@ func_mode_link () arg=$func_stripname_result ;; + -Wl,--as-needed|-Wl,--no-as-needed) + deplibs="$deplibs $arg" + continue + ;; + -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result @@ -6163,6 +6168,15 @@ func_mode_link () lib= found=no case $deplib in + -Wl,--as-needed|-Wl,--no-as-needed) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + fi + continue + ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then dh-autoreconf-9/autoreconf.mk0000644000000000000000000000067712170604100013347 0ustar # autoreconf.mk - dh-autoreconf integration for CDBS. include /usr/share/cdbs/1/rules/buildcore.mk CDBS_BUILD_DEPENDS_rules_autoreconf := dh-autoreconf CDBS_BUILD_DEPENDS += , $(CDBS_BUILD_DEPENDS_rules_autoreconf) post-patches:: debian/autoreconf.after debian/autoreconf.after: dh_autoreconf $(DEB_DH_AUTORECONF_ARGS) reverse-config:: if test -e debian/autoreconf.before; then \ dh_autoreconf_clean $(DEB_DH_AUTORECONF_CLEAN_ARGS); \ fi dh-autoreconf-9/debian/0000755000000000000000000000000012170604100012061 5ustar dh-autoreconf-9/debian/control0000644000000000000000000000214512170604100013466 0ustar Source: dh-autoreconf Section: devel Priority: optional Maintainer: Julian Andres Klode Build-Depends: debhelper (>= 7.0.50~) Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/collab-maint/dh-autoreconf.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/dh-autoreconf.git Package: dh-autoreconf Architecture: all Multi-Arch: foreign Depends: ${perl:Depends}, ${misc:Depends}, debhelper, autoconf, automake | automaken, autopoint, libtool (>= 2.4.2) Enhances: debhelper, cdbs Description: debhelper add-on to call autoreconf and clean up after the build dh-autoreconf provides a debhelper sequence addon named 'autoreconf' and two commands, dh_autoreconf and dh_autoreconf_clean. . The dh_autoreconf command creates a list of the files and their checksums, calls autoreconf and then creates a second list for the new files. . The dh_autoreconf_clean command compares these two lists and removes all files which have been added or changed (files may be excluded if needed). . For CDBS users, a rule is provided to call the dh-autoreconf programs at the right time. dh-autoreconf-9/debian/changelog0000644000000000000000000000612212170604100013734 0ustar dh-autoreconf (9) unstable; urgency=low * autoreconf.mk: Only run dh_autoreconf_clean if needed (Closes: #709079) -- Julian Andres Klode Sun, 14 Jul 2013 22:21:08 +0200 dh-autoreconf (8) unstable; urgency=low * Promote autopoint from Recommends to Depends (Closes: #610966) * autoreconf.mk: include buildcore.mk (Closes: #681036) * Set Standards-Version to 3.9.4 * Update Vcs-Git and Vcs-Browser to the anonscm urls -- Julian Andres Klode Sun, 14 Jul 2013 20:37:21 +0200 dh-autoreconf (7) unstable; urgency=low * dh_autoreconf: Documentation: -f -i is passed to autoreconf by default * dh_autoreconf_clean: Correctly handle spaces in file names (Closes: #692317) * dh_autoreconf_clean: Remove invalid and unneeded comments -- Julian Andres Klode Thu, 22 Nov 2012 23:31:00 +0100 dh-autoreconf (6) unstable; urgency=low * Require at least version 2.4.2 of libtool (Closes: #655876) * Add Multi-Arch: foreign field (Closes: #658969) * Do not allow to run dh_autoreconf twice (Closes: #630766) * dh_autoreconf: Create autoreconf.after even if autoreconf fails * Increase Standards-Version to 3.9.3, use copyright-format 1.0 -- Julian Andres Klode Thu, 23 Feb 2012 15:46:34 +0100 dh-autoreconf (5) unstable; urgency=low * ltmain-as-needed.diff: Rebase against libtool 2.4.2 (Closes: #647070) -- Julian Andres Klode Sun, 30 Oct 2011 14:36:09 +0100 dh-autoreconf (4) unstable; urgency=low [ Julian Andres Klode ] * autoreconf.mk: Run _clean in reverse-config (Closes: #596099) * dh_autoreconf: Add --as-needed for automatic patching of ltmain.sh * debian/control: Increase Standards-Version to 3.9.2 [ Ari Pollak ] * dh_autoreconf: support parameters passed to custom program (Closes: #623229) -- Julian Andres Klode Tue, 14 Jun 2011 19:32:29 +0200 dh-autoreconf (3) unstable; urgency=low [ Cyril Brulebois ] * dh-autoreconf.pod: Update rules example for debhelper 8 (Closes: #611414) [ Julian Andres Klode ] * autoreconf.mk: Run dh_autoreconf only once (Closes: #618580) * Make it possible to run on sub directories only (Closes: #582114) * autoreconf.mk: Add to CDBS_BUILD_DEPENDS (Closes: #610163) * autoreconf.mk: Run dh_autoreconf_clean before clean (Closes: #596099) * debian/control: Set Standards-Version to 3.9.1 * dh_autoreconf: Ignore common VCS directories (Closes: #611864) * dh_autoreconf_clean: Remove 'before' file even if autoreconf failed [ Marcin Owsiany ] * dh-autoreconf.pod: Document conflict with autotools-dev (Closes: #587102) -- Julian Andres Klode Mon, 04 Apr 2011 16:06:13 +0200 dh-autoreconf (2) unstable; urgency=low [ Didier Roche ] * Fix issue in find | xargs when files contain spaces (Closes: #586755). [ Julian Andres Klode ] * Set Standards-Version to 3.9.0. -- Julian Andres Klode Fri, 23 Jul 2010 13:24:44 +0200 dh-autoreconf (1) unstable; urgency=low * Initial release (Closes: #575938). -- Julian Andres Klode Sat, 17 Apr 2010 15:18:49 +0200 dh-autoreconf-9/debian/compat0000644000000000000000000000000212170604100013257 0ustar 7 dh-autoreconf-9/debian/copyright0000644000000000000000000000103212170604100014010 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: * Copyright: © 2010-2012 Julian Andres Klode License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . On Debian systems, the complete text of the GNU General Public License can be found in file "/usr/share/common-licenses/GPL-2". dh-autoreconf-9/debian/source/0000755000000000000000000000000012170604100013361 5ustar dh-autoreconf-9/debian/source/format0000644000000000000000000000001512170604100014570 0ustar 3.0 (native) dh-autoreconf-9/debian/install0000644000000000000000000000032212170604100013447 0ustar dh_autoreconf usr/bin dh_autoreconf_clean usr/bin autoreconf.pm /usr/share/perl5/Debian/Debhelper/Sequence autoreconf.mk /usr/share/cdbs/1/rules ltmain-as-needed.diff /usr/share/dh-autoreconf dh-autoreconf-9/debian/rules0000755000000000000000000000071212170604100013141 0ustar #!/usr/bin/make -f version := $(shell dpkg-parsechangelog | sed -nr 's/^Version: (.*)/\1/p') pod2man := pod2man -r "dh-autoreconf v$(version)" -c dh-autoreconf %: dh $@ override_dh_auto_build: $(pod2man) --section=1 dh_autoreconf dh_autoreconf.1 $(pod2man) --section=1 dh_autoreconf_clean dh_autoreconf_clean.1 $(pod2man) --section=7 dh-autoreconf.pod dh-autoreconf.7 override_dh_clean: dh_clean dh_autoreconf.1 dh_autoreconf_clean.1 dh-autoreconf.7 dh-autoreconf-9/debian/NEWS0000644000000000000000000000047012170604100012561 0ustar dh-autoreconf (4) unstable; urgency=low dh_autoreconf now supports automatic patching of ltmain.sh files for adding -Wl,--as-needed support to them. See the manual pages dh-autoreconf(7) and dh_autoreconf(1) for more information. -- Julian Andres Klode Tue, 14 Jun 2011 19:32:29 +0200 dh-autoreconf-9/debian/manpages0000644000000000000000000000006612170604100013601 0ustar dh_autoreconf.1 dh_autoreconf_clean.1 dh-autoreconf.7 dh-autoreconf-9/dh_autoreconf0000755000000000000000000001211112170604100013401 0ustar #!/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. Please note that dh_autoreconf can only be run once. Thus, if you need to run multiple commands, use a script or similar. An example is given in L. =head1 FILES =over 4 =item debian/autoreconf This file can contain a list of directories. If present, dh_autoreconf will only scan the given directories for changes. If no special command is given to dh_autoreconf, it will also forward the directory list to autoreconf which causes it to be run only on those sub directories. =back =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. Starting with version 3, the directories of common version control systems such as cvs, git, hg, svn, and bzr are excluded automatically. =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 B<--as-needed> Enable support for -Wl,--as-needed in all ltmain.sh files identical to the one of the libtool package. This only works in the MD5 mode (the default one). The changes are reverted in dh_autoreconf_clean. You should not prevent LIBTOOLIZE from running with this, as it only works correctly with libtoolize running. =item I B<--> I Run the program given by I with the arguments given by I instead of autoreconf -f -i. 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}, "as-needed" => \$dh{AS_NEEDED}}); my $exception; my @directories; my $find_options='! -ipath "./debian/*" -a '; my @exclude_default = ("'*/.git/*'", "'*/.hg/*'", "'*/.bzr/*'", "'*/.svn/*'", "'*/CVS/*'"); $find_options .= ("! \\( -path " . join(" -o -path ", @exclude_default) . " \\) -a "); if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $find_options .= "! \\( $dh{EXCLUDE_FIND} \\) -a "; } if ($dh{AS_NEEDED}) { $find_options = "/usr/share/libtool/config/ltmain.sh . " . $find_options; } if (-e "debian/autoreconf") { @directories=filearray("debian/autoreconf", "."); $find_options = join(" ",@directories)." ".$find_options; } if (-e "debian/autoreconf.before" || -e "debian/autoreconf.after") { error("Can only be run once, see dh-autoreconf(7)"); } 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"); eval { # Run autoreconf to recreate the needed files. @ARGV ? doit(@ARGV, @{$dh{U_PARAMS}}) : doit('autoreconf', '-f', '-i', @directories); 1; } or do { $exception = $@; }; complex_doit("$find > debian/autoreconf.after"); # Let's fail here if autoreconf failed. die $exception if (defined $exception); # Fix ltmain.sh to support -Wl,--as-needed if ($dh{AS_NEEDED}) { open(FILE, 'debian/autoreconf.after') or die($!); my $ltcheck = ""; while() { chomp($_); my ($checksum, $filename) = split; if ($filename eq "/usr/share/libtool/config/ltmain.sh") { $ltcheck = $checksum; } elsif ($filename =~ m/\/ltmain.sh$/ and $checksum eq $ltcheck) { doit("patch", "-f", "--no-backup-if-mismatch", "-i", "/usr/share/dh-autoreconf/ltmain-as-needed.diff", $filename); } } close(FILE); } =head1 SEE ALSO L, L, L =head1 AUTHOR Julian Andres Klode =cut