# install does not obey DESTDIR or --prefix for perl modules

22 messages from 2009-09-21 to 2009-10-09. Participants: Craig Taylor, Brandon Casey, Junio C Hamano, Ben Walton, c^, Johannes Sixt.
Thread: https://gitlist.dev/t/21017

## Craig Taylor, 2009-09-21 16:05

Subject: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090921160551.GD8173@gryning.com>
URL: https://gitlist.dev/e/20090921160551.GD8173%40gryning.com

```
Hi all

I'm compiling/installing git in a Solaris environment without root.
Using 'make DESTDIR=<some path> install' to stage an install to an
alternate location.
The perl module component of 'make DESTDIR=<some path> install' installs
into the system perl lib path without prepending the forced install
destination or my '--prefix'.
This seems counter intuitive and I would consider a bug.

Regards
CraigT

-- 

c^ [c%5e]

The bamboo-shadows move over the stone steps
as if to sweep them, but no dust is stirred;
The moon is reflected deep in the pool, but the
water shows no trace of its penetration.

```

## Brandon Casey, 2009-09-21 16:58

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <Ow6bpZou9Vi0tKlyAN-qfjlAAtXvMqpXEAiG54zZ3C8fLI_6_Bt3oA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Ow6bpZou9Vi0tKlyAN-qfjlAAtXvMqpXEAiG54zZ3C8fLI_6_Bt3oA%40cipher.nrlssc.navy.mil
In-Reply-To: <20090921160551.GD8173@gryning.com>

```
Craig Taylor wrote:
> Hi all
> 
> I'm compiling/installing git in a Solaris environment without root.
> Using 'make DESTDIR=<some path> install' to stage an install to an
> alternate location.
> The perl module component of 'make DESTDIR=<some path> install' installs
> into the system perl lib path without prepending the forced install
> destination or my '--prefix'.
> This seems counter intuitive and I would consider a bug.

Try 'make prefix=<some path>'.

btw, this is in the first paragraph of the INSTALL document.

-brandon

```

## Junio C Hamano, 2009-09-21 17:58

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <7vskeguqmb.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vskeguqmb.fsf%40alter.siamese.dyndns.org
In-Reply-To: <Ow6bpZou9Vi0tKlyAN-qfjlAAtXvMqpXEAiG54zZ3C8fLI_6_Bt3oA@cipher.nrlssc.navy.mil>

```
Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:

> Craig Taylor wrote:
>> Hi all
>> 
>> I'm compiling/installing git in a Solaris environment without root.
>> Using 'make DESTDIR=<some path> install' to stage an install to an
>> alternate location.
>> The perl module component of 'make DESTDIR=<some path> install' installs
>> into the system perl lib path without prepending the forced install
>> destination or my '--prefix'.
>> This seems counter intuitive and I would consider a bug.
>
> Try 'make prefix=<some path>'.
>
> btw, this is in the first paragraph of the INSTALL document.

But is that what Craig is trying to do?

I think he wants to build git to be installed in /usr/bin/git or whatever,
and he would say "prefix=/usr".  He however wants "make install" to write
into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example
make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it
as root under the real '/'.  "make DESTDIR=/var/tmp/g" is exactly for
that, and if it is not working I would say it is a bug.

```

## Brandon Casey, 2009-09-21 18:34

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <HfI-UY0xo4DwMQZzRdb4aklE18OmVn-XMfoIB2UHx6G-nEoneRq5rQ@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/HfI-UY0xo4DwMQZzRdb4aklE18OmVn-XMfoIB2UHx6G-nEoneRq5rQ%40cipher.nrlssc.navy.mil
In-Reply-To: <7vskeguqmb.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano wrote:
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
>> Craig Taylor wrote:
>>> Hi all
>>>
>>> I'm compiling/installing git in a Solaris environment without root.
>>> Using 'make DESTDIR=<some path> install' to stage an install to an
>>> alternate location.
>>> The perl module component of 'make DESTDIR=<some path> install' installs
>>> into the system perl lib path without prepending the forced install
>>> destination or my '--prefix'.
>>> This seems counter intuitive and I would consider a bug.
>> Try 'make prefix=<some path>'.
>>
>> btw, this is in the first paragraph of the INSTALL document.
> 
> But is that what Craig is trying to do?
> 
> I think he wants to build git to be installed in /usr/bin/git or whatever,
> and he would say "prefix=/usr".  He however wants "make install" to write
> into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example
> make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it
> as root under the real '/'.  "make DESTDIR=/var/tmp/g" is exactly for
> that, and if it is not working I would say it is a bug.

Ah.  I did not realize that that is what DESTDIR is for.

Thanks for the correction.

-brandon

```

## Craig Taylor, 2009-09-21 19:19

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090921191943.GE8173@gryning.com>
URL: https://gitlist.dev/e/20090921191943.GE8173%40gryning.com
In-Reply-To: <7vskeguqmb.fsf@alter.siamese.dyndns.org>

```
On Mon, Sep 21, 2009 at 10:58:20AM -0700, Junio C Hamano wrote:
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
> > Craig Taylor wrote:
> >> Hi all
> >> 
> >> I'm compiling/installing git in a Solaris environment without root.
> >> Using 'make DESTDIR=<some path> install' to stage an install to an
> >> alternate location.
> >> The perl module component of 'make DESTDIR=<some path> install' installs
> >> into the system perl lib path without prepending the forced install
> >> destination or my '--prefix'.
> >> This seems counter intuitive and I would consider a bug.
> >
> > Try 'make prefix=<some path>'.
> >
> > btw, this is in the first paragraph of the INSTALL document.
> 
> But is that what Craig is trying to do?
> 
> I think he wants to build git to be installed in /usr/bin/git or whatever,
> and he would say "prefix=/usr".  He however wants "make install" to write
> into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example
> make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it
> as root under the real '/'.  "make DESTDIR=/var/tmp/g" is exactly for
> that, and if it is not working I would say it is a bug.

Exactly as you describe here, different paths but same goal.
All binaries follow the DESTDIR path except the perl modules.

To register this as a bug do I need to do more than send this email?

Thanks
CraigT

-- 

c^ [c%5e]

No think. No Talk. Train.

```

## Ben Walton, 2009-09-21 19:40

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <1253561929-sup-8931@ntdws12.chass.utoronto.ca>
URL: https://gitlist.dev/e/1253561929-sup-8931%40ntdws12.chass.utoronto.ca
In-Reply-To: <20090921191943.GE8173@gryning.com>

```
Excerpts from Craig Taylor's message of Mon Sep 21 15:19:43 -0400 2009:

> Exactly as you describe here, different paths but same goal.
> All binaries follow the DESTDIR path except the perl modules.

I haven't had this problem and I've been packaging git for solaris (8
or newer) since early 2009.  If you're interested in my build notes,
feel free to ping me.

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

```

## Junio C Hamano, 2009-09-21 19:44

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <7vocp4ulq2.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vocp4ulq2.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20090921191943.GE8173@gryning.com>

```
Craig Taylor <c@gryning.com> writes:

> Exactly as you describe here, different paths but same goal.
> All binaries follow the DESTDIR path except the perl modules.
>
> To register this as a bug do I need to do more than send this email?

Do you use NO_PERL_MAKEMAKER in your build?

If not, we need to summon an expert on ExtUtils::MakeMaker to look into
this issue, but if you do, perhaps you can try this patch and report how
well it works for you.

---
 perl/Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/perl/Makefile b/perl/Makefile
index e3dd1a5..4ab21d6 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
 	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
 	echo install: >> $@
-	echo '	mkdir -p "$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
+	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
-	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
+	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
 	echo instlibdir: >> $@
 	echo '	echo $(instdir_SQ)' >> $@
 else

```

## Craig Taylor, 2009-09-21 19:46

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090921194653.GG8173@gryning.com>
URL: https://gitlist.dev/e/20090921194653.GG8173%40gryning.com
In-Reply-To: <1253561929-sup-8931@ntdws12.chass.utoronto.ca>

```
On Mon, Sep 21, 2009 at 03:40:04PM -0400, Ben Walton wrote:
> Excerpts from Craig Taylor's message of Mon Sep 21 15:19:43 -0400 2009:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> 
> I haven't had this problem and I've been packaging git for solaris (8
> or newer) since early 2009.  If you're interested in my build notes,
> feel free to ping me.
> 
> Thanks
> -Ben

Will take you up on this. I'll re-raise this if they don't help.

Thanks
CraigT

-- 

c^ [c%5e]

Even when you are standing in front of defeat, do it smiling.

```

## Craig Taylor, 2009-09-21 19:54

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090921195407.GI8173@gryning.com>
URL: https://gitlist.dev/e/20090921195407.GI8173%40gryning.com
In-Reply-To: <7vocp4ulq2.fsf@alter.siamese.dyndns.org>

```
On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

I have 2 perl environments available to me on the system (at home now so
can't dig further).
Both can pretty stripped which can make thing "challenging" it's
possible ExtUtils::MakeMaker doesn't even exist.

Please everyone who is looking at this thread let it sleep for 24h and I
shall test further/revive it tomorrow.

Many thanks
CraigT

-- 

c^ [c%5e]

Learn first whatever hardship you may have to endure is but temporary

```

## Craig Taylor, 2009-09-22 11:13

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090922111309.GN8173@gryning.com>
URL: https://gitlist.dev/e/20090922111309.GN8173%40gryning.com
In-Reply-To: <7vocp4ulq2.fsf@alter.siamese.dyndns.org>

```
On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

ExtUtils::MakeMaker is available and I am using it.

The problem seems to be in the generated perl.mak.

On line 1652 of my git-1.6.4.3/Makefile
   $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install

I see that it is passing DESTDIR to the makefile in git-1.6.4.3/perl.
However, the DESTDIR variable is not seemingly included in perl/perl.mak for
use by the perl/Makefile. It is all absolute paths which I think is the
main cause.

I have manually manipulated the perl.mak file and install works fine.
I'm just updating my build area to 1.6.4.4 and then will try something
more permanent. However I am moving outside my knowldge of 'make' now so
may request assistance later ;)

CraigT

-- 

c^ [c%5e]

Never talk about your knowledge, it might make it disappear.

```

## Craig Taylor, 2009-09-22 11:31

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090922113151.GO8173@gryning.com>
URL: https://gitlist.dev/e/20090922113151.GO8173%40gryning.com
In-Reply-To: <7vocp4ulq2.fsf@alter.siamese.dyndns.org>

```
On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else


Further to my last email, modifying the perl.mak file as below resolves
the problem for me to a satisfactory level.
I will have to leave a more permanent solution to someone more familar with
make/makemaker.

--- git-1.6.4.4/perl/perl.mak_to20090922        2009-09-22 12:07:18.000000000 +0100
+++ git-1.6.4.4/perl/perl.mak   2009-09-22 12:21:17.791887000 +0100
@@ -57,7 +57,7 @@
 INST_LIB = blib/lib
 INST_ARCHLIB = blib/arch
 INST_SCRIPT = blib/script
-PREFIX = /usr/local/git-1.6.4.4
+PREFIX = $(DESTDIR)/usr/local/git-1.6.4.4
 INSTALLDIRS = site
 INSTALLPRIVLIB = $(PREFIX)/lib/5.6.1
 INSTALLARCHLIB = $(PREFIX)/lib/5.6.1/sun4-solaris

Many thanks...
CraigT

-- 

c^ [c%5e]

Failure is natural.

```

## c^, 2009-09-22 11:55

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <20090922115542.GP8173@gryning.com>
URL: https://gitlist.dev/e/20090922115542.GP8173%40gryning.com
In-Reply-To: <7vocp4ulq2.fsf@alter.siamese.dyndns.org>

```
On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

Frustratingly the last change forces the lib referenced in the perl
scripts to include the DESTDIR.
I will work around this for now, but would apprieciate it if someone
more familair could fix for the future.

CraigT

-- 

c^ [c%5e]

Failure is natural.

```

## Brandon Casey, 2009-09-22 14:52

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <Hfm4AdtlXpMutgmdj0vm7yb0ucfu_cijUloasBDWh6NfRCwLhP4OCA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/Hfm4AdtlXpMutgmdj0vm7yb0ucfu_cijUloasBDWh6NfRCwLhP4OCA%40cipher.nrlssc.navy.mil
In-Reply-To: <20090922113151.GO8173@gryning.com>

```
Craig Taylor wrote:
> On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
>> Craig Taylor <c@gryning.com> writes:
>>
>>> Exactly as you describe here, different paths but same goal.
>>> All binaries follow the DESTDIR path except the perl modules.
>>>
>>> To register this as a bug do I need to do more than send this email?
>> Do you use NO_PERL_MAKEMAKER in your build?
>>
>> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
>> this issue, but if you do, perhaps you can try this patch and report how
>> well it works for you.
>>
>> ---
>>  perl/Makefile |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/perl/Makefile b/perl/Makefile
>> index e3dd1a5..4ab21d6 100644
>> --- a/perl/Makefile
>> +++ b/perl/Makefile
>> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>>  	echo install: >> $@
>> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	echo instlibdir: >> $@
>>  	echo '	echo $(instdir_SQ)' >> $@
>>  else
> 
> 
> Further to my last email, modifying the perl.mak file as below resolves
> the problem for me to a satisfactory level.
> I will have to leave a more permanent solution to someone more familar with
> make/makemaker.
> 
> --- git-1.6.4.4/perl/perl.mak_to20090922        2009-09-22 12:07:18.000000000 +0100
> +++ git-1.6.4.4/perl/perl.mak   2009-09-22 12:21:17.791887000 +0100
> @@ -57,7 +57,7 @@
>  INST_LIB = blib/lib
>  INST_ARCHLIB = blib/arch
>  INST_SCRIPT = blib/script
> -PREFIX = /usr/local/git-1.6.4.4
> +PREFIX = $(DESTDIR)/usr/local/git-1.6.4.4
>  INSTALLDIRS = site
>  INSTALLPRIVLIB = $(PREFIX)/lib/5.6.1
>  INSTALLARCHLIB = $(PREFIX)/lib/5.6.1/sun4-solaris

I have not been able to reproduce your problem on Solaris.  The DESTDIR
feature is working for me.

Possibly it is related to the version of MakeMaker?  I am using version
6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86.  The
MakeMaker version should be in the header at the top of the perl.mak
file.

The perl.mak snippet that you provided above looks different than mine.
In mine, in the vicinity of the 'PREFIX = ' line I also have a
'DESTDIR = ' line.  The right hand side of 'DESTDIR = ' is empty even
when I specify a DESTDIR on the make command line.

Here's a snippet from my perl.mak file:

   DESTDIR =
   PREFIX = /usr/local/git-1.6.4.4
   PERLPREFIX = $(PREFIX)
   SITEPREFIX = $(PREFIX)
   VENDORPREFIX = $(PREFIX)
   INSTALLPRIVLIB = $(PERLPREFIX)/lib
   DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
   INSTALLSITELIB = $(SITEPREFIX)/lib/site_perl
   DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
   INSTALLVENDORLIB = $(VENDORPREFIX)/lib
   DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
   INSTALLARCHLIB = $(PERLPREFIX)/lib/i86pc-solaris-64int
   DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)

Notice the variable assignments that begin with 'DEST'.  Does your
perl.mak file have those?  If not, then it seems MakeMaker is not
producing them for some reason.

Did you try Junio's patch?  If the version of MakeMaker is the problem,
then perhaps setting NO_PERL_MAKER=1 on the make command line along
with Junio's patch is the best way forward for you.

-brandon

```

## Brandon Casey, 2009-09-22 15:16

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <fTPSiYVR_0aJPW67ZWx3xlDqQCHFqawOhMTI1M76i0EnhLLbCjwHyw@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/fTPSiYVR_0aJPW67ZWx3xlDqQCHFqawOhMTI1M76i0EnhLLbCjwHyw%40cipher.nrlssc.navy.mil
In-Reply-To: <20090922115542.GP8173@gryning.com>

```
c^ wrote:
> On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
>> Craig Taylor <c@gryning.com> writes:
>>
>>> Exactly as you describe here, different paths but same goal.
>>> All binaries follow the DESTDIR path except the perl modules.
>>>
>>> To register this as a bug do I need to do more than send this email?
>> Do you use NO_PERL_MAKEMAKER in your build?
>>
>> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
>> this issue, but if you do, perhaps you can try this patch and report how
>> well it works for you.
>>
>> ---
>>  perl/Makefile |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/perl/Makefile b/perl/Makefile
>> index e3dd1a5..4ab21d6 100644
>> --- a/perl/Makefile
>> +++ b/perl/Makefile
>> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>>  	echo install: >> $@
>> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	echo instlibdir: >> $@
>>  	echo '	echo $(instdir_SQ)' >> $@
>>  else
> 
> Frustratingly the last change forces the lib referenced in the perl
> scripts to include the DESTDIR.
> I will work around this for now, but would apprieciate it if someone
> more familair could fix for the future.

Craig, you're referring to _your_ last change where you hand modified the
perl.mak file so that the 'PREFIX =' line contained $(DESTDIR) right?  And
not something in the above patch?

Junio, your patch looks good and seems to work for me.

-brandon

ps.  Craig, it's best to hit 'Reply-All' when replying so that everyone is kept
     in the cc list.  People often filter their mail based on the 'To:' and 'cc:'
     fields and are more likely to notice mail that includes their address in one
     of those fields.  I added Junio back to this reply.

```

## Brandon Casey, 2009-09-22 15:21

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <u3kL87BpSTWlFUSold4Zu9qNO7FQG-a17sfZVC43MQqJj7qnjMBzsw@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/u3kL87BpSTWlFUSold4Zu9qNO7FQG-a17sfZVC43MQqJj7qnjMBzsw%40cipher.nrlssc.navy.mil
In-Reply-To: <Hfm4AdtlXpMutgmdj0vm7yb0ucfu_cijUloasBDWh6NfRCwLhP4OCA@cipher.nrlssc.navy.mil>

```
Brandon Casey wrote:

> Did you try Junio's patch?  If the version of MakeMaker is the problem,
> then perhaps setting NO_PERL_MAKER=1 on the make command line along
                       ^^^^^^^^^^^^^

Should be NO_PERL_MAKEMAKER=1

```

## Junio C Hamano, 2009-09-22 16:29

Subject: Re: install does not obey DESTDIR or --prefix for perl modules
Message-ID: <7vk4zrt035.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk4zrt035.fsf%40alter.siamese.dyndns.org
In-Reply-To: <Hfm4AdtlXpMutgmdj0vm7yb0ucfu_cijUloasBDWh6NfRCwLhP4OCA@cipher.nrlssc.navy.mil>

```
Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:

> Possibly it is related to the version of MakeMaker?  I am using version
> 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86.  The
> MakeMaker version should be in the header at the top of the perl.mak
> file.

I think that is it.  DESTDIR support in MakeMaker seems to be lacking in
medieval versions of Perl.  It appears that it started being usable at
around its 6.11 (and 6.17 you have is fine).

    http://kobesearch.cpan.org/htdocs/ExtUtils-MakeMaker/Changes.html
    https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6131#c7

```

## Brandon Casey, 2009-09-24 18:02

Subject: [PATCH] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <7wQSYSBJPoVtvyGI0lqsDW37w4byCpgpMaHiDKALwW_oJ9nHXddX9OBMnqXGZBVAo2U7Tc1BMxg@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/7wQSYSBJPoVtvyGI0lqsDW37w4byCpgpMaHiDKALwW_oJ9nHXddX9OBMnqXGZBVAo2U7Tc1BMxg%40cipher.nrlssc.navy.mil
In-Reply-To: <7vk4zrt035.fsf@alter.siamese.dyndns.org>

```
From: Brandon Casey <drafnel@gmail.com>

It appears that ExtUtils::MakeMaker versions older than 6.11 do not
implement the DESTDIR mechanism.  So add a test to the generated perl.mak
to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
abort with a message suggesting the use of NO_PERL_MAKEMAKER.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


Junio C Hamano wrote:
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
>> Possibly it is related to the version of MakeMaker?  I am using version
>> 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86.  The
>> MakeMaker version should be in the header at the top of the perl.mak
>> file.
> 
> I think that is it.  DESTDIR support in MakeMaker seems to be lacking in
> medieval versions of Perl.  It appears that it started being usable at
> around its 6.11 (and 6.17 you have is fine).
> 
>     http://kobesearch.cpan.org/htdocs/ExtUtils-MakeMaker/Changes.html
>     https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6131#c7

How about something like this?

Seems to work correctly for me on IRIX 6.5 and Solaris 7 with
ExtUtils::MakeMaker 6.03.

-brandon


 perl/Makefile.PL |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 320253e..8974015 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,14 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITELIB)'
 
+ifneq (,$(DESTDIR))
+ifeq (1,$(shell expr '$(MM_VERSION)' '<' 6.11))
+$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
+	is likely incompatible with the DESTDIR mechanism.  Try setting \
+	NO_PERL_MAKEMAKER=1 instead)
+endif
+endif
+
 MAKE_FRAG
 }
 
-- 
1.6.4.3

```

## Brandon Casey, 2009-09-24 18:21

Subject: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <FE_WTi0YAHrCrSdGFemlb7ALatFkdSu5V7Yfb5CUgyoxfv3ZFXdFABKbT1boP7aeGWli-gJPcBA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/FE_WTi0YAHrCrSdGFemlb7ALatFkdSu5V7Yfb5CUgyoxfv3ZFXdFABKbT1boP7aeGWli-gJPcBA%40cipher.nrlssc.navy.mil
In-Reply-To: <7wQSYSBJPoVtvyGI0lqsDW37w4byCpgpMaHiDKALwW_oJ9nHXddX9OBMnqXGZBVAo2U7Tc1BMxg@cipher.nrlssc.navy.mil>

```
From: Brandon Casey <drafnel@gmail.com>

It appears that ExtUtils::MakeMaker versions older than 6.11 do not
implement the DESTDIR mechanism.  So add a test to the generated perl.mak
to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
abort with a message suggesting the use of NO_PERL_MAKEMAKER.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


This just reverses the logic in the test on $(MM_VERSION) so that the test
will also fail if MM_VERSION is unset.  Who knows if ancient versions set
it.  Sorry for the quick v2.

-brandon


 perl/Makefile.PL |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 320253e..0b9deca 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,14 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITELIB)'
 
+ifneq (,$(DESTDIR))
+ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
+$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
+	is likely incompatible with the DESTDIR mechanism.  Try setting \
+	NO_PERL_MAKEMAKER=1 instead)
+endif
+endif
+
 MAKE_FRAG
 }
 
-- 
1.6.4.3

```

## Johannes Sixt, 2009-10-08 13:21

Subject: Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <4ACDE76C.4040307@viscovery.net>
URL: https://gitlist.dev/e/4ACDE76C.4040307%40viscovery.net
In-Reply-To: <FE_WTi0YAHrCrSdGFemlb7ALatFkdSu5V7Yfb5CUgyoxfv3ZFXdFABKbT1boP7aeGWli-gJPcBA@cipher.nrlssc.navy.mil>

```
Brandon Casey schrieb:
> From: Brandon Casey <drafnel@gmail.com>
> 
> It appears that ExtUtils::MakeMaker versions older than 6.11 do not
> implement the DESTDIR mechanism.  So add a test to the generated perl.mak
> to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
> abort with a message suggesting the use of NO_PERL_MAKEMAKER.
> 
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
> 
> 
> This just reverses the logic in the test on $(MM_VERSION) so that the test
> will also fail if MM_VERSION is unset.  Who knows if ancient versions set
> it.  Sorry for the quick v2.
> 
> -brandon
> 
> 
>  perl/Makefile.PL |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
> index 320253e..0b9deca 100644
> --- a/perl/Makefile.PL
> +++ b/perl/Makefile.PL
> @@ -5,6 +5,14 @@ sub MY::postamble {
>  instlibdir:
>  	@echo '$(INSTALLSITELIB)'
>  
> +ifneq (,$(DESTDIR))
> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))

I don't think the test works as intended, because 6.2 *is* greater than
6.10 (aka 6.1).

(Found while staring at git diff v1.6.5-rc2..v1.6.5-rc3 in a spare minute.)

> +$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
> +	is likely incompatible with the DESTDIR mechanism.  Try setting \
> +	NO_PERL_MAKEMAKER=1 instead)
> +endif
> +endif
> +
>  MAKE_FRAG
>  }

-- Hannes

```

## Brandon Casey, 2009-10-08 13:34

Subject: Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <unyNhuV9VB06SYvOR8ONK47yVKPtJfgRVKs-sKMFc-8rKMQBz7DPnw@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/unyNhuV9VB06SYvOR8ONK47yVKPtJfgRVKs-sKMFc-8rKMQBz7DPnw%40cipher.nrlssc.navy.mil
In-Reply-To: <4ACDE76C.4040307@viscovery.net>

```
Johannes Sixt wrote:
> Brandon Casey schrieb:
>> From: Brandon Casey <drafnel@gmail.com>
>>
>> It appears that ExtUtils::MakeMaker versions older than 6.11 do not
>> implement the DESTDIR mechanism.  So add a test to the generated perl.mak
>> to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
>> abort with a message suggesting the use of NO_PERL_MAKEMAKER.
>>
>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
>> ---
>>
>>
>> This just reverses the logic in the test on $(MM_VERSION) so that the test
>> will also fail if MM_VERSION is unset.  Who knows if ancient versions set
>> it.  Sorry for the quick v2.
>>
>> -brandon
>>
>>
>>  perl/Makefile.PL |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
>> index 320253e..0b9deca 100644
>> --- a/perl/Makefile.PL
>> +++ b/perl/Makefile.PL
>> @@ -5,6 +5,14 @@ sub MY::postamble {
>>  instlibdir:
>>  	@echo '$(INSTALLSITELIB)'
>>  
>> +ifneq (,$(DESTDIR))
>> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
> 
> I don't think the test works as intended, because 6.2 *is* greater than
> 6.10 (aka 6.1).

Hmm... I think you're right.

-brandon

```

## Brandon Casey, 2009-10-08 16:58

Subject: Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <F3v6_n7wtTFWz8nzE5EpqB8ZsobXLax0nn_ghA5foHOvOJEMjHl0Qw@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/F3v6_n7wtTFWz8nzE5EpqB8ZsobXLax0nn_ghA5foHOvOJEMjHl0Qw%40cipher.nrlssc.navy.mil
In-Reply-To: <unyNhuV9VB06SYvOR8ONK47yVKPtJfgRVKs-sKMFc-8rKMQBz7DPnw@cipher.nrlssc.navy.mil>

```
Brandon Casey wrote:
> Johannes Sixt wrote:
>> Brandon Casey schrieb:

>>> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
>>> index 320253e..0b9deca 100644
>>> --- a/perl/Makefile.PL
>>> +++ b/perl/Makefile.PL
>>> @@ -5,6 +5,14 @@ sub MY::postamble {
>>>  instlibdir:
>>>  	@echo '$(INSTALLSITELIB)'
>>>  
>>> +ifneq (,$(DESTDIR))
>>> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
>> I don't think the test works as intended, because 6.2 *is* greater than
>> 6.10 (aka 6.1).
> 
> Hmm... I think you're right.

I think we're safe.  Looks like the MakeMaker folks have always used two
digits for the minor number.  So version 6.2 was written like 6.02.

Here's their repo:

   git://github.com/schwern/extutils-makemaker.git

git log -p -- lib/ExtUtils/MakeMaker.pm | grep -- '$VERSION = ' | less

I didn't search exhaustively, but I think all of 6.X has two digit minor
numbers, which means all versions should compare correctly since 5.X will
always compare less than 6.X and 7.X will be greater, etc.

-brandon

```

## Junio C Hamano, 2009-10-09 06:51

Subject: Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR
Message-ID: <7vljjl5ac8.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vljjl5ac8.fsf%40alter.siamese.dyndns.org
In-Reply-To: <F3v6_n7wtTFWz8nzE5EpqB8ZsobXLax0nn_ghA5foHOvOJEMjHl0Qw@cipher.nrlssc.navy.mil>

```
Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:

> I think we're safe.

Thanks.

```
