[25/30] Fixing up the installer to check for new optional dependencies
authorChris Nighswonger <cnighswonger@foundations.edu>
Mon, 11 Jan 2010 14:34:00 +0000 (09:34 -0500)
committerChris Nighswonger <cnighswonger@foundations.edu>
Mon, 11 Jan 2010 23:21:17 +0000 (18:21 -0500)
Makefile.PL
installer/install.pl
koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tmpl

index 005ab81..aa45911 100644 (file)
@@ -556,9 +556,9 @@ WriteMakefile(
                             'Digest::SHA'                      => 5.43,
                             'Email::Date'                      => 1.103,
                             'File::Temp'                       => 0.16,
-                            'GD'                               => 2.39,    #optional
+                            'GD'                               => 2.39,    #optional, used for patron image feature
                             'GD::Barcode::UPCE'                => 1.1,
-                            'Graphics::Magick'                 => 1.37
+                            'Graphics::Magick'                 => 1.3.7,   #optional, used for patron cards creator
                             'Getopt::Long'                     => 2.35,
                             'Getopt::Std'                      => 1.05,
                             'HTML::Template::Pro'              => 0.69,
index 9d21962..4142d06 100755 (executable)
@@ -131,6 +131,18 @@ if ( $step && $step == 1 ) {
               { name => "GD::Barcode", usagebarcode => 1, usagespine => 1 };
         }
     }
+    unless ( eval { require GD } ) {
+        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
+            push @missing,
+              { name => "GD", usagepatronimages => 1 };
+        }
+    }
+    unless ( eval { require Graphics::Magick } ) {
+        if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
+            push @missing,
+              { name => "Graphics::Magick", usagepatroncards => 1 };
+        }
+    }
     unless ( eval { require Data::Random } ) {
         if ( $#missing >= 0 ) {   # only when $#missing >= 0 so this isn't fatal
             push @missing, { name => "Data::Random", usagebarcode => 1 };
@@ -230,7 +242,7 @@ elsif ( $step && $step == 2 ) {
                 }
                 $template->param( "checkgrantaccess" => $grantaccess );
             }  # End mysql connect check...
-           
+
            elsif ( $info{dbms} eq "Pg" ) {
                # Check if database has been created...
                my $rv = $dbh->do( "SELECT * FROM pg_catalog.pg_database WHERE datname = \'$info{dbname}\';" );
@@ -257,7 +269,7 @@ elsif ( $step && $step == 3 ) {
 #
 # STEP 3 : database setup
 #
-# 
+#
     my $op = $query->param('op');
     if ( $op && $op eq 'finished' ) {
         #
@@ -298,7 +310,7 @@ elsif ( $step && $step == 3 ) {
         #
         #
         # (note that the term "selectframeworks is not correct. The user can select various files, not only frameworks)
-        
+
         #Framework Selection
         #sql data for import are supposed to be located in installer/data/<language>/<level>
         # Where <language> is en|fr or any international abbreviation (provided language hash is updated... This will be a problem with internationlisation.)
@@ -314,15 +326,15 @@ elsif ( $step && $step == 3 ) {
         my $marcflavour = $query->param('marcflavour');
         if ($marcflavour){
             $installer->set_marcflavour_syspref($marcflavour);
-        };    
+        };
         $marcflavour = C4::Context->preference('marcflavour') unless ($marcflavour);
         #Insert into database the selected marcflavour
-        undef $/; 
+        undef $/;
         my ($marc_defaulted_to_en, $fwklist) = $installer->marc_framework_sql_list($langchoice, $marcflavour);
         $template->param('en_marc_frameworks' => $marc_defaulted_to_en);
         $template->param( "frameworksloop" => $fwklist );
         $template->param( "marcflavour" => ucfirst($marcflavour));
-       
+
         my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice, $marcflavour);
         $template->param( "en_sample_data" => $sample_defaulted_to_en);
         $template->param( "levelloop" => $levellist );
@@ -334,7 +346,7 @@ elsif ( $step && $step == 3 ) {
         # 1ST install, 2nd sub-step : show the user the marcflavour available.
         #
         #
-        
+
         #Choose Marc Flavour
         #sql data are supposed to be located in installer/data/<dbms>/<language>/marcflavour/marcflavourname
        # Where <dbms> is database type according to DBD syntax
@@ -362,13 +374,13 @@ elsif ( $step && $step == 3 ) {
         }
         my @listdir = grep { !/^\./ && -d "$dir/$_" } readdir(MYDIR);
         closedir MYDIR;
-        my $marcflavour=C4::Context->preference("marcflavour");    
+        my $marcflavour=C4::Context->preference("marcflavour");
         my @flavourlist;
         foreach my $marc (@listdir) {
-            my %cell=(    
+            my %cell=(
             "label"=> ucfirst($marc),
             "code"=>uc($marc),
-            "checked"=> defined($marcflavour) ? uc($marc) eq $marcflavour : 0);      
+            "checked"=> defined($marcflavour) ? uc($marc) eq $marcflavour : 0);
 #             $cell{"description"}= do { local $/ = undef; open INPUT "<$dir/$marc.txt"||"";<INPUT> };
             push @flavourlist, \%cell;
         }
index dcb90a4..3226622 100644 (file)
@@ -38,15 +38,16 @@ listed, please inform your systems administrator.</p>
     <li><!--TMPL_VAR Name="name"-->
     <!--TMPL_IF Name="usagemail"-->
       <br /> This module is used whenever Koha has to send email.
-    <!--/TMPL_IF-->
-    <!--TMPL_IF Name="usagebarcode"-->
+    <!--TMPL_ELSIF Name="usagebarcode"-->
       <br /> This module is needed if you intend to print barcodes.
-    <!--/TMPL_IF-->
-    <!--TMPL_IF Name="usagespine"-->
+    <!--TMPL_ELSIF Name="usagespine"-->
       <br /> This module is needed if you intend to print spine labels.
-    <!--/TMPL_IF-->
-    <!--TMPL_IF Name="usageLDAP"-->
+    <!--TMPL_ELSIF Name="usageLDAP"-->
       <br /> This module is needed if you intend to use LDAP for authentication.
+    <!--TMPL_ELSIF Name="usagepatronimages"-->
+      <br /> This module is needed if you intend to use patron images.
+    <!--TMPL_ELSIF Name="usagepatroncards"-->
+      <br /> This module is needed if you intend to use the patron card creator.
     <!--/TMPL_IF-->
     </li>
   <!--/TMPL_LOOP-->