summaryrefslogtreecommitdiffstats
path: root/debian/clean
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/clean22
-rwxr-xr-xdebian/clean_config_vars57
2 files changed, 79 insertions, 0 deletions
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..ae27f64
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,22 @@
+debian/apache2-suexec-custom.postinst
+debian/apache2-suexec-custom.preinst
+debian/apache2-suexec-custom.prerm
+debian/apache2-suexec-custom.links
+debian/apache2-suexec-custom.dirs
+debian/apache2-suexec-custom.lintian-overrides
+debian/apache2-suexec-pristine.postinst
+debian/apache2-suexec-pristine.preinst
+debian/apache2-suexec-pristine.prerm
+debian/apache2-suexec-pristine.links
+debian/apache2-suexec-pristine.dirs
+debian/apache2-suexec-pristine.lintian-overrides
+debian/a2query
+debian/config-dir/apache2.conf
+debian/manpages/a2query.8
+debian/manpages/dh_apache2.1
+debian/debhelper/dh_apache2
+debian/apache2.preinst
+debian/fixup_conffiles.b64
+debian/fixup_conffiles.tgz
+config.nice
+support/suexec-custom.c
diff --git a/debian/clean_config_vars b/debian/clean_config_vars
new file mode 100755
index 0000000..9611f9a
--- /dev/null
+++ b/debian/clean_config_vars
@@ -0,0 +1,57 @@
+#! /usr/bin/perl
+
+use strict;
+
+my %FLAGS = {
+ 'CFLAGS' => $ARGV[0],
+ 'CPPFLAGS' => $ARGV[1],
+ 'LDDFLAGS' => $ARGV[2],
+ 'CXXFLAGS' => $ARGV[3],
+};
+
+sub clean_and_deduplicate {
+ my $arg = shift;
+ my $return_flags = "";
+ my @flags = split( /\s+/, $arg );
+ my %seen = ();
+ my @flags = grep { !$seen{$_}++ } @flags;
+ foreach my $flag (@flags) {
+
+ #print("FLAG: $flag\n");
+ $return_flags .= "$flag "
+ unless $flag =~ m/PLATFORM/
+ || $flag =~ m/-DBUILD_DATETIME/
+ || $flag =~ m/-fdebug-prefix-map/
+ || $flag =~ m/-ffile-prefix-map/;
+ }
+ return $return_flags;
+}
+
+chdir("debian/tmp/usr/share/apache2/build/") || die("$1");
+
+open( CONFIG_VARS, "<", "config_vars.mk" ) || die("config_vars.mk: $!");
+open( TMP_CONFIG_VARS, ">", "tmp_config_vars.mk" )
+ || die("tmp_config_vars.mk: $1");
+
+while ( my $line = <CONFIG_VARS> ) {
+ chomp $line;
+ unless ( $line =~ m/(^|_)(LD|CPP|C|CXX)FLAGS/ ) {
+ print TMP_CONFIG_VARS "$line\n";
+ }
+ else {
+ my ( $flag, $value ) = split( /\s*=\s*/, $line, 2 );
+ if ( exists $FLAGS{$flag} ) {
+ $value .= ' ' . $FLAGS{$flag};
+ }
+ my $mangled = clean_and_deduplicate($value);
+ print "mangle: $flag: '$value' => '$mangled'\n";
+ printf TMP_CONFIG_VARS "%s = %s\n", $flag, $mangled;
+ }
+}
+
+close(CONFIG_VARS);
+close(TMP_CONFIG_VARS);
+
+unlink("config_vars.mk") || die("unlink: config_vars.mk: $1");
+rename( "tmp_config_vars.mk", "config_vars.mk" )
+ || die("rename: tmp_config_vars.mk: $1");