Updates and clarifies the issues_stats (Checkout Statistics) help file. This patch...
[koha.git] / Makefile.PL
index 4ac858f..7f97292 100644 (file)
@@ -250,6 +250,7 @@ my $target_map = {
   './changelanguage.pl'         => 'INTRANET_CGI_DIR',
   './check_sysprefs.pl'         => 'NONE',
   './circ'                      => 'INTRANET_CGI_DIR',
+  './offline_circ'             => 'INTRANET_CGI_DIR',
   './edithelp.pl'               => 'INTRANET_CGI_DIR',
   './etc'                       => { target => 'KOHA_CONF_DIR', trimdir => -1 },
   './etc/zebradb'               => { target => 'ZEBRA_CONF_DIR', trimdir => -1 },
@@ -260,6 +261,7 @@ my $target_map = {
   './errors'                    => {target => 'INTRANET_CGI_DIR'},
   './koha-tmpl/intranet-tmpl'   => {target => 'INTRANET_TMPL_DIR', trimdir => -1},
   './koha-tmpl/opac-tmpl'       => {target => 'OPAC_TMPL_DIR', trimdir => -1},
+  './koha-tmpl/robots.txt'      => {target => 'OPAC_WWW_DIR', trimdir => -1},
   './kohaversion.pl'            => 'INTRANET_CGI_DIR', 
   './labels'                    => 'INTRANET_CGI_DIR',
   './mainpage.pl'               => 'INTRANET_CGI_DIR',
@@ -279,7 +281,6 @@ my $target_map = {
   './reviews'                   => 'INTRANET_CGI_DIR',
   './rewrite-config.PL'         => 'NONE',
   './reviews'                   => 'INTRANET_CGI_DIR',
-  './rss'                       => 'MISC_DIR', 
   './serials'                   => 'INTRANET_CGI_DIR',
   './skel'                      => 'NONE',
   './skel/var/log/koha'         => { target => 'LOG_DIR', trimdir => -1 },
@@ -298,6 +299,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
@@ -412,9 +414,12 @@ my %config_defaults = (
   'PAZPAR2_PORT' => '11002',
   'RUN_DATABASE_TESTS' => 'no',
   'PATH_TO_ZEBRA' => '',
+  'USE_MEMCACHED'     => 'no',
+  'MEMCACHED_SERVERS' => '127.0.0.1:11211',
+  'MEMCACHED_NAMESPACE' => 'KOHA'
 );
 
-# set some default configuratio options based on OS
+# set some default configuration options based on OS
 # more conditions need to be added for other OS's
 # this should probably also incorporate usage of Win32::GetOSName() and/or Win32::GetOSVersion()
 # to allow for more granular decisions based on which Win32 platform
@@ -448,6 +453,7 @@ my %valid_config_values = (
   'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
   'ZEBRA_LANGUAGE'    => { 'en' => 1, 'fr' => 1 }, # FIXME should generate from contents of distribution
   'RUN_DATABASE_TESTS' => { 'yes' => 1, 'no' => 1 },
+  'USE_MEMCACHED'      => { 'yes' => 1, 'no' => 1 },
 );
 
 # get settings from command-line
@@ -531,33 +537,41 @@ WriteMakefile(
               AUTHOR       => 'Koha Developers <koha-devel@nongnu.org>',
               NO_META      => 1,
               PREREQ_PM => {
-                            'Algorithm::CheckDigits'          => 0.50,
+                            'Algorithm::CheckDigits'           => 0.50,
                             'Biblio::EndnoteStyle'             => 0.05,
                             'CGI'                              => 3.15,
                             'CGI::Carp'                        => 1.29,
-                            'CGI::Session'                     => '4.10',
+                            'CGI::Session'                     => 4.20,
+                            'CGI::Session::Serialize::yaml'    => 4.20,
                             'Class::Factory::Util'             => 1.6,
                             'Class::Accessor'                  => 0.30,
                             'DBD::mysql'                       => 4.004,
+                            'DBD::SQLite2'                     => 0.33, # optional, used for offline circulation
                             'DBI'                              => 1.53,
-                            'Data::ICal'                       => 0.13,
                             'Data::Dumper'                     => 2.121,
+                            'Data::ICal'                       => 0.13,
                             'Date::Calc'                       => 5.4,
                             'Date::ICal'                       => 1.72,
                             'Date::Manip'                      => 5.44,
                             'Digest::MD5'                      => 2.36,
+                            'Digest::SHA'                      => 5.43,
+                            '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,
                             'HTML::Template::Pro'              => 0.69,
                             'HTML::Scrubber'                   => 0.08,
                             'HTTP::Cookies'                    => 1.39,
+                            'HTTP::OAI'                        => 3.20,
                             'HTTP::Request::Common'            => 1.26,
-                            'Image::Magick'                    => 6.2, # optional
+                            'IPC::Cmd'                         => 0.46,
+                            'JSON'                             => 2.07, # Needed by admin/item_circulation_alerts.pl
                             'LWP::Simple'                      => 1.41,
                             'LWP::UserAgent'                   => 2.033,
                             'Lingua::Stem'                     => 0.82,
+                           'Lingua::Stem::Snowball'           => 0.952,
                             'List::Util'                       => 1.18,
                             'List::MoreUtils'                  => 0.21,
                             'Locale::Language'                 => 2.07,
@@ -566,24 +580,30 @@ 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,
+                            'Memoize::Memcached'               => 0.03, # optional
                             'Net::LDAP'                        => 0.33, # optional
                             'Net::LDAP::Filter'                => 0.14, # optional
                             'Net::Z3950::ZOOM'                 => 1.16,
+                            'Number::Format'                   => 1.52,
                             'PDF::API2'                        => 2.000,
                             'PDF::API2::Page'                  => 2.000,
                             'PDF::API2::Util'                  => 2.000,
+                            'PDF::API2::Simple'                => 1.000,
+                            'PDF::Table'                       => 0.9.3,
                             'PDF::Reuse'                       => 0.33,
                             'PDF::Reuse::Barcode'              => 0.05,
                             'POE'                              => 0.9999,
                             'POSIX'                            => 1.09,
                             'Schedule::At'                     => 1.06,
+                            'Storable'                        => 2.21,
                             'SMS::Send'                        => 0.05, # optional
                             'Term::ANSIColor'                  => 1.10,
                             'Test'                             => 1.25,
                             'Test::Harness'                    => 2.56,
-                            'Test::More'                       => 0.62,
+                            'Test::More'                       => 0.80,
                             'Text::CSV'                        => 0.01,
                             'Text::CSV_XS'                     => 0.32,
                             'Text::Iconv'                      => 1.7,
@@ -591,10 +611,12 @@ WriteMakefile(
                             'Time::HiRes'                      => 1.86,
                             'Time::localtime'                  => 1.02,
                             'Unicode::Normalize'               => 0.32,
+                            'URI::Escape'                      => 1.36,
                             'XML::Dumper'                      => 0.81,
                             'XML::LibXML'                      => 1.59,
                             'XML::LibXSLT'                     => 1.59,
                             'XML::SAX::ParserFactory'          => 1.01,
+                            'XML::SAX::Writer'                 => 0.44,
                             'XML::Simple'                      => 2.14,
                             'XML::RSS'                         => 1.31,
                             'YAML::Syck'                       => 0.71,
@@ -604,8 +626,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,
 );
@@ -832,7 +855,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
@@ -1071,6 +1097,26 @@ PazPar2 port?);
 
         }
     }
+  $msg = q(
+Use memcached and memoize to cache the results of some function calls? 
+This provides a signficant performance improvement. 
+You will need a Memcached server running.);
+  $msg .= _add_valid_values_disp('USE_MEMCACHED', $valid_values);
+  $config{'USE_MEMCACHED'} = _get_value('USE_MEMCACHED', $msg, $defaults->{'USE_MEMCACHED'}, $valid_values, $install_log_values);
+  if ($config{'USE_MEMCACHED'} eq 'yes'){
+      $msg = q(
+Since you've chosen to use caching, you must specify the memcached servers and the namespace to use:
+);
+      $msg = q(
+Memcached server address?);
+      $config{'MEMCACHED_SERVERS'} = _get_value('MEMCACHED_SERVERS', $msg, $defaults->{'MEMCACHED_SERVERS'}, $valid_values, $install_log_values);
+       
+      $msg = q(
+Memcached namespace?);
+      $config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values);
+  }
+
+
 
   $msg = q(
 Would you like to run the database-dependent test suite?);
@@ -1271,6 +1317,7 @@ sub get_target_directories {
 
     _get_env_overrides(\%dirmap);
     _get_argv_overrides(\%dirmap);
+    _add_destdir(\%dirmap) unless ($^O eq 'MSWin32');
 
     return \%dirmap, \%skipdirs;
 }
@@ -1319,6 +1366,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;
@@ -1394,7 +1455,7 @@ sub install {
     # installation and uninstallation targets.
 
 # If installation is on Win32, we need to do permissions different from *nix
-    if ( $^O =~ /darwin|linux|cygwin|freebsd/ ) { # this value needs to be verified for each platform and modified accordingly
+    if ( $^O =~ /darwin|linux|cygwin|freebsd|solaris/ ) { # this value needs to be verified for each platform and modified accordingly
            foreach my $key (sort keys %$target_directories) {
                    $install .= qq(
 KOHA_INST_$key = blib/$key
@@ -1416,9 +1477,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 {
@@ -1566,7 +1628,7 @@ sub postamble {
 
             # these directories will be relocated to the 't' directory
             foreach my $dirname ( keys %$target_directories ) {
-                my $dir = $target_directories->{$dirname};
+                my $dir = main::_strip_destdir( $target_directories->{$dirname} );
                 if ( exists $test_suite_override_dirs{$dirname} ) {
                     $dir = main::get_test_dir($dirname);
                 }