From: Rob H. <for...@us...> - 2004-03-08 08:26:06
|
Update of /cvsroot/sandweb/sandweb/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17422/tools Modified Files: install_script.pl instcachedir.pl Log Message: this fixes some long-outstanding issues on the trunk: * perl and sh are configurable in install.cfg now, with preference for perl given to the perl used to run Makefile.PL (fixes sf.net bug 877125) * fixed up the tests a bit, needs alot more attention updated test.cfg to address all the latest config options * the group file is copied in by default now. We need to add support to sandweb-admin so users are added to groups at that time. * reduced the number of warnings we get running under perl 5.8 (deprecations, etc.) Index: install_script.pl =================================================================== RCS file: /cvsroot/sandweb/sandweb/tools/install_script.pl,v retrieving revision 1.24 retrieving revision 1.25 diff -U2 -r1.24 -r1.25 --- install_script.pl 1 Jun 2003 20:42:26 -0000 1.24 +++ install_script.pl 8 Mar 2004 08:01:56 -0000 1.25 @@ -4,20 +4,9 @@ exit 1 if (!$ARGV[0]); my $PREFIX = $ARGV[0]; +my $FULLPERL = $ARGV[1]; print("loading install config... "); require 'install.cfg'; # load config -print "\nbindir = $config::bindir\n". - "cfgdir = $config::cfgdir\n". - "cgidir = $config::cgidir\n". - "imgdir = $config::imgdir\n". - "tmpldir = $config::tmpldir\n". - "cachedir = $config::cachedir\n". - "logdir = $config::logdir\n". - "httpuser = $config::httpuser\n". - "expectbin = $config::expectbin\n". - "cvs_bin = $config::cvs_bin\n". - "ssh_bin = $config::ssh_bin\n"; - my $bindir = $config::bindir || '/usr/local/bin'; my $cfgdir = $config::cfgdir || '/usr/local/etc'; @@ -30,7 +19,23 @@ my $httpuser = $config::httpuser || 'www'; my $expectbin = $config::expectbin || '/usr/bin/expect'; -my $ssh_bin = $config::ssh_bin || '/usr/bin/ssh'; +my $perlbin = $FULLPERL || $config::perlbin || '/usr/bin/perl'; +my $shbin = $config::shbin || '/usr/bin/sh'; +my $ssh_bin = $config::ssh_bin || '/bin/ssh'; my $cvs_bin = $config::cvs_bin || '/usr/bin/cvs'; +print "\nbindir = $bindir\n". + "cfgdir = $cfgdir\n". + "cgidir = $cgidir\n". + "imgdir = $imgdir\n". + "tmpldir = $tmpldir\n". + "cachedir = $cachedir\n". + "logdir = $logdir\n". + "httpuser = $httpuser\n". + "expectbin = $expectbin\n". + "perlbin = $perlbin\n". + "shbin = $shbin\n". + "cvs_bin = $cvs_bin\n". + "ssh_bin = $ssh_bin\n"; + # load functions require 'tools/instbin.pl'; @@ -144,11 +149,16 @@ # updating config path in executables print "Updating config file paths in executables... "; -system('tools/change-entry.pl', "$cgidir/sandweb.cgi", "config_dir = '../etc'", -"config_dir = '$cfgdir'"); +system('tools/change-entry.pl', "$cgidir/sandweb.cgi", "config_dir = '../etc'", "config_dir = '$cfgdir'"); +system('tools/change-entry.pl', "$cgidir/sandweb.cgi", '#!perl', "#!$perlbin -w"); print "sandweb.cgi, "; system('tools/change-entry.pl', "$bindir/sandweb-admin", "config_dir = '../etc'", "config_dir = '$cfgdir'"); +system('tools/change-entry.pl', "$bindir/sandweb-admin", '#!perl', "#!$perlbin -w"); print "sandweb-admin, "; -system('tools/change-entry.pl', "$bindir/sandweb-expect", "#!expect", "#!$expectbin"); +system('tools/change-entry.pl', "$bindir/sandweb-expect", '#!expect', "#!$expectbin"); print "sandweb-expect.\n"; +system('tools/change-entry.pl', "$bindir/sandweb-editor", '#!sh', "#!$shbin"); +print "sandweb-editor.\n"; +system('tools/change-entry.pl', "$bindir/sandweb-ssh", '#!sh', "#!$shbin"); +print "sandweb-ssh.\n"; # set execute permissions for scripts @@ -184,4 +194,34 @@ } +# set permissions on installed sandweb-ssh +if (-f "$bindir/sandweb-ssh") { + my $httpuser_uid = &getuid($httpuser); + if ($httpuser_uid == -1) { + print "Unable to get UID of $httpuser\n"; + exit(6); + } + #print "Setting ownership of $PREFIX/bin/sandweb-ssh to: $httpuser_uid:0\n"; + chown($httpuser_uid, 0, "$bindir/sandweb-ssh"); + system("chmod", "u=rwx,g=rx,o=", "$bindir/sandweb-ssh"); +} else { + print "unable to locate $bindir/sandweb-ssh\n"; + exit(8); +} + +# set permissions on installed sandweb-editor +if (-f "$bindir/sandweb-editor") { + my $httpuser_uid = &getuid($httpuser); + if ($httpuser_uid == -1) { + print "Unable to get UID of $httpuser\n"; + exit(6); + } + #print "Setting ownership of $PREFIX/bin/sandweb-editor to: $httpuser_uid:0\n"; + chown($httpuser_uid, 0, "$bindir/sandweb-editor"); + system("chmod", "u=rwx,g=rx,o=", "$bindir/sandweb-editor"); +} else { + print "unable to locate $bindir/sandweb-editor\n"; + exit(8); +} + # save install config to install.cfg for future reference. print "Saving configuration...\n"; @@ -197,4 +237,6 @@ print CFG '$httpuser = ' . "'$httpuser';\n"; print CFG '$expectbin = ' . "'$expectbin';\n"; +print CFG '$perlbin= ' . "'$perlbin';\n"; +print CFG '$shbin= ' . "'$shbin';\n"; print CFG '$bindir = ' . "'$bindir';\n"; print CFG '$ssh_bin = ' . "'$ssh_bin';\n"; Index: instcachedir.pl =================================================================== RCS file: /cvsroot/sandweb/sandweb/tools/instcachedir.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -U2 -r1.7 -r1.8 --- instcachedir.pl 5 Jan 2003 22:18:32 -0000 1.7 +++ instcachedir.pl 8 Mar 2004 08:01:56 -0000 1.8 @@ -51,4 +51,8 @@ push @errors, "Failed to set $cachedir/users read/write for $httpuser user."; } + print("Copying SandWeb groups file '$cachedir/data/group'...\n"); + if (system('/bin/cp', 'var/data/group', "$cachedir/data/group")) { + push @errors, "Failed to copy groups file to $cachedir/data/group."; + } return($cachedir, $httpuser, \@errors); } |