$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.
# 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.
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" ); }
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...