ASF Bugzilla – Attachment 20050 Details for
Bug 32930
apxs cannot run from DESTDIR specified in 'make DESTDIR=xyz install'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for apxs program's DESTDIR support for Apache httpd 2.2.4
apache-2.2.4-apxs-destdir.diff (text/plain), 5.48 KB, created by
Aron Ujvari
on 2007-04-26 06:59:01 UTC
(
hide
)
Description:
Patch for apxs program's DESTDIR support for Apache httpd 2.2.4
Filename:
MIME Type:
Creator:
Aron Ujvari
Created:
2007-04-26 06:59:01 UTC
Size:
5.48 KB
patch
obsolete
>--- apxs 2007-04-22 11:14:05.000000000 +0000 >+++ apxs2 2007-04-26 13:39:37.000000000 +0000 >@@ -23,9 +23,11 @@ > ## Configuration > ## > >+my $DESTDIR = $ENV{'DESTDIR'}; >+ > my %config_vars = (); > >-my $installbuilddir = "/srv/httpd-2.2.4/prefork/build"; >+my $installbuilddir = "$DESTDIR/srv/httpd-2.2.4/prefork/build"; > get_config_vars("$installbuilddir/config_vars.mk",\%config_vars); > > # read the configuration variables once >@@ -48,6 +50,8 @@ > my $CFG_SBINDIR = eval qq("$sbindir"); > my $ltflags = $ENV{'LTFLAGS'}; > $ltflags or $ltflags = "--silent"; >+my $libdir = get_vars("libdir"); >+$ENV{'LD_LIBRARY_PATH'} = $DESTDIR . $libdir; > > my %internal_vars = map {$_ => 1} > qw(TARGET CC CFLAGS CFLAGS_SHLIB LD_SHLIB LDFLAGS_SHLIB LIBS_SHLIB >@@ -199,12 +203,12 @@ > ($httpd = $0) =~ s:support/apxs$::; > } > >-unless (-x "$httpd") { >+unless (-x "$DESTDIR$httpd") { > error("$httpd not found or not executable"); > exit 1; > } > >-unless (grep /mod_so/, `. $envvars && $httpd -l`) { >+unless (grep /mod_so/, `. $DESTDIR$envvars && $DESTDIR$httpd -l`) { > error("Sorry, no shared object support for Apache"); > error("available under your platform. Make sure"); > error("the Apache module mod_so is compiled into"); >@@ -292,6 +296,7 @@ > $data =~ s|%TARGET%|$CFG_TARGET|sg; > $data =~ s|%PREFIX%|$prefix|sg; > $data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg; >+ $data =~ s|%DESTDIR%|$DESTDIR|sg; > > my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s); > >@@ -324,27 +329,29 @@ > print "$result\n"; > } > >-my $apr_config = get_vars("APR_CONFIG"); >+my $apr_config = $DESTDIR . get_vars("APR_CONFIG"); > > if (! -x "$apr_config") { > error("$apr_config not found!"); > exit(1); > } > >-my $apu_config = get_vars("APU_CONFIG"); >+my $apu_config = $DESTDIR . get_vars("APU_CONFIG"); > > if (! -x "$apu_config") { > error("$apu_config not found!"); > exit(1); > } > >-my $libtool = `$apr_config --apr-libtool`; >+my $libtool = $DESTDIR . `$apr_config --apr-libtool`; > chomp($libtool); > > my $apr_includedir = `$apr_config --includes`; > chomp($apr_includedir); >+$apr_includedir =~ s/ -I$CFG_PREFIX/ -I$DESTDIR$CFG_PREFIX/; > my $apu_includedir = `$apu_config --includes`; > chomp($apu_includedir); >+$apu_includedir =~ s/ -I$CFG_PREFIX/ -I$DESTDIR$CFG_PREFIX/; > > if ($opt_c) { > ## >@@ -409,7 +416,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 $CFG_CC $cflags -I$DESTDIR$CFG_INCLUDEDIR $apr_includedir $apu_includedir $opt -c -o $lo $s && touch $slo"); > unshift(@objs, $lo); > } > >@@ -479,8 +486,8 @@ > $t =~ s|\.[^./\\]+$|\.so|; > if ($opt_i) { > push(@cmds, "$installbuilddir/instdso.sh SH_LIBTOOL='" . >- "$libtool' $f $CFG_LIBEXECDIR"); >- push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t"); >+ "$libtool' $f $DESTDIR$CFG_LIBEXECDIR"); >+ push(@cmds, "chmod 755 $DESTDIR$CFG_LIBEXECDIR/$t"); > } > > # determine module symbolname and filename >@@ -527,17 +534,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 "$DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf") { >+ error("Config file $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf not found"); > exit(1); > } > >- open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die; >+ open(FP, "<$DESTDIR$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/$CFG_TARGET.conf file."); >+ error("Activation failed for custom $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf file."); > error("At least one `LoadModule' directive already has to exist."); > exit(1); > } >@@ -613,15 +620,15 @@ > $content =~ s|^(.*\n)#?\s*$lmd[^\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 $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf]"); > } > if (@lmd) { >- if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) { >+ if (open(FP, ">$DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.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 $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " . >+ "cp $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.new $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf && " . >+ "rm $DESTDIR$CFG_SYSCONFDIR/$CFG_TARGET.conf.new"); > } else { > notice("unable to open configuration file"); > } >@@ -645,6 +652,7 @@ > ## > > builddir=. >+DESTDIR=%DESTDIR% > top_srcdir=%PREFIX% > top_builddir=%PREFIX% > include %INSTALLBUILDDIR%/special.mk
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32930
: 20050