On Wed, 2005-02-09 at 15:31, Stas Bekman wrote:
> That's why the only sensible thing I can suggest is a second DESTDIR 
> argument, which is apache-specific and of course it needs to be called 
> differently. I've earlier suggested MP_AP_DESTDIR.

Attached is a patch which will add a new build time option
MP_AP_DESTDIR, which will be prefixed to all of the Apache bits
for installation.  This works for me, building SysV packages on
Solaris 8 in a non-root environment.

Regards,
Cory.



-- 
Cory Omand <[EMAIL PROTECTED]>
Sun Microsystems
diff --speed-large-files --minimal -Nru mod_perl-2.0.0-RC4.orig/Makefile.PL mod_perl-2.0.0-RC4/Makefile.PL
--- mod_perl-2.0.0-RC4.orig/Makefile.PL	2005-02-16 15:22:21.709509000 -0500
+++ mod_perl-2.0.0-RC4/Makefile.PL	2005-02-16 14:50:44.791344000 -0500
@@ -79,6 +79,7 @@
         PERL               => $build->perl_config('perlpath'),
         MOD_INSTALL        => ModPerl::BuildMM::mod_install(),
         MODPERL_AP_INCLUDEDIR  => $build->install_headers_dir(),
+        MODPERL_AP_DESTDIR => $build->{MP_AP_DESTDIR},
         MODPERL_XS_H_FILES => join(" \\\n\t", @xs_h_files),
     },
     clean     => {
@@ -672,8 +673,8 @@
 	cd "$(MODPERL_SRC)" && $(MAKE) install
 
 modperl_xs_h_install:
-	@$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
-	$(CP) $(MODPERL_XS_H_FILES) $(MODPERL_AP_INCLUDEDIR)
+	@$(MKPATH) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_INCLUDEDIR)
+	$(CP) $(MODPERL_XS_H_FILES) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_INCLUDEDIR)
 
 modperl_src_clean:
 	cd "$(MODPERL_SRC)" && $(MAKE) clean
diff --speed-large-files --minimal -Nru mod_perl-2.0.0-RC4.orig/docs/user/install/install.pod mod_perl-2.0.0-RC4/docs/user/install/install.pod
--- mod_perl-2.0.0-RC4.orig/docs/user/install/install.pod	2005-02-16 15:22:17.271960000 -0500
+++ mod_perl-2.0.0-RC4/docs/user/install/install.pod	2005-02-16 15:21:45.448926000 -0500
@@ -511,6 +511,17 @@
 
   % t/TEST -httpd /home/stas/httpd/prefork/bin/httpd
 
+=head4 MP_AP_DESTDIR
+
+Apache installation destination directory.  This path will be prefixed to the
+installation paths for all Apache specific files during C<make install>.  For
+instance, if C<MP_AP_DESTDIR> is set to C</tmp/foo>, the Apache module will be
+installed to:
+
+  /tmp/foo/path/to/httpd-2.0/libexec/mod_perl.so
+
+This option exists to make the lives of package maintainers easier.
+
 =head4 MP_APR_CONFIG
 
 If APR wasn't installed under the same file tree as httpd, you may
diff --speed-large-files --minimal -Nru mod_perl-2.0.0-RC4.orig/lib/Apache/Build.pm mod_perl-2.0.0-RC4/lib/Apache/Build.pm
--- mod_perl-2.0.0-RC4.orig/lib/Apache/Build.pm	2005-02-16 15:22:18.718177000 -0500
+++ mod_perl-2.0.0-RC4/lib/Apache/Build.pm	2005-02-16 14:50:45.142351000 -0500
@@ -1569,16 +1569,16 @@
     if (!$self->should_build_apache) {
         $install .= <<'EOI';
 # install mod_perl.so
-	@$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
+	@$(MKPATH) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBEXECDIR)
 	$(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
-	$(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
+	$(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBEXECDIR)
 EOI
     }
     
     $install .= <<'EOI';
 # install mod_perl .h files
-	@$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
-	$(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
+	@$(MKPATH) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_INCLUDEDIR)
+	$(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_INCLUDEDIR)
 EOI
 
     my $mf = $self->default_file('makefile');
@@ -1617,9 +1617,9 @@
         print $fh $self->canon_make_attr('lib_symbols', $symbols);
         $install .= <<'EOI';
 # install mod_perl symbol file
-	@$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
+	@$(MKPATH) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBEXECDIR)
 	$(MODPERL_TEST_F) $(MODPERL_LIB_SYMBOLS) && \
-	$(MODPERL_CP) $(MODPERL_LIB_SYMBOLS) $(MODPERL_AP_LIBEXECDIR)
+	$(MODPERL_CP) $(MODPERL_LIB_SYMBOLS) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBEXECDIR)
 EOI
     }
 
@@ -1629,9 +1629,9 @@
                                          "$self->{MP_AP_PREFIX}/lib");
         $install .= <<'EOI';
 # install mod_perl.lib
-	@$(MKPATH) $(MODPERL_AP_LIBDIR)
+	@$(MKPATH) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBDIR)
 	$(MODPERL_TEST_F) $(MODPERL_LIB_LOCATION) && \
-	$(MODPERL_CP) $(MODPERL_LIB_LOCATION) $(MODPERL_AP_LIBDIR)
+	$(MODPERL_CP) $(MODPERL_LIB_LOCATION) $(MODPERL_AP_DESTDIR)$(MODPERL_AP_LIBDIR)
 EOI
     }
 
@@ -1645,6 +1645,9 @@
         print $fh $self->canon_make_attr('libperl', $libperl);
     }
 
+    print $fh $self->canon_make_attr('ap_destdir', $self->{MP_AP_DESTDIR})
+        if $self->{MP_AP_DESTDIR};
+
     for my $method (qw(ccopts ldopts inc)) {
         print $fh $self->canon_make_attr($method, $self->$method());
     }
diff --speed-large-files --minimal -Nru mod_perl-2.0.0-RC4.orig/lib/ModPerl/BuildOptions.pm mod_perl-2.0.0-RC4/lib/ModPerl/BuildOptions.pm
--- mod_perl-2.0.0-RC4.orig/lib/ModPerl/BuildOptions.pm	2005-02-16 15:22:20.166130000 -0500
+++ mod_perl-2.0.0-RC4/lib/ModPerl/BuildOptions.pm	2005-02-16 14:50:45.262146000 -0500
@@ -230,6 +230,7 @@
 OPTIONS_FILE   0    Read options from given file
 STATIC_EXTS    0    Build Apache::*.xs as static extensions
 APXS           0    Path to apxs
+AP_DESTDIR     1    Destination for Apache specific mod_perl bits
 AP_PREFIX      0    Apache installation or source tree prefix
 AP_CONFIGURE   0    Apache ./configure arguments
 APR_CONFIG     0    Path to apr-config

Reply via email to