[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, master, updated. debian/2.2.22-3-13-g4a6bd73

Stefan Fritsch sf at sfritsch.de
Mon May 28 19:35:51 UTC 2012


The following commit has been merged in the master branch:
commit 023f818735ced422bccc9564061f051489594317
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Mon May 28 20:05:29 2012 +0200

    Make apxs use the configured LDFLAGS, export hardening buildflags
    
    - Port the apxs patch from branch wheezy24backports and remove most of
      the old apxs patches
    - Fix up location of envvars

diff --git a/debian/changelog b/debian/changelog
index f8c763a..c54227c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+apache2 (2.2.22-6) UNRELEASED; urgency=low
+
+  [ Arno Töll ]
+  * Fix apxs to import LDFLAGS from config_vars.mk. Moreover, make it possible
+    to override LDFLAGS at compile time by defining LDLAGS in the environment,
+    just like it is possible for CFLAGS. This also means, config_vars.mk now
+    exports hardening build flags by default.
+
+ -- Stefan Fritsch <sf at debian.org>  Mon, 28 May 2012 20:02:19 +0200
+
 apache2 (2.2.22-5) unstable; urgency=low
 
   * Make LoadFile and LoadModule look in the standard search paths if the
diff --git a/debian/patches/031_apxs2_sucks_more b/debian/patches/031_apxs2_sucks_more
deleted file mode 100755
index 7d6f68e..0000000
--- a/debian/patches/031_apxs2_sucks_more
+++ /dev/null
@@ -1,99 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 031_apxs2_sucks_more by Adam Conrad <adconrad at 0c3.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Make apxs2 use httpd.conf, instead of apache2.conf, plus other random fixes.
-
- at DPATCH@
---- a/support/apxs.in
-+++ b/support/apxs.in
-@@ -189,7 +189,7 @@
- my $httpd = get_vars("sbindir") . "/" . get_vars("progname");
- $httpd = eval qq("$httpd");
- $httpd = eval qq("$httpd");
--my $envvars = get_vars("sbindir") . "/envvars";
-+my $envvars = "$CFG_SYSCONFDIR" . "/envvars";
- $envvars = eval qq("$envvars");
- $envvars = eval qq("$envvars");
- 
-@@ -292,6 +292,7 @@
-     $data =~ s|%TARGET%|$CFG_TARGET|sg;
-     $data =~ s|%PREFIX%|$prefix|sg;
-     $data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg;
-+    $data =~ s|%DATADIR%|$datadir|sg;
- 
-     my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s);
- 
-@@ -480,7 +481,7 @@
-         if ($opt_i) {
- 	    push(@cmds, "$installbuilddir/instdso.sh SH_LIBTOOL='" .
-                  "$libtool' $f $CFG_LIBEXECDIR");
--	    push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t");
-+	    push(@cmds, "chmod 644 $CFG_LIBEXECDIR/$t");
-         }
- 
-         #   determine module symbolname and filename
-@@ -516,7 +517,8 @@
-             $filename = "mod_${name}.c";
-         }
-         my $dir = $CFG_LIBEXECDIR;
--        $dir =~ s|^$CFG_PREFIX/?||;
-+        # Debian doesn't have a CFG_PREFIX, so this stuffs up:
-+	# $dir =~ s|^$CFG_PREFIX/?||;
-         $dir =~ s|(.)$|$1/|;
- 	$t =~ s|\.la$|.so|;
-         push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));
-@@ -527,17 +529,17 @@
- 
-     #   activate module via LoadModule/AddModule directive
-     if ($opt_a or $opt_A) {
--        if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
--            error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found");
-+        if (not -f "$CFG_SYSCONFDIR/httpd.conf") {
-+            error("Config file $CFG_SYSCONFDIR/httpd.conf not found");
-             exit(1);
-         }
- 
--        open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
-+        open(FP, "<$CFG_SYSCONFDIR/httpd.conf") || die;
-         my $content = join('', <FP>);
-         close(FP);
- 
-         if ($content !~ m|\n#?\s*LoadModule\s+|) {
--            error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.");
-+            error("Activation failed for custom $CFG_SYSCONFDIR/httpd.conf file.");
-             error("At least one `LoadModule' directive already has to exist.");
-             exit(1);
-         }
-@@ -616,15 +618,15 @@
-                 $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
-             }
-             $lmd =~ m|LoadModule\s+(.+?)_module.*|;
--            notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
-+            notice("[$what module `$1' in $CFG_SYSCONFDIR/httpd.conf]");
-         }
-         if (@lmd) {
--            if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
-+            if (open(FP, ">$CFG_SYSCONFDIR/httpd.conf.new")) {
-                 print FP $content;
-                 close(FP);
--                system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
--                       "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
--                       "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
-+                system("cp $CFG_SYSCONFDIR/httpd.conf $CFG_SYSCONFDIR/httpd.conf.bak && " .
-+                       "cp $CFG_SYSCONFDIR/httpd.conf.new $CFG_SYSCONFDIR/httpd.conf && " .
-+                       "rm $CFG_SYSCONFDIR/httpd.conf.new");
-             } else {
-                 notice("unable to open configuration file");
-             }
-@@ -648,8 +650,8 @@
- ##
- 
- builddir=.
--top_srcdir=%PREFIX%
--top_builddir=%PREFIX%
-+top_srcdir=%DATADIR%
-+top_builddir=%DATADIR%
- include %INSTALLBUILDDIR%/special.mk
- 
- #   the used tools
diff --git a/debian/patches/034_apxs2_libtool_fixtastic b/debian/patches/034_apxs2_libtool_fixtastic
deleted file mode 100644
index 605b015..0000000
--- a/debian/patches/034_apxs2_libtool_fixtastic
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 034_apxs2_libtool_fixtastic by Peter Samuelson <peter at p12n.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Make libtool happier
-
---- a/support/apxs.in
-+++ b/support/apxs.in
-@@ -410,7 +410,7 @@
-         $la =~ s|\.c$|.la|;
-         my $o = $s;
-         $o =~ s|\.c$|.o|;
--        push(@cmds, "$libtool $ltflags --mode=compile $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo");
-+        push(@cmds, "$libtool $ltflags --mode=compile --tag=disable-static $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo");
-         unshift(@objs, $lo);
-     }
- 
-@@ -447,7 +447,7 @@
-         $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
-     }
- 
--    push(@cmds, "$libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo");
-+    push(@cmds, "$libtool $ltflags --mode=link --tag=disable-static $CFG_CC -o $dso_file $opt $lo");
- 
-     #   execute the commands
-     &execute_cmds(@cmds);
diff --git a/debian/patches/076_apxs2_a2enmod b/debian/patches/084_customize_apxs.patch
old mode 100755
new mode 100644
similarity index 57%
rename from debian/patches/076_apxs2_a2enmod
rename to debian/patches/084_customize_apxs.patch
index 2268f28..74b978c
--- a/debian/patches/076_apxs2_a2enmod
+++ b/debian/patches/084_customize_apxs.patch
@@ -1,14 +1,85 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 076_apxs2_a2enmo.dpatch by Stefan Fritsch <sf at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Make apxs2 use a2enmod and /etc/apache2/mods-available
+Description: Adapt apxs to Debian specific changes
+ - Make apxs2 use a2enmod and /etc/apache2/mods-available
+ - Make libtool happier
+ - Use LDFLAGS from config_vars.mk, allow to override them
+Forwarded: not-needed
+Author: Stefan Fritsch <sf at debian.org>
+Last-Update: 2012-03-17
 
- at DPATCH@
---- a/support/apxs.in
-+++ b/support/apxs.in
-@@ -521,7 +521,7 @@
- 	# $dir =~ s|^$CFG_PREFIX/?||;
+Index: apache2/support/apxs.in
+===================================================================
+--- apache2.orig/support/apxs.in
++++ apache2/support/apxs.in
+@@ -38,7 +38,9 @@
+ my $CFG_TARGET     = get_vars("progname");
+ my $CFG_SYSCONFDIR = get_vars("sysconfdir");
+ my $CFG_CFLAGS     = join ' ', map { get_vars($_) }
+-  qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
++  qw(SHLTCFLAGS CFLAGS CPPFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
++my $CFG_LDFLAGS    = join ' ', map { get_vars($_) }
++  qw(LDFLAGS NOTEST_LDFLAGS SH_LDFLAGS);
+ my $includedir     = get_vars("includedir");
+ my $CFG_INCLUDEDIR = eval qq("$includedir");
+ my $CFG_CC         = get_vars("CC");
+@@ -189,7 +191,7 @@
+ my $httpd = get_vars("sbindir") . "/" . get_vars("progname");
+ $httpd = eval qq("$httpd");
+ $httpd = eval qq("$httpd");
+-my $envvars = get_vars("sbindir") . "/envvars";
++my $envvars = "$CFG_SYSCONFDIR/envvars";
+ $envvars = eval qq("$envvars");
+ $envvars = eval qq("$envvars");
+ 
+@@ -292,6 +294,7 @@
+     $data =~ s|%TARGET%|$CFG_TARGET|sg;
+     $data =~ s|%PREFIX%|$prefix|sg;
+     $data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg;
++    $data =~ s|%DATADIR%|$datadir|sg;
+ 
+     my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s);
+ 
+@@ -409,7 +412,7 @@
+         $la =~ s|\.c$|.la|;
+         my $o = $s;
+         $o =~ s|\.c$|.o|;
+-        push(@cmds, "$libtool $ltflags --mode=compile $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo");
++        push(@cmds, "$libtool $ltflags --mode=compile --tag=disable-static $CFG_CC $cflags -I$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo");
+         unshift(@objs, $lo);
+     }
+ 
+@@ -431,6 +434,7 @@
+         $opt .= " -l$opt_l";
+     }
+ 
++    my $ldflags = "$CFG_LDFLAGS";
+     if ($opt_p == 1) {
+         
+         my $apr_libs=`$apr_config --cflags --ldflags --link-libtool --libs`;
+@@ -446,7 +450,7 @@
+         $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
+     }
+ 
+-    push(@cmds, "$libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo");
++    push(@cmds, "$libtool $ltflags --mode=link --tag=disable-static $CFG_CC $ldflags -o $dso_file $opt $lo");
+ 
+     #   execute the commands
+     &execute_cmds(@cmds);
+@@ -480,7 +484,7 @@
+         if ($opt_i) {
+ 	    push(@cmds, "$installbuilddir/instdso.sh SH_LIBTOOL='" .
+                  "$libtool' $f $CFG_LIBEXECDIR");
+-	    push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t");
++	    push(@cmds, "chmod 644 $CFG_LIBEXECDIR/$t");
+         }
+ 
+         #   determine module symbolname and filename
+@@ -516,10 +520,11 @@
+             $filename = "mod_${name}.c";
+         }
+         my $dir = $CFG_LIBEXECDIR;
+-        $dir =~ s|^$CFG_PREFIX/?||;
++        # Debian doesn't have a CFG_PREFIX, so this stuffs up:
++	# $dir =~ s|^$CFG_PREFIX/?||;
          $dir =~ s|(.)$|$1/|;
  	$t =~ s|\.la$|.so|;
 -        push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));
@@ -16,23 +87,23 @@
      }
  
      #   execute the commands
-@@ -529,108 +529,35 @@
+@@ -527,108 +532,35 @@
  
      #   activate module via LoadModule/AddModule directive
      if ($opt_a or $opt_A) {
--        if (not -f "$CFG_SYSCONFDIR/httpd.conf") {
--            error("Config file $CFG_SYSCONFDIR/httpd.conf not found");
+-        if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
+-            error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found");
 +        if (not -d "$CFG_SYSCONFDIR/mods-available") {
 +            error("Config file $CFG_SYSCONFDIR/mods-available not found");
              exit(1);
          }
  
--        open(FP, "<$CFG_SYSCONFDIR/httpd.conf") || die;
+-        open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
 -        my $content = join('', <FP>);
 -        close(FP);
 -
 -        if ($content !~ m|\n#?\s*LoadModule\s+|) {
--            error("Activation failed for custom $CFG_SYSCONFDIR/httpd.conf file.");
+-            error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.");
 -            error("At least one `LoadModule' directive already has to exist.");
 -            exit(1);
 -        }
@@ -60,7 +131,15 @@
 -                if ($cntopen == $cntclose) {
 -                    # fine. Last LoadModule is contextless.
 -                    $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|s;
--                }
++        my $entry;
++        foreach $entry (@lmd) {
++            my ($name, $lmd) = @{$entry};
++            my $filename = "$CFG_SYSCONFDIR/mods-available/$name.load";
++            if (-f $filename) {
++                my $cmd = "mv $filename $filename.bak~";
++                if (system($cmd) != 0) {
++                    die "'$cmd' failed\n";
+                 }
 -                elsif ($cntopen < $cntclose) {
 -                    error('Configuration file is not valid. There are sections'
 -                          . ' closed before opened.');
@@ -105,21 +184,7 @@
 -                              . 'sections opened and not closed.');
 -                        exit(1);
 -                    }
-+        my $entry;
-+        foreach $entry (@lmd) {
-+            my ($name, $lmd) = @{$entry};
-+            my $filename = "$CFG_SYSCONFDIR/mods-available/$name.load";
-+            if (-f $filename) {
-+                my $cmd = "mv $filename $filename.bak~";
-+                if (system($cmd) != 0) {
-+                    die "'$cmd' failed\n";
-                 }
--            } else {
--                # replace already existing LoadModule line
--                $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
-             }
--            $lmd =~ m|LoadModule\s+(.+?)_module.*|;
--            notice("[$what module `$1' in $CFG_SYSCONFDIR/httpd.conf]");
++            }
 +
 +            notice("[preparing module `$name' in $filename]");
 +            open(FP, ">$filename") || die;
@@ -130,21 +195,38 @@
 +                my $cmd = "a2enmod $name";
 +                if (system($cmd) != 0) {
 +                    die "'$cmd' failed\n";
-+                }
-+            }               
-+
-         }
+                 }
+-            } else {
+-                # replace already existing LoadModule line
+-                $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
+-            }
+-            $lmd =~ m|LoadModule\s+(.+?)_module.*|;
+-            notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
+-        }
 -        if (@lmd) {
--            if (open(FP, ">$CFG_SYSCONFDIR/httpd.conf.new")) {
+-            if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
 -                print FP $content;
 -                close(FP);
--                system("cp $CFG_SYSCONFDIR/httpd.conf $CFG_SYSCONFDIR/httpd.conf.bak && " .
--                       "cp $CFG_SYSCONFDIR/httpd.conf.new $CFG_SYSCONFDIR/httpd.conf && " .
--                       "rm $CFG_SYSCONFDIR/httpd.conf.new");
+-                system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
+-                       "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
+-                       "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
 -            } else {
 -                notice("unable to open configuration file");
--            }
+             }
 -	}
++
++        }
      }
  }
  
+@@ -648,8 +580,8 @@
+ ##
+ 
+ builddir=.
+-top_srcdir=%PREFIX%
+-top_builddir=%PREFIX%
++top_srcdir=%DATADIR%
++top_builddir=%DATADIR%
+ include %INSTALLBUILDDIR%/special.mk
+ 
+ #   the used tools
diff --git a/debian/patches/series b/debian/patches/series
index baf225d..f489dab 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,10 +2,8 @@
 008_make_include_safe
 009_apache2_has_dso
 010_fhs_compliance
-031_apxs2_sucks_more
 032_suexec_is_shared
 033_dbm_read_hash_or_btree
-034_apxs2_libtool_fixtastic
 038_no_LD_LIBRARY_PATH
 045_suexec_log_cloexec
 047_fix_usage_message
@@ -17,11 +15,11 @@
 073_mod_dav_trunk_fixes
 074_link_support_progs_with_lcrypt
 075_mod_rewrite_literal_ipv6_redirect
-076_apxs2_a2enmod
 077_CacheIgnoreURLSessionIdentifiers
 079_polish_translation
 082_ab_num_requests
 083_dlopen_search_path
+084_customize_apxs.patch
 099_config_guess_sub_update
 201_build_suexec-custom
 # The patch below must not be applied by quilt at extraction time.  It depends

-- 
Debian packaging for apache2 (Apache HTTPD 2.x)



More information about the Pkg-apache-commits mailing list