From 34aa12b22cf6526831f81ec142e9b57996c9eaf2 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 6 Jan 2003 20:10:09 +0000 Subject: [PATCH] changed version checking in build program to handle 3 level spong version (i.e. 2.7.8 ) --- build | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/build b/build index 06ce275..6082024 100755 --- a/build +++ b/build @@ -18,6 +18,13 @@ $TMPDIR = "$PREFIX/tmp"; # update $SPONGTMP var in spong.conf also $WEBUSER = "nobody"; +# User and Group that Spong should be installed as. +# Running as root.root is not recomended but it may help +# with an initial installation. + +$ADMUSER = "spong"; +$ADMGROUP = "spong"; + # That is typically all you need to change. You can change the values below # if you use a system like depot where you install to one located, but those # files get moved into their final location via some program. @@ -45,13 +52,15 @@ $ITMPDIR = "$IPREFIX/tmp"; # update $SPONGTMP var in spong.conf also # Make sure that we are running build in the directory where things are # unpacked. This is kind of a lame check, but good enough for now... -if( `cat ./.version 2>&1` ne "spong 2.7\n" ) { +my $tmpver = `cat ./.version 2>&1`; + +if( $tmpver !~ m/spong 2.7/ ) { print "Error: You need to run build from the directory that you unpacked "; print "spong in.\nPlease \"cd\" into that directory and type \"./build\"\n"; exit(0); } -($VER) = (`cat ./.version 2>&1` =~ /spong (.*)/); +($VER) = ($tmpver =~ /spong (.*)/); # Compute a list of operating systems that we know about. @@ -111,7 +120,6 @@ sub build { ssystem( "chmod 644 ./lib/Spong/*" ); ssystem( "chmod 755 ./lib/Spong/Client ./lib/Spong/Message ./lib/Spong/Network"); - ssystem( "mkdir ./cgi-bin" ) if ! -d "./cgi-bin"; foreach $file ( @cgibin ) { &replace( "./src/$file.pl", "./cgi-bin/$file" ); } @@ -132,16 +140,24 @@ sub install { ssystem( "mkdir -p $IBINDIR" ) if ! -d $IBINDIR; ssystem( "cp bin/* $IBINDIR/" ); + ssystem( "chown -R $ADMUSER $IBINDIR" ); + ssystem( "chgrp -R $ADMGROUP $IBINDIR" ); ssystem( "mkdir -p $IETCDIR" ) if ! -d $IETCDIR; ssystem( "cp etc/* $IETCDIR/" ); + ssystem( "chown -R $ADMUSER $IETCDIR" ); + ssystem( "chgrp -R $ADMGROUP $IETCDIR" ); ssystem( "mkdir -p $IVARDIR" ) if ! -d $IVARDIR; ssystem( "mkdir -p $IVARDIR/database" ); ssystem( "mkdir -p $IVARDIR/archives" ); ssystem( "mkdir -p $IVARDIR/misc" ); + ssystem( "chown -R $ADMUSER $IVARDIR" ); + ssystem( "chgrp -R $ADMGROUP $IVARDIR" ); ssystem( "mkdir -p $ITMPDIR" ) if ! -d $ITMPDIR; + ssystem( "chown -R $ADMUSER $ITMPDIR" ); + ssystem( "chgrp -R $ADMGROUP $ITMPDIR" ); # TODO - Clean this up... -- 2.30.2