Installation
************

To get started using Pastwatch, you first need to install the Pastwatch software.  There are two routes you can take to install Pastwatch.  We recommend the first route, which is installing from binary packages. The second route is compiling from source code.

Binary Installation
===================

Currently, we provide binary packages for Fedora Core, and Debian Linux. If you are using one of these operating systems, we recommend downloading a binary installation package from our distribution server (http://pdos.csail.mit.edu/pastwatch/downloads/).

Please refer to the binary packaging system documentation for your operating system for installation instructions.

Source Code Installation
========================

Requirements
------------

If you choose to compile Pastwatch yourself, You'll need a few things:

  * gcc (http://gcc.gnu.org/) versions 2.95.x and some 3.x.  Version 2.96 and 3.4 generate bad code. See this page (http://www.fs.net/sfswww/dist/) for more information.

  * gcc-c++ (http://gcc.gnu.org/) versions 2.95.x and some 3.x.  Same as gcc requirement.

  * libtool (http://www.gnu.org/software/libtool/), version 1.3 (We know that version 1.3 works. Other versions may or may not work)

  * automake (http://www.gnu.org/software/automake/), version 1.5 (We know that version 1.5 works. Other versions may or may not work)

  * autoconf (http://www.gnu.org/software/autoconf/), version 2.53 (We know that version 2.53 works. Other versions may or may not work)

  * gmp (ftp://ftp.gnu.org/pub/gnu/gmp) versions 2.0.2 or higher.  Make sure to install the gmp.h header.  Some binary packages do not include it.

  * BerkeleyDB (http://www.sleepycat.com/) version 4.2 or higher.  Make sure to get the db.h header.  Some binary packages do not include it.

  * sfs (http://www.fs.net/) version 0.7.2 or higher

  * pastwatch (http://pdos.csail.mit.edu/pastwatch#download)

Download and install the required software packages.  You can either install pre-compiled binaries or compile the source code yourself.  For each package, follow the instructions on its own web site.

Once you have the required software, you can download, compile and install Pastwatch.

Downloading the Source Code
---------------------------

The Pastwatch source code is available as a tarball and via anonymous CVS.  Tarballs of release versions are available on the distribution server (http://pdos.csail.mit.edu/pastwatch/downloads/).  Un-tar the tarball using a command like this (Replace pastwatch-0.8.0.tar.gz with the name of the tar file you downloaded):

          % tar xzf pastwatch-0.8.0.tar.gz

The most recent version of the source code is available via anonymous CVS.  To get it, use the following CVS commands:

          % cvs -d :pserver:anoncvs.pdos.csail.mit.edu:/cvs login
          Logging in to :pserver:anoncvs.pdos.csail.mit.edu:2401/cvs
          CVS password: press return

          % cvs -d :pserver:anoncvs.pdos.csail.mit.edu:/cvs co -P pastwatch

Configure, Compile and Install Pastwatch
----------------------------------------

Once you have the source code, you are ready to configure it for your system.  The first step is to call setup which gets the source tree ready for configuration.  Then, you will need to configure the source tree for compilation.  Finally, you will compile the source code and install it in your system directories.

configure looks for dependencies like the SFS headers and Berkeley DB.  If you installed these packages in a non standard location, you may need to tell configure where they are.  For more information about configuring Pastwatch, type ./configure --help.

These are basic steps to compile and install Pastwatch:

 1. cd to the pastwatch directory.

 2. ./setup

 3. ./configure

 4. gmake

 5. gmake install

By default, gmake install installs pastwatch binaries, scripts and man pages into /usr/local/bin, /usr/local/sbin, and /usr/local/man.  If you use the default target directories, you will need to install as the root user.

Setup the Local Replica
=======================

Pastwatch stores a local replica of the project repositories that you use.  This local storage must be on a local file system and not a remote file system such as an NFS mounted disk.  Pastwatch may behave unpredictably if the local replica is stored on a networked file system. Set the environment variable PASTWATCH_LOCAL_REPLICA to the location of your local replica.

You should select a location that is fairly reliable because it is time consuming to repopulate the local replica and the local replica will contain the only copy of your newest changes until you upload them to the Aqua Hosting Service.

By default, pastwatch uses /tmp/$USER-pastreplica for the local replica.  If the content of /tmp is deleted regularly or is short on disk space, you must choose a different location to store the replica.  If your home directory is on a local file system, feel free to set PASTWATCH_LOCAL_REPLICA equal to $HOME/.pastwatch/replica.

If no errors were encountered, the Pastwatch software should be ready to run on your system.  You should now make sure that the pastwatch binaries are in your PATH environment variable.  If you try to run past, it should output command line usage information.

          % past
          Pastwatch version 0.8.0
          usage: pastwatch [opts] cmd [cmd opts] files
           -n: check only, don't make changes
            -l: don't open sub-directories
             -b <branch tag>: specify a branch to use
             -x <n>: debug mask
                1 - reports latency to fetch project block and public keys
                2 - reports latency to fetch blocks
                4 - outputs debug messages when updating a directory
           -s <file>: public/private key file
           -p <project id>: project identification number
           See the man page for commands and command options: pastwatch(1).