honor the DESTDIR environement variable when set
authorMarc Chantreux <marc.chantreux@biblibre.com>
Thu, 2 Jul 2009 11:16:17 +0000 (13:16 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Mon, 13 Jul 2009 10:42:36 +0000 (12:42 +0200)
for exemple: when you use
install_misc/environment_Makefile.PL DESTDIR=$HOME by default but koha
is installed in $HOME/koha-dev that is not expected!

Makefile.PL

index 3f14865..0803008 100644 (file)
@@ -841,7 +841,10 @@ be run from the current directory.
 
 Configuration directory:);
         # FIXME - home directory portability consideration apply
-        $install_base_default = (exists $ENV{'HOME'}) ? "$ENV{'HOME'}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev";
+        $install_base_default = 
+           $ENV{DESTDIR}
+           || ( exists $ENV{HOME} ? "$ENV{HOME}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev" ) 
+       ;
     } elsif ($config{'INSTALL_MODE'} eq 'single') {
         $msg = "\nPlease specify the directory in which to install Koha";
         # FIXME -- we're assuming under a 'single' mode install