If itemnumber is sent to catalogue/moredetail.pl use it
[koha.git] / Makefile.PL
index c810353..670e8e2 100644 (file)
@@ -298,6 +298,7 @@ my $target_map = {
   './suggestion'                => 'INTRANET_CGI_DIR',
   './svc'                       => 'INTRANET_CGI_DIR',
   './t'                         => 'NONE',
+  './tags'                      => 'INTRANET_CGI_DIR',
   './tmp'                       => 'NONE', # FIXME need to determine whether 
                                            # Koha generates any persistent temp files
                                            # that should go in /var/tmp/koha
@@ -546,7 +547,9 @@ WriteMakefile(
                             'Date::ICal'                       => 1.72,
                             'Date::Manip'                      => 5.44,
                             'Digest::MD5'                      => 2.36,
+                            'Email::Date'                      => 1.103,
                             'File::Temp'                       => 0.16,
+                            'GD'                               => 2.39,    #optional
                             'GD::Barcode::UPCE'                => 1.1,
                             'Getopt::Long'                     => 2.35,
                             'Getopt::Std'                      => 1.05,
@@ -554,7 +557,6 @@ WriteMakefile(
                             'HTML::Scrubber'                   => 0.08,
                             'HTTP::Cookies'                    => 1.39,
                             'HTTP::Request::Common'            => 1.26,
-                            'Image::Magick'                    => 6.2,
                             'LWP::Simple'                      => 1.41,
                             'LWP::UserAgent'                   => 2.033,
                             'Lingua::Stem'                     => 0.82,
@@ -566,10 +568,11 @@ WriteMakefile(
                             'MARC::File::XML'                  => 0.88,
                             'MARC::Record'                     => 2.00,
                             'MIME::Base64'                     => 3.07,
+                            'MIME::Lite'                       => 3.00,
                             'MIME::QuotedPrint'                => 3.07,
                             'Mail::Sendmail'                   => 0.79,
-                            'Net::LDAP'                        => 0.33,
-                            'Net::LDAP::Filter'                => 0.14,
+                            'Net::LDAP'                        => 0.33, # optional
+                            'Net::LDAP::Filter'                => 0.14, # optional
                             'Net::Z3950::ZOOM'                 => 1.16,
                             'PDF::API2'                        => 2.000,
                             'PDF::API2::Page'                  => 2.000,
@@ -579,7 +582,7 @@ WriteMakefile(
                             'POE'                              => 0.9999,
                             'POSIX'                            => 1.09,
                             'Schedule::At'                     => 1.06,
-                            'SMS::Send'                        => 0.05,
+                            'SMS::Send'                        => 0.05, # optional
                             'Term::ANSIColor'                  => 1.10,
                             'Test'                             => 1.25,
                             'Test::Harness'                    => 2.56,
@@ -604,8 +607,9 @@ WriteMakefile(
               PM => $file_map,
 
               # Man pages generated from POD
-              INSTALLMAN1DIR => File::Spec->catdir($target_directories->{'MAN_DIR'}, 'man1'),
-              INSTALLMAN3DIR => File::Spec->catdir($target_directories->{'MAN_DIR'}, 'man3'),
+             # ExtUtils::MakeMaker already manage $(DESTDIR)
+              INSTALLMAN1DIR => File::Spec->catdir(_strip_destdir($target_directories->{'MAN_DIR'}), 'man1'),
+              INSTALLMAN3DIR => File::Spec->catdir(_strip_destdir($target_directories->{'MAN_DIR'}), 'man3'),
 
               PL_FILES => $pl_files,
 );
@@ -1271,6 +1275,7 @@ sub get_target_directories {
 
     _get_env_overrides(\%dirmap);
     _get_argv_overrides(\%dirmap);
+    _add_destdir(\%dirmap);
 
     return \%dirmap, \%skipdirs;
 }
@@ -1319,6 +1324,20 @@ sub _get_argv_overrides {
     @ARGV = @new_argv;
 }
 
+sub _strip_destdir {
+    my $dir = shift;
+    $dir =~ s/^\$\(DESTDIR\)//;
+    return $dir;
+}
+
+sub _add_destdir {
+    my $dirmap = shift;
+
+    foreach my $key (keys %$dirmap) {
+        $dirmap->{$key} = '$(DESTDIR)'.$dirmap->{$key};
+    }
+}
+
 sub display_configuration {
     my $config = shift;
     my $dirmap = shift;
@@ -1416,9 +1435,10 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en
 
                        $install .= "\n";
                        $install .= "set_koha_ownership ::\n";
+# Do not try to change ownership if DESTDIR is set
                        if ($config{'INSTALL_MODE'} eq 'standard' and $config{'KOHA_USER'} ne "root") {
                                foreach my $key (sort keys %$target_directories) {
-                                       $install .= "\t\$(NOECHO) chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key)\n"
+                                       $install .= "\t\$(NOECHO) if test -z \"\$(DESTDIR)\"; then chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key); fi\n"
                                                unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key};
                                }
                        } else {