various installer changes
authorGalen Charlton <galen.charlton@liblime.com>
Sun, 23 Dec 2007 00:53:09 +0000 (18:53 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 23 Dec 2007 00:59:04 +0000 (18:59 -0600)
[1] Map new directory misc/bin to SCRIPT_DIR
    instead of SCRIPT_DIR/bin.
[2] rewrite-config.PL no longer removes execute mode
[3] Add new Zebra startup script to rewrite-config.PL
    list.
[4] Added KOHA_USER and KOHA_GROUP to rewrite-config.PL

Signed-off-by: Joshua Ferraro <jmf@liblime.com>

Makefile.PL
README.debian
rewrite-config.PL

index eea0ef6..d9eb375 100644 (file)
@@ -243,6 +243,7 @@ my $target_map = {
   './MANIFEST.SKIP'             => 'NONE',
   './members'                   => 'INTRANET_CGI_DIR',
   './misc'                      => { target => 'SCRIPT_DIR', trimdir => -1 }, 
+  './misc/bin'                  => { target => 'SCRIPT_DIR', trimdir => -1 }, 
   './misc/info'                 => { target => 'DOC_DIR', trimdir => 2 },
   './misc/release notes'        => { target => 'DOC_DIR', trimdir => 2 },
   './misc/translator'           => { target => 'MISC_DIR', trimdir => 2 }, 
@@ -432,6 +433,12 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
         'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg',
         'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg'
     );
+    if ($config{'INSTALL_MODE'} ne 'dev') {
+        push @{ $pl_files->{'rewrite-config.PL'} }, (
+            'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
+            'blib/SCRIPT_DIR/koha-zebraqueue-ctl.sh',
+        );
+    }
 }
 
 if ($config{'INSTALL_MODE'} ne "dev") {
index 15da926..ea44cfc 100644 (file)
@@ -174,18 +174,22 @@ Option 1: run the Zebra processes from the command line:
 
 Option 2: run the Zebra processes as daemons, and add to startup process:
 
+Note that references to $SCRIPT_DIR refer to the directory where
+Koha's command-line scripts are installed, e.g., /usr/share/koha/bin.
+
     Zebra Server:
-    $ sudo ln -s misc/bin/koha-zebra-ctl.sh  /etc/init.d/koha-zebra-daemon
+    $ sudo ln -s ${SCRIPT_DIR}/koha-zebra-ctl.sh  /etc/init.d/koha-zebra-daemon
     $ update-rc.d koha-zebra-daemon defaults
     ( Note: see man chkconfig(8) on other distros )
-    $ misc/bin/koha-zebra-ctl.sh start
+    $ ${SCRIPT_DIR}/koha-zebra-ctl.sh start
 
     Zebraqueue Daemon:
-    $ sudo ln -s misc/bin/koha-zebraqueue-ctl.sh  /etc/init.d/koha-zebraqueue-daemon
+    $ sudo ln -s ${SCRIPT_DIR}/koha-zebraqueue-ctl.sh  /etc/init.d/koha-zebraqueue-daemon
     $ update-rc.d koha-zebraqueue-daemon defaults 
     ( Note: see man chkconfig(8) on other distros )
 
-    $ misc/bin/koha-zebraqueue-ctl.sh start
+    $ ${SCRIPT_DIR}/koha-zebraqueue-ctl.sh start
+
 
 6. Run the Web Installer, populate the database, initial configuration of settings
 
index 9f4297a..8048492 100644 (file)
@@ -84,6 +84,8 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr";
   "__WEBSERVER_IP__" => $myip,
   "__WEBSERVER_PORT__" => "80",
   "__WEBSERVER_PORT_LIBRARIAN__" => "8080",
+  "__KOHA_USER__" => "koha",
+  "__KOHA_GROUP__" => "koha",
   "__ZEBRA_PASS__" => "zebrastripes",
   "__ZEBRA_USER__" => "kohauser",
   '__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
@@ -116,11 +118,22 @@ foreach $key (keys %configuration) {
 $fname = $ARGV[0];
 $file = read_file($fname);
 $file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
-chmod 0644, $fname;
+
+# At this point, file is in 'blib' and by default
+# has mode a-w.  Therefore, must change permission
+# to make it writable.  Note that stat and chmod
+# (the Perl functions) should work on Win32
+my $old_perm;
+$old_perm = (stat $fname)[2] & 07777;
+my $new_perm = $old_perm | 0200;
+chmod $new_perm, $fname;
+
 open(OUTPUT,">$fname") || die "Can't open $fname for write: $!";
 print OUTPUT $file;
 close(OUTPUT);
 
+chmod $old_perm, $fname;
+
 # Idea taken from perlfaq5
 sub read_file($) {
   local(*INPUT,$/);