Changeset 85


Ignore:
Timestamp:
May 2, 2003, 6:02:48 PM (19 years ago)
Author:
kake
Message:

Bumped version number.
Redid the script and template installation so the script does actually get called what you said it should be (code copied somewhat from Siesta::Build).
Also you now need to specify the template installation directory.
Fixed the support for non-local databases/IDENT authentication. I think.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r84 r85  
    2626  variable => "dbpass"
    2727  },
     28{ question => "and the machine that the database is hosted on? (blank if local)",
     29  variable => "dbhost"
     30  },
    2831{ question => "what do you want the script to be called?",
    2932  variable => "script_name",
     
    3639{ question => "what URL does the install directory map to?",
    3740  variable => "script_url",
     41  },
     42{ question => "what directory should I install the templates in?",
     43  variable => "template_path",
     44  default  => "/usr/lib/cgi-bin/openguides/templates/"
    3845  },
    3946{ question => "what directory can I use to store indexes in for searching? "
     
    130137                     variable => $var,
    131138                     value    => $val };
    132 
    133     # For now we put the templates in the same place as the script, since I
    134     # can't figure out how to get Module::Build to put them in a subdirectory.
    135     if ( $var eq "install_directory" ) {
    136         push @answers, { question => "what directory are the templates in?",
    137                          variable => "template_path",
    138                          value    => $val };
    139     }
    140139}
    141140
     
    173172    dist_version_from => "wiki.cgi",
    174173    license => "perl",
    175     script_files => [ "wiki.cgi", "wiki.conf", "preferences.cgi",
    176                       "supersearch.cgi",
    177                       "templates/backlink_results.tt",
    178                       "templates/display_metadata.tt",
    179                       "templates/edit_conflict.tt",
    180                       "templates/edit_form.tt",
    181                       "templates/footer.tt",
    182                       "templates/header.tt",
    183                       "templates/home_node.tt",
    184                       "templates/navbar.tt",
    185                       "templates/node.tt",
    186                       "templates/node_history.tt",
    187                       "templates/preferences.tt",
    188                       "templates/rdf_index.tt",
    189                       "templates/recent_changes.tt",
    190                       "templates/search_results.tt",
    191                       "templates/site_index.tt",
    192                       "templates/userstats.tt"
    193                       ],
    194174    requires => {
    195175        'CGI' => 0,
     
    220200$build->add_to_cleanup( "wiki.conf" );
    221201
    222 # Set the install directory:
    223 #  - scripts go in the actual directory.
    224 $build->{config}{installscript} = $existing_config{install_directory};
    225 #  - and modules go in lib/
    226 $build->{config}{sitelib} = $existing_config{install_directory} . "/lib";
     202# Tell OpenGuides::Build which additional scripts and templates to install.
     203$build->{config}{__extra_scripts}     =
     204                      [ "wiki.conf", "preferences.cgi", "supersearch.cgi" ];
     205$build->{config}{__templates}         = [
     206                      "backlink_results.tt",
     207                      "display_metadata.tt",
     208                      "edit_conflict.tt",
     209                      "edit_form.tt",
     210                      "footer.tt",
     211                      "header.tt",
     212                      "home_node.tt",
     213                      "navbar.tt",
     214                      "node.tt",
     215                      "node_history.tt",
     216                      "preferences.tt",
     217                      "rdf_index.tt",
     218                      "recent_changes.tt",
     219                      "search_results.tt",
     220                      "site_index.tt",
     221                      "userstats.tt"
     222    ];
    227223
    228224# Finally write the build script.
  • trunk/Changes

    r84 r85  
     10.05    2 May 2003
     2        Redid the script and template installation so the script does
     3          actually get called what you said it should be (code copied
     4          somewhat from Siesta::Build).
     5        Also you now need to specify the template installation directory.
     6        Fixed the support for non-local databases/IDENT authentication.
     7          I think.
     8
    190.04    29 April 2003
    210        First public release.
  • trunk/INSTALL

    r84 r85  
    4141more than one OpenGuides installation, for example if you run guides
    4242for more than one city, each installation will need its own database.
    43 
    4443(TODO - support SQLite as well (requires faffing with install scripts,
    4544bit messy but CGI::Wiki already supports this so won't be hard))
     45
     46
     47  "And the machine that the database is hosted on? (blank if local)",
     48
     49If the database is running on a local machine with username/password
     50authentication then just press RETURN to skip this question.  If it
     51is running on a local machine with IDENT authentication then you may
     52need to answer "localhost" to this question.  If it is running on a
     53remote machine then enter the full hostname of that machine.
    4654
    4755
  • trunk/README

    r84 r85  
    1 OpenGuides Version 0.04
     1OpenGuides Version 0.05
    22=======================
    33
     
    4444=======
    4545
    46 As of version 0.04, the development team consists of Earle Martin,
     46As of version 0.05, the development team consists of Earle Martin,
    4747Kake Pugh, and Ivor Williams.
  • trunk/TROUBLESHOOTING

    r84 r85  
    11OpenGuides Troubleshooting Guide
    22================================
     3
     4If you wish to install the OpenGuides modules in a private directory,
     5the Module::Build incantation for this is
     6
     7  perl Build.PL config='sitelib=/path/to/my/modules/'
     8
     9----------------------------------------------------------------------
    310
    411If you see the following message in your webserver error logs:
     
    2330further with this problem if you can't figure it out yourself.
    2431
     32----------------------------------------------------------------------
  • trunk/lib/OpenGuides.pm

    r84 r85  
    5656
    5757Programming by Earle Martin, Kake Pugh, Ivor Williams.  Testing and
    58 bug reporting by Cal Henderson and Bob Walker.
     58bug reporting by Cal Henderson and Bob Walker.  Much of the
     59Module::Build stuff copied from the Siesta project
     60L<http://siesta.unixbeard.net/>
    5961
    6062=cut
  • trunk/lib/OpenGuides/Build.pm

    r84 r85  
    88    my $self = shift;
    99    $self->SUPER::ACTION_install;
     10    $self->ACTION_install_extras;
    1011
    1112    eval "use Config::Tiny";
     
    1314
    1415    my $config = Config::Tiny->read("wiki.conf");
     16
     17    # Initialise the database if necessary.
    1518    my $dbname = $config->{_}->{dbname};
    1619    my $dbuser = $config->{_}->{dbuser};
     
    3639    my $self = shift;
    3740    $self->SUPER::ACTION_fakeinstall;
     41    $self->ACTION_install_extras( fake => 1 );
    3842    print "Checking database schema...\n";
    3943}
    4044
     45sub ACTION_install_extras {
     46    my ($self, %args) = @_;
     47    my $FAKE = $args{fake} || 0;
     48
     49    eval "use Config::Tiny";
     50    die "Config::Tiny is required to set up this application.\n" if $@;
     51
     52    my $config = Config::Tiny->read("wiki.conf");
     53
     54    # Install the scripts where we were told to.
     55    my $install_directory = $config->{_}->{install_directory};
     56    my $script_name       = $config->{_}->{script_name};
     57    my $template_path     = $config->{_}->{template_path};
     58    my @extra_scripts     = @{ $self->{config}{__extra_scripts} };
     59    my @templates         = @{ $self->{config}{__templates} };
     60
     61    print "Installing scripts to $install_directory:\n";
     62    if ( $FAKE ) {
     63        print "wiki.cgi -> $install_directory/$script_name (FAKE)\n";
     64    } else {
     65        if ( $script_name ne "wiki.cgi" ) {
     66            File::Copy::copy("wiki.cgi", $script_name)
     67                or die "Can't copy('wiki.cgi', '$script_name'): $!";
     68        }
     69        my $copy = $self->copy_if_modified( $script_name, $install_directory );
     70        if ( $copy ) {
     71            $self->fix_shebang_line($copy);
     72            $self->make_executable($copy);
     73        } else {
     74            print "Skipping $install_directory/$script_name (unchanged)\n";
     75        }
     76        print "(Really: wiki.cgi -> $install_directory/$script_name)\n"
     77            unless $script_name eq "wiki.cgi";
     78    }
     79
     80    foreach my $script ( @extra_scripts ) {
     81        if ( $FAKE ) {
     82            print "$script -> $install_directory/$script (FAKE)\n";
     83        } else {
     84            my $copy = $self->copy_if_modified( $script, $install_directory );
     85            if ( $copy ) {
     86                $self->fix_shebang_line($copy);
     87                $self->make_executable($copy);
     88            } else {
     89                print "Skipping $install_directory/$script (unchanged)\n";
     90            }
     91        }
     92    }
     93
     94    print "Installing templates to $template_path:\n";
     95    foreach my $template ( @templates ) {
     96        if ( $FAKE ) {
     97            print "templates/$template -> $template_path/$template (FAKE)\n";
     98        } else {
     99            $self->copy_if_modified( "templates/$template", $template_path )
     100                or print "Skipping $template_path/$template (unchanged)\n";
     101        }
     102    }
     103}
     104
    411051;
  • trunk/wiki.cgi

    r84 r85  
    55
    66use vars qw( $VERSION );
    7 $VERSION = '0.04';
     7$VERSION = '0.05';
    88
    99use lib "lib"; # for OpenGuides modules that are installed with this script
Note: See TracChangeset for help on using the changeset viewer.