# [PATCH] Don't cache DESTDIR in perl/perl.mak.

5 messages from 2007-12-10 to 2007-12-18. Participants: Gerrit Pape, Junio C Hamano, Eric Wong, Pierre Habouzit.
Thread: https://gitlist.dev/t/11219

## Gerrit Pape, 2007-12-10 09:31

Subject: [PATCH] Don't cache DESTDIR in perl/perl.mak.
Message-ID: <20071210093102.3050.qmail@06e91d20307a62.315fe32.mid.smarden.org>
URL: https://gitlist.dev/e/20071210093102.3050.qmail%4006e91d20307a62.315fe32.mid.smarden.org

```
DESTDIR is supposed to be overridden on 'make install' after doing
'make'.  Have the automatically generated perl/perl.mak not cache the
value of DESTDIR to support that for the perl/ subdirectory also.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 Makefile         |    2 +-
 perl/Makefile.PL |    6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 4cdb84b..3615be0 100644
--- a/Makefile
+++ b/Makefile
@@ -1025,7 +1025,7 @@ install: all
 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 	$(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
-	$(MAKE) -C perl prefix='$(prefix_SQ)' install
+	$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
 ifndef NO_TCLTK
 	$(MAKE) -C gitk-git install
 	$(MAKE) -C git-gui install
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 6aecd89..320253e 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -17,9 +17,6 @@ if ($@ || $Error::VERSION < 0.15009) {
 	$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
 }
 
-my %extra;
-$extra{DESTDIR} = $ENV{DESTDIR} if $ENV{DESTDIR};
-
 # redirect stdout, otherwise the message "Writing perl.mak for Git"
 # disrupts the output for the target 'instlibdir'
 open STDOUT, ">&STDERR";
@@ -29,6 +26,5 @@ WriteMakefile(
 	VERSION_FROM    => 'Git.pm',
 	PM		=> \%pm,
 	MAKEFILE	=> 'perl.mak',
-	INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3',
-	%extra
+	INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'
 );
-- 
1.5.3.4

```

## Junio C Hamano, 2007-12-10 19:24

Subject: Re: [PATCH] Don't cache DESTDIR in perl/perl.mak.
Message-ID: <7vodcyl5dy.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vodcyl5dy.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20071210093102.3050.qmail@06e91d20307a62.315fe32.mid.smarden.org>

```
Hmph.  That's reverting this:

commit 4c5cf8c44ce06a79da5bafd4a92e6d6f598cea2e
Author: Eric Wong <normalperson@yhbt.net>
Date:   Sun Aug 13 04:13:25 2006 -0700

    pass DESTDIR to the generated perl/Makefile
    
    Makes life for binary packagers easier, as the Perl modules will
    be installed inside DESTDIR.
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
    Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric, care to comment?

```

## Eric Wong, 2007-12-12 18:01

Subject: Re: [PATCH] Don't cache DESTDIR in perl/perl.mak.
Message-ID: <20071212180050.GA18980@untitled>
URL: https://gitlist.dev/e/20071212180050.GA18980%40untitled
In-Reply-To: <7vodcyl5dy.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> wrote:
> Hmph.  That's reverting this:
> 
> commit 4c5cf8c44ce06a79da5bafd4a92e6d6f598cea2e
> Author: Eric Wong <normalperson@yhbt.net>
> Date:   Sun Aug 13 04:13:25 2006 -0700
> 
>     pass DESTDIR to the generated perl/Makefile
>     
>     Makes life for binary packagers easier, as the Perl modules will
>     be installed inside DESTDIR.
>     
>     Signed-off-by: Eric Wong <normalperson@yhbt.net>
>     Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
> Eric, care to comment?

I used to make a statically linked binary package for working on an
ancient box that didn't have a lot of libraries I wanted, and I probably
just called `make install' into DESTDIR as a single step without calling
`make' alone without DESTDIR argument, or I had DESTDIR set in
config.mak

-- 
Eric Wong

```

## Pierre Habouzit, 2007-12-12 20:02

Subject: Re: [PATCH] Don't cache DESTDIR in perl/perl.mak.
Message-ID: <20071212200211.GB1060@artemis.madism.org>
URL: https://gitlist.dev/e/20071212200211.GB1060%40artemis.madism.org
In-Reply-To: <20071212180050.GA18980@untitled>

```
On Wed, Dec 12, 2007 at 06:01:48PM +0000, Eric Wong wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > Hmph.  That's reverting this:
> > 
> > commit 4c5cf8c44ce06a79da5bafd4a92e6d6f598cea2e
> > Author: Eric Wong <normalperson@yhbt.net>
> > Date:   Sun Aug 13 04:13:25 2006 -0700
> > 
> >     pass DESTDIR to the generated perl/Makefile
> >     
> >     Makes life for binary packagers easier, as the Perl modules will
> >     be installed inside DESTDIR.
> >     
> >     Signed-off-by: Eric Wong <normalperson@yhbt.net>
> >     Signed-off-by: Junio C Hamano <junkio@cox.net>
> > 
> > Eric, care to comment?
> 
> I used to make a statically linked binary package for working on an
> ancient box that didn't have a lot of libraries I wanted, and I probably
> just called `make install' into DESTDIR as a single step without calling
> `make' alone without DESTDIR argument, or I had DESTDIR set in
> config.mak

  Actually this fact generated a bug in debian packaging because git is
built then installed twice in different DESTDIRS, then parts of the
install is pruned (the two installs are arch-dependant and
arch-independant files install so it's a very good reason in term of
packaging).

  The fact that perl.mak caches the DESTDIR make it install things in
the wrong place because it doesn't honour make DESTDIR=foo install and
always use the cached value instead, which is wrong.

  I think Gerrit won't care if it's cached or not, he just cares that it
still honours environment if present.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```

## Gerrit Pape, 2007-12-18 14:25

Subject: Re: [PATCH] Don't cache DESTDIR in perl/perl.mak.
Message-ID: <20071218142537.23571.qmail@5b1a609bf11950.315fe32.mid.smarden.org>
URL: https://gitlist.dev/e/20071218142537.23571.qmail%405b1a609bf11950.315fe32.mid.smarden.org
In-Reply-To: <20071212200211.GB1060@artemis.madism.org>

```
On Wed, Dec 12, 2007 at 09:02:11PM +0100, Pierre Habouzit wrote:
> On Wed, Dec 12, 2007 at 06:01:48PM +0000, Eric Wong wrote:
> > Junio C Hamano <gitster@pobox.com> wrote:
> > > Hmph.  That's reverting this:
> > > 
> > > commit 4c5cf8c44ce06a79da5bafd4a92e6d6f598cea2e

> > > Eric, care to comment?
> > 
> > I used to make a statically linked binary package for working on an
> > ancient box that didn't have a lot of libraries I wanted, and I probably
> > just called `make install' into DESTDIR as a single step without calling
> > `make' alone without DESTDIR argument, or I had DESTDIR set in
> > config.mak
> 
>   Actually this fact generated a bug in debian packaging because git is
> built then installed twice in different DESTDIRS, then parts of the
> install is pruned (the two installs are arch-dependant and
> arch-independant files install so it's a very good reason in term of
> packaging).
> 
>   The fact that perl.mak caches the DESTDIR make it install things in
> the wrong place because it doesn't honour make DESTDIR=foo install and
> always use the cached value instead, which is wrong.
> 
>   I think Gerrit won't care if it's cached or not, he just cares that it
> still honours environment if present.

Yes, precisely.  Thanks, Gerrit.

```
