Final? install/setup clean ups

This commit is contained in:
robodan%netscape.com 2000-03-29 23:22:57 +00:00
Родитель 15dddeaef1
Коммит d1ea113422
3 изменённых файлов: 6 добавлений и 193 удалений

Просмотреть файл

@ -26,8 +26,8 @@ GNUPLOTFILES = gnuplot gnuplot_x11 gnuplot.1 gnuplot.gih Copyright
VERSION = 4.2
TARBALL = mstone-$(VERSION)-$(NSARCH)$(OBJDIR_TAG).tar.gz
ZIPFILE = mstone-$(VERSION)-$(NSARCH)$(OBJDIR_TAG).zip
TARBALL_ALL = mstone-$(VERSION)-all-$(OBJDIR_TAG).tar.gz
ZIPFILE_ALL = mstone-$(VERSION)-all-$(OBJDIR_TAG).zip
TARBALL_ALL = mstone-$(VERSION)-all$(OBJDIR_TAG).tar.gz
ZIPFILE_ALL = mstone-$(VERSION)-all$(OBJDIR_TAG).zip
NTFILES = mstone.bat process.bat setup.bat
@ -99,13 +99,13 @@ $(PKGDIR)/perl:
# operating system independent share-files (at least for Unix)
pkg-share-files:: mkpkgdirs
@$(ECHO) "\n===== [`date`] making package share-files...\n"
$(CP) mstone setup process $(PKGDIR)
$(CP) mstone process $(PKGDIR)
(cd $(PKGDIR); [ ! -f setup ] || rm -f setup; ln -s mstone setup)
(cd $(PKGDIR); [ ! -f cleanup ] || rm -f cleanup; ln -s mstone cleanup)
(cd $(PKGDIR); [ ! -f checktime ] || rm -f checktime; ln -s mstone checktime)
(cd $(PKGDIR); [ ! -f timesync ] || rm -f timesync; ln -s mstone timesync)
$(CP) nsarch bin/*.pl $(PKGDIR)/bin
$(CP) conf/*.wld conf/*.html $(PKGDIR)/conf
$(CP) conf/*.wld conf/*.wld.in conf/*.html $(PKGDIR)/conf
$(CP) data/*.msg $(PKGDIR)/data
$(CP) doc/*.html doc/*.gif $(PKGDIR)/doc
$(CP) INSTALL $(PKGDIR)
@ -190,7 +190,7 @@ dist::
@[ ! -d "$(DIST)" ] || ($(ECHO) "Error: $(DIST) already exists" && \
$(MAKE) usage && /bin/false)
mkdir -p $(DIST)
cp -p build/$(TARBALL_ALL) build/$(ZIPFILE_ALL) $(DIST)/
cp -p build/mstone-$(VERSION)-all_*.tar.gz build/mstone-$(VERSION)-all_*.zip $(DIST)/
(cd build/package; tar cf - *.OBJ) | (cd $(DIST); tar xf - )
for l in $(DIST)/*_???.OBJ ; do \
(cd $$l; ln -s mstone mailstone); done

Просмотреть файл

@ -108,7 +108,7 @@ ifeq ($(OS_ARCH), HP-UX)
endif
ifeq ($(OS_ARCH), SunOS)
# Sun Workshop Compilers 5.0
CC = /tools/ns/workshop-5.0/bin/cc
# CC = /tools/ns/workshop-5.0/bin/cc
REL_OS_CFLAGS = -mt -xstrconst -v -O
DBG_OS_CFLAGS = -mt -xstrconst -v -g -xs
OSDEFS = -D__SOLARIS__ -DHAVE_SELECT_H -DHAVE_WAIT_H \

Просмотреть файл

@ -1,187 +0,0 @@
#!/bin/sh
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Netscape Mailstone utility,
# released March 17, 2000.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1999-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Dan Christian <robodan@netscape.com>
# Marcel DePaolis <marcel@netcape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU Public License (the "GPL"), in which case the
# provisions of the GPL are applicable instead of those above.
# If you wish to allow use of your version of this file only
# under the terms of the GPL and not to allow others to use your
# version of this file under the NPL, indicate your decision by
# deleting the provisions above and replace them with the notice
# and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this
# file under either the NPL or the GPL.
#####################################################
# push or clean up mailclient and message files to client hosts
# Usage: setup|cleanup|timesync|checktime|config [mode] [-w workload_file]
#
# Setup (or cleanup) OS specific versions of mailclient and utilities
gconf=conf/general.wld # default file for machines info
# figure out the host arch
run_nsarch() {
if [ ! -x bin/nsarch ] ; then
echo "Installation error! Cannot locate $1 or nsarch.\n"
exit 1
fi
OUROS=`bin/nsarch`
# deal with new versions of OS falling back to versions we have
if [ ! -d bin/$OUROS ] ; then
shortos=`echo $OUROS | sed -e 's/[0-9].*//'`
near=`ls -d bin/*/bin | grep $shortos`
if [ -n "$near" ] ; then
near=`echo $near | cut -f2 -d'/'`
echo "No support for $OUROS, using $near"
OUROS=$near
else
echo "No support for $OUROS and nothing similar"
fi
fi
export OUROS
}
# Setup perl to work from perl/bin/perl
setup_perl() {
[ -n "$OUROS" ] || run_nsarch $1
if [ -d perl ] ; then # found it in our distribution
(cd perl; ln -s arch/$OUROS bin)
else
local=`which perl | wc -w`
if [ 1 -eq "$local" ] ; then
[ -d perl/bin ] || mkdir -p perl/bin
(cd perl/bin; ln -s `which perl` perl)
else
echo "No packaged version of perl and no local version"
exit 1;
fi
fi
}
# we always need this
[ -d perl/bin ] || setup_perl # need perl, even for cleanup mode
# Get the default version of mailclient
setup_mailclient() {
[ -n "$OUROS" ] || have_nsarch $1
(cd bin; ln -s $OUROS/bin/mailclient ./ )
}
# setup_file source_dir directory filename
# usually link in a directory.
# if needed, make the directory and link a local executable.
setup_dir_file() {
[ -n "$OUROS" ] || run_nsarch $1
if [ -d $1/$OUROS/$2 ] ; then # found it in our distribution
ln -s $1/$OUROS/$2 $2
else # look for a system copy
local=`which $3 | wc -w`
if [ 1 -eq "$local" ] ; then
[ -d $2 ] || mkdir -p $2
(cd $2; ln -s `which $3` $3)
else
echo "WARNING: No packaged version of $3 and no local version"
echo " Operation may be severely limited"
fi
fi
}
# Pick up mode as an argument
if [ $# -gt 0 -a \( "$1" = timesync -o "$1" = checktime \
-o "$1" = setup -o "$1" = cleanup -o "$1" = config \
-o "$1" = mstone \) ] ; then
mode=$1
shift
else # or the name we were called
mode=$0
sm=`echo $mode | cut -f2 -d/` # strip ./ from name
if [ -n "$sm" ] ; then
mode=$sm
fi
fi
if [ "$mode" = setup ] ; then # setup mode
# check to see if our binaries are configured right
#echo "Checking links"
[ -x gnuplot/gnuplot ] || setup_dir_file bin gnuplot gnuplot
[ -x bin/mailclient ] || setup_mailclient
# copy in an initial conf/general.wld, if needed
[ ! -f $gconf -a -f ${gconf}.in ] && cp ${gconf}.in $gconf
fi
# figure out an OS specific flags
extra=""
if [ `uname -s` = HP-UX ] ; then # HP uses remsh for remote exec
extra="RSH=/usr/bin/remsh $extra"
fi
if [ "$mode" != mstone ] ; then # other setup modes
perl/bin/perl -Ibin -- bin/setup.pl $mode -w $gconf $extra "$@"
else # run a mstone test
# This just runs the test with the right path to perl
# Usage: mstone testname
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ] ; then
echo "Usage: $0 testname [arguments]"
echo "Common arguments:"
echo " -t time Test time. s=seconds, m=minutes, h=hours"
echo " -r ramp_time Connection ramp up time. s=seconds, m=..."
echo " -l load Number of test clients to use."
echo " -b 'banner' Test description banner."
echo " -n 'notes' Test notes."
echo "Example:"
echo " ./mstone pop -t 10m -r 90s -l 24 -b 'Pop reads (full store)'"
exit 1
fi
testcase=$1 # get testname
shift
if [ ! -x perl/bin/perl -o ! -f .license ] ; then # see if setup was ever run
echo "Critical files are missing. Run setup."
exit 2;
fi
if [ -f $testcase ] ; then # if they gave us the full path
testfile=$testcase
elif [ -f conf/$testcase.wld ] ; then
testfile="conf/$testcase.wld"
else
echo "Cannot find test: $testcase"
fi
exec perl/bin/perl -Ibin -- bin/mailmaster.pl $extra -w $testfile "$@"
# no need to return
fi
if [ "$mode" = cleanup ] ; then # cleanup mode
#echo "Check for old links"
# remove any configured links. if these are directories, it will fail
rm -f perl/bin gd gnuplot 2> /dev/null
# the built in [ on Solaris does not have -L
/usr/bin/test -L bin/mailclient && rm -f bin/mailclient
fi