You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Frederic LE GUERN <fl...@apteryx.fr> on 2005/02/08 01:54:26 UTC

[mp2] DESTDIR does not apply to mod_perl.so and includes

${source_dir}/src/modules/perl/Makefile does not reference $(DESTDIR) in
install: rule, so when trying to make mod_perl2 as a relocatable package
mod_perl.so and mod_perl .h files get installed system-wide.

Here's a patch :

--- Makefile.orig    2005-02-08 00:43:50.000000000 +0000
+++ Makefile    2005-02-08 00:32:12.000000000 +0000
@@ -101,12 +101,12 @@

 install:
 # install mod_perl.so
-       @$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
+       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
        $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
-       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
+       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
 # install mod_perl .h files
-       @$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
-       $(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
+       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
+       $(MODPERL_CP) $(MODPERL_H_FILES) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)

 .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Nick Phillips wrote:
> On 08/02/2005, at 4:16 PM, Stas Bekman wrote:
> 
>> sure, but you can help us figure out a solution w/o knowing anything 
>> about mod_perl. The situation of the packagers is unique. One can 
>> think of it as if they are using chroot(1), where their / moves 
>> elsewhere. It'd be easy to make DESTDIR supported, but this is not the 
>> right thing. mod_perl has to be installed where all other Apache 
>> modules are. So DESTDIR must not affect it. Notice that unlike mp1, 
>> mp2 does not install mod_perl.so under the perl tree.
> 
> 
> What's DESTDIR do currently? The "standard" thing for DESTDIR to do is 
> to cause
> files to be installed to a different location, irrespective of where 
> libs etc.
> are going to be searched for, and irrespective of whether or not it has a
> snowball's chance in hell of actually working in that location.
> 
> It makes life easy for a packager, and it allows anyone else to see 
> *exactly*
> what "make install" would do were DESTDIR not set.
> 
> So my first reaction to your saying "So DESTDIR must not affect it" is 
> "that
> doesn't follow". Hence asking what it actually does at the moment.

DESTDIR is a perl thingy. It will send all perl bits to DESTDIR.

mod_perl.so and its .h files are not perl thingies, and so DESTDIR doesn't 
apply here by design. Simply because Apache thingies live under the Apache 
tree, not the perl tree.

>> I suppose the simplest solution to this problem is to provide a new 
>> Makefile.PL argument, which will be the same as DESTDIR in the perl 
>> world, but for Apache things. e.g., MP_AP_DESTDIR, so if specified it 
>> can be used exactly as in your patch above. (handling the trailing 
>> slash of ofcourse). In your case MP_AP_DESTDIR will be the same value 
>> as DESTDIR.
> 
> 
> In the universe I come from, DESTDIR should not affect anything during the
> actual build, just during the install. And it should affect 
> *everything*. If
> you also want a setting that will enable things to be installed 
> somewhere else
> *and work*, then you do need another setting. But in my universe, it's 
> *that*
> one that should be called something else. It seems from what I remember 
> to be
> more similar to autotools' ${prefix}.

Welcome to the new dimension where your perl universe meets an apache 
universe and where the two overlap F=mg doesn't always apply.

The mod_perl project is a glue between these two universes. mod_perl.so 
and modperl*.h live in the Apache universe, whereas 
(Apache|ModPerl|APR)::* modules live in the Perl universe, and therefore 
they get installed into different places.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Nick Phillips <Ni...@stonebow.otago.ac.nz>.
On 08/02/2005, at 4:16 PM, Stas Bekman wrote:

> sure, but you can help us figure out a solution w/o knowing anything 
> about mod_perl. The situation of the packagers is unique. One can 
> think of it as if they are using chroot(1), where their / moves 
> elsewhere. It'd be easy to make DESTDIR supported, but this is not the 
> right thing. mod_perl has to be installed where all other Apache 
> modules are. So DESTDIR must not affect it. Notice that unlike mp1, 
> mp2 does not install mod_perl.so under the perl tree.

What's DESTDIR do currently? The "standard" thing for DESTDIR to do is 
to cause
files to be installed to a different location, irrespective of where 
libs etc.
are going to be searched for, and irrespective of whether or not it has 
a
snowball's chance in hell of actually working in that location.

It makes life easy for a packager, and it allows anyone else to see 
*exactly*
what "make install" would do were DESTDIR not set.

So my first reaction to your saying "So DESTDIR must not affect it" is 
"that
doesn't follow". Hence asking what it actually does at the moment.


> I suppose the simplest solution to this problem is to provide a new 
> Makefile.PL argument, which will be the same as DESTDIR in the perl 
> world, but for Apache things. e.g., MP_AP_DESTDIR, so if specified it 
> can be used exactly as in your patch above. (handling the trailing 
> slash of ofcourse). In your case MP_AP_DESTDIR will be the same value 
> as DESTDIR.

In the universe I come from, DESTDIR should not affect anything during 
the
actual build, just during the install. And it should affect 
*everything*. If
you also want a setting that will enable things to be installed 
somewhere else
*and work*, then you do need another setting. But in my universe, it's 
*that*
one that should be called something else. It seems from what I remember 
to be
more similar to autotools' ${prefix}.


Cheers,


Nick
-- 
Nick Phillips / +64 3 479 4195 / nick.phillips@stonebow.otago.ac.nz
# these statements are my own, not those of the University of Otago


Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Frederic LE GUERN <fl...@apteryx.fr>.
Thanks Cory
I'll replace my own patch with yours.
Regards,
Frederic LE GUERN

On Wed, 16 Feb 2005, Cory Omand wrote:

> Date: Wed, 16 Feb 2005 12:52:14 -0800
> From: Cory Omand <Co...@Sun.COM>
> To: modperl@perl.apache.org
> Cc: Frederic LE GUERN <fl...@apteryx.fr>
> Subject: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes
>
> 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 <Co...@Sun.com>
> Sun Microsystems
>

Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Cory Omand wrote:
> 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.

A modified version of this patch was discussed at the dev list and committed.

Thanks Cory.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Cory Omand wrote:
[...]
>>That's better, Cory, but why introducing new variables? you still kept the 
>>old ones, but they aren't used anymore, are they? (e.g. AP_LIBEXECDIR) 
>>Looks like a lot of extra noise.
>>
>>May be keep the old makefile vars unchanged but merge the new prefix 
>>transparently into those vars if the prefix exists? or at least drop the 
>>not-used vars?
> 
> 
> My initial thought was that this should behave like DESTDIR for
> other packages -- it is only set on installation.  Therefore, when
> you are using AP_LIBEXECDIR, you know it is pointing to where things
> will be when installed, but AP_LIBEXECDESTDIR is not referenced
> anywhere in the compilation portions of the makefile.  As I have
> another look through the makefile, however, it appears that the
> only purpose of the MODPERL_AP_* variables is for installation, so
> maybe moving to use the existing variable names is fine...
> 
> Another patch is attached --

Looks perfect to me, Cory

(it will need a few tiny style tweaks, but don't worry about that).

+1

once others vote on this it can go in.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Cory Omand wrote:

With a few minor tweaks it's now committed. Thanks Cory.

You can see the detail of commit here:
http://svn.apache.org/viewcvs.cgi?rev=154318&view=rev

> +AP_DESTDIR     1    Destination for Apache specific mod_perl bits

I've changed this to 0. I don't think this option should be appendable.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Cory Omand wrote:
> On Wed, 2005-02-16 at 13:18, Stas Bekman wrote:
> 
>>But doesn't it need to deal with the trailing slash? Is it ok if someone 
>>adds one and then it'll becomes foo//bar? I guess we also assume that the 
>>right part always has the leading slash, since it's a real path to the 
>>installed Apache dir, right? In the case of windows where it will become 
>>fooc:\bar is probably irrelevant here.
> 
> 
> Stas,
> 
> It shouldn't matter if someone specifies the trailing slash, as all
> that this path is used for is as an argument to $(MODPERL_CP).  You
> are correct about the right portion -- it always will have the
> leading slash, because that path comes back from apxs. I hadn't
> considered the windows case, however.  I've attached a new version
> of the patch which is 'volume aware', provides canonical paths, and
> would properly handle the case where apxs returns a path without a
> leading slash.

That's better, Cory, but why introducing new variables? you still kept the 
old ones, but they aren't used anymore, are they? (e.g. AP_LIBEXECDIR) 
Looks like a lot of extra noise.

May be keep the old makefile vars unchanged but merge the new prefix 
transparently into those vars if the prefix exists? or at least drop the 
not-used vars?


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Redirecting to the dev list, so others can vote on this:

>>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.

I'm +1. An excellent patch, Cory!

But doesn't it need to deal with the trailing slash? Is it ok if someone 
adds one and then it'll becomes foo//bar? I guess we also assume that the 
right part always has the leading slash, since it's a real path to the 
installed Apache dir, right? In the case of windows where it will become 
fooc:\bar is probably irrelevant here.

> ------------------------------------------------------------------------
> 
> 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


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


[mp2] [PATCH] DESTDIR does not apply to mod_perl.so and includes

Posted by Cory Omand <Co...@Sun.COM>.
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 <Co...@Sun.com>
Sun Microsystems

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Frederic LE GUERN wrote:
[...]
> As far as I can see DESTDIR's becoming pretty standard and it is available
> in Apache's Makefile so I wouldn't call it a perl thingy anymore... 

It may be called the same way, but it's easy to see that it's not the same 
thing.

> Yet I
> understand your point as we have two packages here ; once again, the question
> is, does it make sense to build a separate package for mod_perl or should we
> (can we btw?) always build both mod_perl *and* apache at the same time ?
> My answer is still not for me...

If you build a static Apache/mod_perl then you have no choice.

If you build a DSO mod_perl, then you need to have apache built and 
installed already. if you had the apache installed in DESTDIR, then yes, 
DESTDIR would work across all, but this is not the case.

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.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Frederic LE GUERN <fl...@apteryx.fr>.
> sure, but you can help us figure out a solution w/o knowing anything about
> mod_perl. The situation of the packagers is unique. One can think of it as
> if they are using chroot(1), where their / moves elsewhere. It'd be easy
> to make DESTDIR supported, but this is not the right thing. mod_perl has
> to be installed where all other Apache modules are. So DESTDIR must not
> affect it. Notice that unlike mp1, mp2 does not install mod_perl.so under
> the perl tree.

I understand that. Since the installer uses apxs to locate apache directory
(right?) it only makes sense on the system where it's being installed.

> I suppose the simplest solution to this problem is to provide a new
> Makefile.PL argument, which will be the same as DESTDIR in the perl world,
> but for Apache things. e.g., MP_AP_DESTDIR, so if specified it can be used
> exactly as in your patch above. (handling the trailing slash of ofcourse).
> In your case MP_AP_DESTDIR will be the same value as DESTDIR.

Yes we need to have a build of apache ready somewhere (with a proper apxs)
to build mod_perl anyway, there's no way that we could make the package
without it.

Still I'm not convinced about writing files outside the package tree ; whenever
DESTDIR is set I see it as 'please put your stuff in there so I can make a
package out of it'. Really depends on how the package maintainer wants it
done : either make an apache package with mod_perl.so then another package
with perl-related stuff, or make one package with both apache+mod_perl,
or keep apache as it is and make another package with both mod_perl.so
(and mod_perl includes), in, say, /usr/libexec/apache2, and perl stuff in
its right place. As far as I'm concerned I prefer the third option, as I
find more logic in not having a useless mod_perl.so in a plain apache package
(first option) and may want to install a simple build of apache with no bells+
whistles on some systems. For that purpose, seems to me DESTDIR should apply
to all involved packages.

Last I found very annoying when building that mod_perl.so should find its
way to some place in my root directory where it might have overridden some
other version of mod_perl that could have been in use...


[From your answer to Nick's...]
> > so my first reaction to your saying "So DESTDIR must not affect it" is
> > "that
> > doesn't follow". Hence asking what it actually does at the moment.
>
> DESTDIR is a perl thingy. It will send all perl bits to DESTDIR.
>
> mod_perl.so and its .h files are not perl thingies, and so DESTDIR doesn't
> apply here by design. Simply because Apache thingies live under the Apache
> tree, not the perl tree.

As far as I can see DESTDIR's becoming pretty standard and it is available
in Apache's Makefile so I wouldn't call it a perl thingy anymore... Yet I
understand your point as we have two packages here ; once again, the question
is, does it make sense to build a separate package for mod_perl or should we
(can we btw?) always build both mod_perl *and* apache at the same time ?
My answer is still not for me...

PHP is another example of a non-apache "thing" that puts a lib in apache's
tree (I believe every single program that also builds an apache module out
there is too). PHP doesn't have a DESTDIR at all though, they chose to call
it INSTALL_ROOT, well, fine, it has the same purpose. There is almost the
same issue there. PHP installs everything in INSTALL_ROOT, regardless of
whether it's a php thing or an apache thing (mod_php.so). However if you
use apxs from your root installation instead as the one you built as a
package you may get a different layout from the one you'd expect for your
package. That's for the distribution maintainer to care for however.

Thanks
F.

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Frederic LE GUERN wrote:
>>Frederic LE GUERN wrote:
>>
>>>${source_dir}/src/modules/perl/Makefile does not reference $(DESTDIR) in
>>>install: rule, so when trying to make mod_perl2 as a relocatable package
>>>mod_perl.so and mod_perl .h files get installed system-wide.
>>>
>>>Here's a patch :
>>>
>>>--- Makefile.orig    2005-02-08 00:43:50.000000000 +0000
>>>+++ Makefile    2005-02-08 00:32:12.000000000 +0000
>>>@@ -101,12 +101,12 @@
>>>
>>> install:
>>> # install mod_perl.so
>>>-       @$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
>>>+       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
>>>        $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
>>>-       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
>>>+       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
>>> # install mod_perl .h files
>>>-       @$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
>>>-       $(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
>>>+       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
>>>+       $(MODPERL_CP) $(MODPERL_H_FILES) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
>>>
>>> .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s
>>
>>I understand that you are trying to solve the packager's problem, but I
>>think this is going to break things for the rest of the world, no?
>>
>>Also I suppose that your patch just illustrates the issue, since Makefiles
>>are autogenerated.
> 
> 
> Yes you're right the patch was just intended to make it clear
> where the problem was - and also it's here because that's how I solve the
> problem temporarily in the package build script, though it's a dirty hack.
> Sorry I can't offer a real solution, I'm not a mod_perl developper myself,
> I just had to install the package and saw this issue so I thought I'd
> mention it.

sure, but you can help us figure out a solution w/o knowing anything about 
mod_perl. The situation of the packagers is unique. One can think of it as 
if they are using chroot(1), where their / moves elsewhere. It'd be easy 
to make DESTDIR supported, but this is not the right thing. mod_perl has 
to be installed where all other Apache modules are. So DESTDIR must not 
affect it. Notice that unlike mp1, mp2 does not install mod_perl.so under 
the perl tree.

I suppose the simplest solution to this problem is to provide a new 
Makefile.PL argument, which will be the same as DESTDIR in the perl world, 
but for Apache things. e.g., MP_AP_DESTDIR, so if specified it can be used 
exactly as in your patch above. (handling the trailing slash of ofcourse). 
In your case MP_AP_DESTDIR will be the same value as DESTDIR.

If you have better ideas please speak up.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Frederic LE GUERN <fl...@apteryx.fr>.
> Frederic LE GUERN wrote:
> > ${source_dir}/src/modules/perl/Makefile does not reference $(DESTDIR) in
> > install: rule, so when trying to make mod_perl2 as a relocatable package
> > mod_perl.so and mod_perl .h files get installed system-wide.
> >
> > Here's a patch :
> >
> > --- Makefile.orig    2005-02-08 00:43:50.000000000 +0000
> > +++ Makefile    2005-02-08 00:32:12.000000000 +0000
> > @@ -101,12 +101,12 @@
> >
> >  install:
> >  # install mod_perl.so
> > -       @$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
> > +       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
> >         $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
> > -       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
> > +       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
> >  # install mod_perl .h files
> > -       @$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
> > -       $(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
> > +       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
> > +       $(MODPERL_CP) $(MODPERL_H_FILES) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
> >
> >  .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s
>
> I understand that you are trying to solve the packager's problem, but I
> think this is going to break things for the rest of the world, no?
>
> Also I suppose that your patch just illustrates the issue, since Makefiles
> are autogenerated.

Yes you're right the patch was just intended to make it clear
where the problem was - and also it's here because that's how I solve the
problem temporarily in the package build script, though it's a dirty hack.
Sorry I can't offer a real solution, I'm not a mod_perl developper myself,
I just had to install the package and saw this issue so I thought I'd
mention it.

Regards,
F.

Re: [mp2] DESTDIR does not apply to mod_perl.so and includes

Posted by Stas Bekman <st...@stason.org>.
Frederic LE GUERN wrote:
> ${source_dir}/src/modules/perl/Makefile does not reference $(DESTDIR) in
> install: rule, so when trying to make mod_perl2 as a relocatable package
> mod_perl.so and mod_perl .h files get installed system-wide.
> 
> Here's a patch :
> 
> --- Makefile.orig    2005-02-08 00:43:50.000000000 +0000
> +++ Makefile    2005-02-08 00:32:12.000000000 +0000
> @@ -101,12 +101,12 @@
> 
>  install:
>  # install mod_perl.so
> -       @$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
> +       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
>         $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
> -       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
> +       $(MODPERL_CP) $(MODPERL_LIB_DSO) $(DESTDIR)/$(MODPERL_AP_LIBEXECDIR)
>  # install mod_perl .h files
> -       @$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
> -       $(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
> +       @$(MKPATH) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
> +       $(MODPERL_CP) $(MODPERL_H_FILES) $(DESTDIR)/$(MODPERL_AP_INCLUDEDIR)
> 
>  .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s

I understand that you are trying to solve the packager's problem, but I 
think this is going to break things for the rest of the world, no?

Also I suppose that your patch just illustrates the issue, since Makefiles 
are autogenerated.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com