Changeset 1614


Ignore:
Timestamp:
2000-10-25T16:28:06+13:00 (24 years ago)
Author:
paynter
Message:

Added support for the phind phrase browser. If a "phind" line is detected
in the collection configureation file, then we assume the user wants to
generate aphind index. Before we let them proceed, we make sure they have
all the files installed in the right place (they are not installed by
default). If everything is okay, we call the phindgen.pl script after the
build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/buildcol.pl

    r1454 r1614  
    161161    }
    162162
    163     # build it in realbuilddir
     163
     164    # Phind installation check
     165    # The phind phrase browser is research software and is not installed
     166    # by defualt.  If the user attepts to use it we warn them that it's a
     167    # bit dodgy, then tell them how to install it.  If they can do that
     168    # and get all the files in place, then we let them proceed.
     169    if ($collectcfg->{'phind'}) {
     170   
     171    print $out "Phind - *experimental* Greenstone verion.\n";
     172    print $out "Checking the phind phrase browser requirements...\n";
     173
     174    # Make sure we're not in windows
     175    die "Phind currently only works under Unix" unless ($ENV{'GSDLOS'} !~ /windows/i);
     176
     177    # Ensure the Phind generate scripts are in place
     178    my $file1 = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "suffix");
     179    my $file2 = &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "phindgen.pl");
     180    my $file3 = &util::filename_cat($ENV{'GSDLHOME'}, "perllib", "phproc.pm");
     181    my $src = &util::filename_cat($ENV{'GSDLHOME'}, "src", "phind", "generate");
     182
     183    if (!((-e $file1) && (-e $file2) && (-e $file3))) {
     184        print STDERR "The phind generate scripts are not installed.  ";
     185        print STDERR "To install them, change to the directory\n";
     186        print STDERR "   $src\n";
     187        print STDERR "and type \"make install\".\n\n";
     188        die "\n";
     189    }
     190
     191    # Ensure the Phind CGI script is in place
     192    $file1 = &util::filename_cat($ENV{'GSDLHOME'}, "cgi-bin", "phindcgi");
     193    $src =  &util::filename_cat($ENV{'GSDLHOME'}, "src", "phind", "host");
     194
     195    if (!(-e $file1)) {
     196        print STDERR "The phind CGI program is not installed.  ";
     197            print STDERR "To install it, change to the directory\n";
     198        print STDERR "   $src\n";
     199        print STDERR "and type \"make install\".\n\n";
     200    }
     201   
     202    print $out "All the files appear to be in place.\n\n";
     203    }
     204
     205
     206    # Build the collection in realbuilddir
    164207    &util::mk_all_dir ($realbuilddir);
    165208
     
    208251    }
    209252
     253   
     254    # Create the phind phrase browser interface
     255    if ($collectcfg->{'phind'}) {
     256
     257    # formulate and execute the phind generate command
     258    my $command = &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "phindgen.pl");
     259    $command .= " -verbosity $verbosity";
     260    $command .= " -maxdocs $maxdocs" if ($maxdocs && ($maxdocs > 0));
     261    $command .= " $collection";
     262
     263    print $out "\nExecuting: $command\n" if $verbosity;
     264    my $status = system($command);
     265    if ($status != 0) {
     266        print STDERR "buildcol.pl - Error executing $command: $!\n";
     267        exit($status);
     268    }
     269    }
     270
    210271    close OUT if $close_out;
     272
    211273}
    212274
Note: See TracChangeset for help on using the changeset viewer.