Continuing work on the installer
[koha.git] / Makefile.PL
index 53ea90c..97cfaa2 100755 (executable)
@@ -32,7 +32,8 @@ Makefile.PL - Koha packager and installer
 
 =head2 BASIC INSTALLATION
 
-       perl Makefile.PL
+       perl Makefile.PL 
+       or perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir MARCFLAVOUR=marc21 LANGUAGE=en
        make
        sudo make install
 
@@ -87,15 +88,30 @@ to generate initial configuration files in future.
 
 =cut
 
+my $marc_value;
+my $lang_value;
+
+
+while ($marc_value ne 'marc21' && $marc_value ne 'unimarc'){
+   my $message= "Chose your flavour of MARC, unimarc or marc21 [marc21]";
+   $marc_value=prompt($message) || 'marc21';
+}
+while ($lang_value ne 'en' && $lang_value ne 'fr'){
+   my $message= "Choose your language, en or fr [en]";
+   $lang_value=prompt($message) || 'en';
+}
+
 WriteMakefile(
 
     NAME => 'koha',
     #VERSION => strftime('2.9.%Y%m%d%H',gmtime),
-    VERSION_FROM => 'C4/Context.pm',
+    VERSION_FROM => 'kohaversion.pl',
     ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
     AUTHOR => 'Koha Developers <koha-devel@nongnu.org>',
     NO_META => 1,
+       INSTALLSITEBIN => '$(INSTALL_BASE)/lib',
     PREREQ_PM => {
+'Biblio::EndnoteStyle' => 0.05,
 'CGI' => 3.15,
 'CGI::Carp' => 1.29,
 'CGI::Session' => '4.10',
@@ -119,12 +135,15 @@ WriteMakefile(
 'Lingua::Stem' => 0.82,
 'List::Util' => 1.18,
 'Locale::Language' => 2.07,
-'MARC::Charset' => 0.95,
-'MARC::File::XML' => 0.86,
-'MARC::Record' => 1.38,
+'MARC::Charset' => 0.98,
+'MARC::Crosswalk::DublinCore' => 0.03,
+'MARC::File::XML' => 0.88,
+'MARC::Record' => 2.00,
+'MARC::Crosswalk::DublinCore' => 0.02,
 'MIME::Base64' => 3.07,
 'MIME::QuotedPrint' => 3.07,
 'Mail::Sendmail' => 0.79,
+'Net::Z3950::ZOOM' => 1.16,
 'PDF::API2' => 2.000,
 'PDF::API2::Page' => 2.000,
 'PDF::API2::Util' => 2.000,
@@ -137,16 +156,17 @@ WriteMakefile(
 'Test::Harness' => 2.56,
 'Test::More' => 0.62,
 'Text::CSV' => 0.01,
+'Text::CSV_XS' => 0.32,
 '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.63,
 'XML::SAX::ParserFactory' => 1.01,
 'XML::Simple' => 2.14,
 'XML::RSS' => 1.31,
-'ZOOM' => 1.16,
         },
 
        # File tree mapping
@@ -162,11 +182,11 @@ WriteMakefile(
 
    PL_FILES => { # generator => target(s)
       'rewrite-config.PL' => [
-         '$(PREFIX)/share/koha/etc/koha-conf.xml',
-         '$(PREFIX)/share/koha/etc/koha-httpd.conf',
-         '$(PREFIX)/share/koha/etc/zebradb/etc/passwd',
-         '$(PREFIX)/share/koha/etc/zebradb/zebra-biblios.cfg',
-         '$(PREFIX)/share/koha/etc/zebradb/zebra-authorities.cfg'
+         '$(INST_LIBDIR)/etc/koha-conf.xml',
+         '$(INST_LIBDIR)/etc/koha-httpd.conf',
+         '$(INST_LIBDIR)/etc/zebradb/etc/passwd',
+         '$(INST_LIBDIR)/etc/zebradb/zebra-biblios.cfg',
+         '$(INST_LIBDIR)/etc/zebradb/zebra-authorities.cfg'
          ]
    }
 #     'opac/getfromintranet.PL' => ['$(INST_LIBDIR)/opac/cgi-bin/detail.pl','$(INST_LIBDIR)/opac/cgi-bin/moredetail.pl','$(INST_LIBDIR)/opac/cgi-bin/search.pl','$(INST_LIBDIR)/opac/cgi-bin/subjectsearch.pl','$(INST_LIBDIR)/opac/cgi-bin/logout.pl'],
@@ -177,6 +197,8 @@ WriteMakefile(
 #     # fake target to check permissions
 #     'misc/chmod.PL' => '$(INST_LIBDIR)/fake-target'
 #     }
+   
+
    # need to set ownerships
    # need to load koha.sql
    # need to link koha-httpd.conf
@@ -206,16 +228,19 @@ C4/*.pm is copied to perl's lib namespace.
 
 =pod
 
-CGIs are copied to $(PREFIX)/lib/cgi-bin/koha/
+CGIs are copied to $(INSTALL_BASE)/lib/cgi-bin/koha/
 and other scripts to koha/
 
 =cut
-       foreach my $src ("mainpage.pl","help.pl","kohaversion.pl",glob("*/*.pl"),glob("installer/*"),glob("installer/*/*/*/*"),glob("*/*/*.pl"),glob("*/*/*/*.pl")) {
+       foreach my $src ("mainpage.pl","help.pl","kohaversion.pl",glob("*/*.pl"),glob("installer/*"),glob("installer/*/*/*/*"),glob("installer/*/*/*/*/*"),glob("*/*/*.pl"),glob("*/*/*/*.pl"),glob("installer/*/*/*.sql"))
+{
+         if (-f $src) {
                if ($src =~ /(misc|updater|rss)\//) {
-                       $result{$src} = '$(INST_LIBDIR)/koha/'.$src;
+                       $result{$src} = '$(INST_BIN)/koha/'.$src;
                } else {
-                       $result{$src} = '$(PREFIX)/lib/cgi-bin/koha/'.$src;
+                       $result{$src} = '$(INST_BIN)/cgi-bin/koha/'.$src;
                }
+         }
        }
 
 =pod
@@ -234,6 +259,7 @@ excluding non-files and whitespace in filenames.
                        $result{$src} = '$(INST_LIBDIR)/koha/templates/'.$src;
                }
        }
+       
 =pod
 
 etc files are copied to /usr/share/koha/etc/
@@ -242,11 +268,14 @@ etc files are copied to /usr/share/koha/etc/
        # Misc etc to koha/etc
        foreach my $src (glob("etc/zebradb/*/*/*"),glob("etc/zebradb/*/*"),glob("etc/zebradb/*"),glob("etc/*")) {
                if (-f $src) {
-                       $result{$src} = '$(PREFIX)/share/koha/'.$src;
+                       $result{$src} = '$(INST_LIBDIR)/'.$src;
                }
        }
-
-
+       
+       # set up zebra with the appropriate language and marc config
+    $result{"etc/zebradb/lang_defs/sort-string-$lang_value.chr"} = '$(INST_LIBDIR)/etc/zebradb/etc/sort-string-utf.chr';
+    $result{"etc/zebradb/marc_defs/biblios-$marc_value.abs"} = '$(INST_LIBDIR)/etc/zebradb/biblios/etc/record.abs';
+       $result{"etc/zebradb/marc_defs/authorities-$marc_value.abs"} = '$(INST_LIBDIR)/etc/zebradb/authorities/etc/record.abs';
        return \%result;
 }