X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Makefile.PL;h=167fc9c2579941cea7128cc87d53d2bd71e46a8e;hb=98406923bb2d6a7632d5c8f10525c398efa594bf;hp=7f04cb79e620bb3382f2793599332e581e30ae6e;hpb=1a6d84c4a6fd5d9ed44b3a4b618adc37e2b14fde;p=koha.git diff --git a/Makefile.PL b/Makefile.PL index 7f04cb79e6..167fc9c257 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 @@ -411,6 +412,7 @@ my %config_defaults = ( 'PAZPAR2_HOST' => 'localhost', 'PAZPAR2_PORT' => '11002', 'RUN_DATABASE_TESTS' => 'no', + 'PATH_TO_ZEBRA' => '', ); # set some default configuratio options based on OS @@ -523,91 +525,91 @@ my %test_suite_override_dirs = ( ); WriteMakefile( - NAME => 'koha', - #VERSION => strftime('2.9.%Y%m%d%H',gmtime), - VERSION_FROM => 'kohaversion.pl', - ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC', - AUTHOR => 'Koha Developers ', - NO_META => 1, - PREREQ_PM => { -# awaiting package maintainer's use of $VERSION -#'Algorithm::CheckDigits' => 0.48, -#'Algorithm::CheckDigits::M43_001' => 0.48, -'Biblio::EndnoteStyle' => 0.05, -'CGI' => 3.15, -'CGI::Carp' => 1.29, -'CGI::Session' => '4.10', -'Class::Factory::Util' => 1.6, -'Class::Accessor' => 0.30, -'DBD::mysql' => 4.004, -'DBI' => 1.53, -'Data::ICal' => 0.13, -'Data::Dumper' => 2.121, -'Date::Calc' => 5.4, -'Date::ICal' => 1.72, -'Date::Manip' => 5.44, -'Digest::MD5' => 2.36, -'File::Temp' => 0.16, -'GD::Barcode::UPCE' => 1.1, -'Getopt::Long' => 2.35, -'Getopt::Std' => 1.05, -'HTML::Template::Pro' => 0.69, -'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, -'List::Util' => 1.18, -'List::MoreUtils' => 0.21, -'Locale::Language' => 2.07, -'MARC::Charset' => 0.98, -'MARC::Crosswalk::DublinCore' => 0.02, -'MARC::File::XML' => 0.88, -'MARC::Record' => 2.00, -'MIME::Base64' => 3.07, -'MIME::QuotedPrint' => 3.07, -'Mail::Sendmail' => 0.79, -'Net::LDAP' => 0.33, -'Net::LDAP::Filter' => 0.14, -'Net::Z3950::ZOOM' => 1.16, -'PDF::API2' => 2.000, -'PDF::API2::Page' => 2.000, -'PDF::API2::Util' => 2.000, -'PDF::Reuse' => 0.33, -'PDF::Reuse::Barcode' => 0.05, -'POE' => 0.9999, -'POSIX' => 1.09, -'Schedule::At' => 1.06, -'Term::ANSIColor' => 1.10, -'Test' => 1.25, -'Test::Harness' => 2.56, -'Test::More' => 0.62, -'Text::CSV' => 0.01, -'Text::CSV_XS' => 0.32, -'Text::Iconv' => 1.7, -'Text::Wrap' => 2005.082401, -'Time::HiRes' => 1.86, -'Time::localtime' => 1.02, -'Unicode::Normalize' => 0.32, -'XML::Dumper' => 0.81, -'XML::LibXML' => 1.59, -'XML::LibXSLT' => 1.59, -'XML::SAX::ParserFactory' => 1.01, -'XML::Simple' => 2.14, -'XML::RSS' => 1.31, -'YAML::Syck' => 0.71, - }, - - # File tree mapping - 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'), - - PL_FILES => $pl_files, - + NAME => 'koha', + #VERSION => strftime('2.9.%Y%m%d%H',gmtime), + VERSION_FROM => 'kohaversion.pl', + ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC', + AUTHOR => 'Koha Developers ', + NO_META => 1, + PREREQ_PM => { + 'Algorithm::CheckDigits' => 0.50, + 'Biblio::EndnoteStyle' => 0.05, + 'CGI' => 3.15, + 'CGI::Carp' => 1.29, + 'CGI::Session' => '4.10', + 'Class::Factory::Util' => 1.6, + 'Class::Accessor' => 0.30, + 'DBD::mysql' => 4.004, + 'DBI' => 1.53, + 'Data::ICal' => 0.13, + 'Data::Dumper' => 2.121, + 'Date::Calc' => 5.4, + 'Date::ICal' => 1.72, + 'Date::Manip' => 5.44, + 'Digest::MD5' => 2.36, + 'File::Temp' => 0.16, + '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::Request::Common' => 1.26, + 'Image::Magick' => 6.2, # optional + 'LWP::Simple' => 1.41, + 'LWP::UserAgent' => 2.033, + 'Lingua::Stem' => 0.82, + 'List::Util' => 1.18, + 'List::MoreUtils' => 0.21, + 'Locale::Language' => 2.07, + 'MARC::Charset' => 0.98, + 'MARC::Crosswalk::DublinCore' => 0.02, + '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, # optional + 'Net::LDAP::Filter' => 0.14, # optional + 'Net::Z3950::ZOOM' => 1.16, + 'PDF::API2' => 2.000, + 'PDF::API2::Page' => 2.000, + 'PDF::API2::Util' => 2.000, + 'PDF::Reuse' => 0.33, + 'PDF::Reuse::Barcode' => 0.05, + 'POE' => 0.9999, + 'POSIX' => 1.09, + 'Schedule::At' => 1.06, + 'SMS::Send' => 0.05, # optional + 'Term::ANSIColor' => 1.10, + 'Test' => 1.25, + 'Test::Harness' => 2.56, + 'Test::More' => 0.62, + 'Text::CSV' => 0.01, + 'Text::CSV_XS' => 0.32, + 'Text::Iconv' => 1.7, + 'Text::Wrap' => 2005.082401, + 'Time::HiRes' => 1.86, + 'Time::localtime' => 1.02, + 'Unicode::Normalize' => 0.32, + 'XML::Dumper' => 0.81, + 'XML::LibXML' => 1.59, + 'XML::LibXSLT' => 1.59, + 'XML::SAX::ParserFactory' => 1.01, + 'XML::Simple' => 2.14, + 'XML::RSS' => 1.31, + 'YAML::Syck' => 0.71, + }, + + # File tree mapping + 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'), + + PL_FILES => $pl_files, ); =head1 FUNCTIONS @@ -947,6 +949,21 @@ Install the Zebra configuration files?); $config{'INSTALL_ZEBRA'} = _get_value('INSTALL_ZEBRA', $msg, $defaults->{'INSTALL_ZEBRA'}, $valid_values, $install_log_values); if ($config{'INSTALL_ZEBRA'} eq 'yes') { + + if (defined(my $zebra_path = find_zebra())) { + $config{'PATH_TO_ZEBRA'} = $zebra_path; + print qq( +Found 'zebrasrv' and 'zebraidx' in $zebra_path. +); + } else { + print q( +Unable to find the Zebra programs 'zebrasrv' and 'zebraidx' +in your PATH or in some of the usual places. If you haven't +installed Zebra yet, please do so and run Makefile.PL again. + +); + } + $msg = q( Since you've chosen to use Zebra with Koha, you must specify the primary MARC format of the @@ -1078,7 +1095,11 @@ doing it in a database that you don't want to lose. Please specify the name of the test database to be used by Koha); - $config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values); + $config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values); + while ( $config{'TEST_DB_NAME'} eq $config{'DB_NAME'} ) { + $msg = q(Please do not use the same database for testing as you do for production. You run the severe risk of data loss.); + $config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values); + } $msg = q( Please specify the user that owns the database to be @@ -1327,6 +1348,32 @@ sub display_configuration { print "'dmake -x MAXLINELENGTH=300000'\n\n"; } +=head2 find_zebra + +Attempt to find Zebra - check user's PATH and +a few other directories for zebrasrv and zebraidx. + +FIXME: doesn't handle Win32 + +=cut + +sub find_zebra { + my @search_dirs = map { + my $abs = File::Spec->rel2abs($_); + my ($toss, $directories); + ($toss, $directories, $toss) = File::Spec->splitpath($abs, 1); + $directories; + } split /:/, $ENV{PATH}; + push @search_dirs, qw(/usr/local/bin /opt/local/bin /usr/bin); + my @zebrasrv_dirs = grep { -x File::Spec->catpath('', $_, 'zebrasrv') } @search_dirs; + return unless @zebrasrv_dirs; + # verify that directory that contains zebrasrv also contains zebraidx + foreach my $dir (@zebrasrv_dirs) { + return $dir if -x File::Spec->catpath('', $dir, 'zebraidx'); + } + return; +} + package MY; # This will have to be reworked in order to accommodate Win32...