perl local::lib problems with some makefiles (eg: git manual installation)

I tried to install the latest git in my ubuntu 9.04 and failed while trying to install some perl code. The makefile use prefix but does not check if there is a INSTALL_BASE variable already  defined in the system. This create a conflict having both prefix and install_base.

# installing git
sudo aptitude install git-core git-doc git-svn gitmagic gitweb
git-core git-doc git-svn gitmagic gitweb libdigest-sha1-perl{a} liberror-perl{a} libneon27-gnutls{a} libsvn-perl{a}

#updating git:

$ sudo apt-get build-dep git-core git-doc libssl-dev
$ wget
$ tar -xzf git-
$ cd git-
$ ./configure
$ make all doc
$ sudo make install install-doc
$ git --version
git version

[in my case wget]

ERROR because Local::Lib exported variable: INSTALL_BASE

/usr/bin/perl Makefile.PL PREFIX='/usr/local'
Only one of PREFIX or INSTALL_BASE can be given.  Not both.
make[1]: *** [perl.mak] Error 255
make: *** [perl/perl.mak] Error 2

!!! why /usr/bin/perl; ????? if I have my local perl 5.10.1 in my home and ‘which perl’ point to it. Seems that I would need to change the makefile options and the hardcoded perl location!!! <TO_DO>

$ make clean

<TO_DO> modify the makefile options for using my local perl 5.10.1 and use only the INSTALL_BASE (or only prefix deleting the install_base envvar)

## how Local::Lib works: it exports some variables from an eval in your .bashrc:

 pablo@pmg-linux:~$ perl -I$HOME/localperl/locallib/lib/perl5 -Mlocal::lib=$HOME/localperl/locallib
 export MODULEBUILDRC="/home/pablo/localperl/locallib/.modulebuildrc"
 export PERL_MM_OPT="INSTALL_BASE=/home/pablo/localperl/locallib"
 export PERL5LIB="/home/pablo/localperl/locallib/lib/perl5:/home/pablo/localperl/locallib/lib/perl5/i486-linux-gnu-thread-multi:$PERL5LIB"
 export PATH="/home/pablo/localperl/locallib/bin:$PATH"


And similar problems reported in the web:

From: Jakub Narebski <jnareb <at>>
Subject: Re: [ANNOUNCE] GIT 1.6.5
Newsgroups: gmane.comp.version-control.git
Date: 2009-10-14 22:11:50 GMT (9 weeks and 26 minutes ago)

Junio C Hamano <gitster <at>> writes:

> The latest feature release GIT 1.6.5 is available at the usual
> places:
>   git-1.6.5.tar.{gz,bz2}			(source tarball)
>   git-htmldocs-1.6.5.tar.{gz,bz2}		(preformatted docs)
>   git-manpages-1.6.5.tar.{gz,bz2}		(preformatted docs)
> The RPM binary packages for a few architectures are found in:
>   RPMS/$arch/git-*-1.6.5-1.fc9.$arch.rpm	(RPM)
> This cycle took a bit longer than I hoped, but here it is.  We already
> have some new features cooking in 'next', and I expect we may be able to
> have 1.6.6 by the end of the year.

Compiling git from source RPM git-1.6.5-1.fc9.src.rpm using

  $ rpmbuild --rebuild git-1.6.5-1.fc9.src.rpm

fails with the following error:

    SUBDIR perl
/usr/bin/perl Makefile.PL PREFIX='/usr'
Only one of PREFIX or INSTALL_BASE can be given.  Not both.
make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.53174 (%build)

Compiling git from source with

 $ make prefix=/home/local/git \
        bindir=/home/local/git \
        gitexecdir=/home/local/git \
        template_dir=/home/local/git \

gives the same error.

It might matter that I am using modern Perl way of installing Perl
modules locally, via local::lib, with ~/perl5/.modulebuildrc

  install  --install_base  /home/jnareb/perl5

and I have

  export MODULEBUILDRC="$HOME/perl5/.modulebuildrc"


 $ unset PERL_MM_OPT

before compiling (from SRPMS) made compilation pass this stage,
and finally succeed.

I guess that perl/Makefile (or rather the file that generates it)
should unset PERL_MM_OPT, or use INSTALL_BASE as DESTDIR rather
than fiddling with PREFIX.

But I am not a Perl hacker
perl, v5.8.6
ExtUtils::MakeMaker 6.54 (local)
ExtUtils::MakeMaker 6.17 (global)

export MODULEBUILDRC="$HOME/perl5/.modulebuildrc"
Jakub Narebski
ShadeHawk on #git

Leave a Reply

¡IMPORTANTE! Responde a la pregunta: ¿Cuál es el valor de 13 5 ?