Documentation on using Spread from Subversion.
----------------------------------------------
The main development is done on the main trunk. (default)

There may be release branches for older releases if needed.

To checkout a copy you need to have submitted a ssh public key
as described on the www.spread.org/devel.html webpage. Then run:

svn checkout svn+ssh://spreadsvn@svn.spread.org/spread/trunk spread

You should now have a 'spread' directory which contains the subdirectories:

    * spread/daemon with the Spread daemon and spmonitor code.
    * spread/libspread with the C library code.
    * spread/include with the header files for C/C++ programs that use Spread.
    * spread/examples with example C programs for a sample user and flooder program.
    * spread/java with the Java library and sample application code.
    * spread/perl with the Perl library code. 
    * spread/stdutil which contains a copy of the Stdutil library of data structures.

To Build from a clean SVN checkout
----------------------------------
You normally just need to run from the top level directory:

./configure
make -C daemon parser
make 
su  (if you use the standard /usr/local install target)
make install

The only extra is the "make -C daemon parser" line which is needed to build
the lex/yacc files. They are not auto-generated by the make file
because of the numerous buggy lex/yacc implementations out there. 
This way you can make sure you only generate the parsers from a
machine with a good implementation.

If you want to build in a separate directory so all of the
generated binary objects and libraries are not in the
source directory just create a new directory, for example:

mkdir bin_linux

and then enter that directory and run the top level configure.
cd bin_linux
../configure

and continue the build as usual.

If you change 'configure.in' or related files, you need to regenerate the 
configure script.

From the spread/ directory,
to rebuild the configure script you need to run:
  
autoconf -I buildtools
    
If you add new header defines you may also need to run
autoheader -I buildtools

NOTE: autoconf veresion 2.62 has at least one known bug that makes the resulting 
configure script not work on PPC architecture machines. So we recommend building 
with either autoconf 2.59 or autoconf with version at least 2.64.

To make a new release of Spread
-------------------------------

- Code Changes in release commit

1) Update Spread version number.
  *) Update the Java build files javaapps/build.xml 
     <property name="version" value="3.17.2"/>

  *) Also update the spread version in SpreadConnection.java

  *) Update Spread version number in daemon/spread_params.h
     SP_MAJOR_VERSION, SP_MINOR_VERSION, SP_PATCH_VERSION
  *) Update the SPREAD_VERSION define in sp.h
  *) Update the version at the top of configure.in

2) If changes to spread library, update the library version (LIBVERSION) as needed in libspread/Makefile.in

3) Update build dates.
   *) Update build date in spread_params.h.
   *) Update Readme.txt header with new date and version.
   *) Update copyright statement in all source code with new year. Sample command: 
      sed -i.bak -e "s#1993-2006#1993-2009#g" *.[chyl]
      verify results
      rm *.bak
 
4) Tags are: 
   BETA1_4_0_0 for first beta
   RC1_4_0_0 for first release candidate
   REL_4_0_0 for final release
   version-tag is of format 4.0.0rc1
   svn export svn+ssh://svn.spread.org/spread/tags/{TAGNAME} spread-src-{version-tag}
5) run:
   ./configure 
   make -C daemon parser to build lex/yacc
   make distclean

6) Include release_announcement.txt

7) After release source tar is built and parser is built. Make sure
   lex.yy.c does not #include <unistd.h> without protecting it by 
   #ifndef ARCH_PC_WIN95 ... #endif

   Modern lex/yacc now protect the unistd.h include with a #ifndef YY_NO_UNISTD_H
   So Windows build files can define that to avoid the bad header. 

To make binary release of Spread
--------------------------------

1) Untar the source release.

2) For each platform to support do:
   mkdir bin_osname (for example bin_linux)
   cd bin_osname
   ../configure
   make 
   make binrelease
   mv bin/archname ../bin/
   mv lib/archname ../lib/
   cd ..
   rm -rf bin_osname

3) For java do:
   ant jar
   ant sample-apps
   ant javadocs
   rm  *.java
   rm  spread/*.java

3) Remove unneeded directories and files:
   rm -rf daemon libspread perl stdutil win32 CVS_Readme.txt

4) Replace makefiles with binrelease makefiles for 
   the examples directory and toplevel. 
