This file describes the build procedure of the ARC middleware from tarball
or from source RPM.


Dependencies
============

Before trying to compile the ARC middleware make sure you have installed
the following software packages:

    o GNU make, GNU autotools
    o C++ compiler and library
    o Globus Toolkit 4.x or 5.x (http://www.globus.org/)
	- GridFTP client libraries
	- RSL libraries
	- Globus RLS client libraries (optional)
    o BDII 4 or 5 (https://twiki.cern.ch/twiki/bin/view/EGEE/BDII)
    o LFC (LCG File Catalog) client libraries (http://glite.web.cern.ch/glite/)
       (ARC can be built without LFC)
    o gSOAP (http://www.cs.fsu.edu/~engelen/soap.html)
       (gsoap version above 2.7.2 is required)
    o VOMS client libraries (http://glite.web.cern.ch/glite/) 
       (ARC can be built without VOMS)
    o OpenLDAP client and server libraries (http://www.openldap.org/)
    o MySQL client libraries
    o libxml2 (version 2.4.x or later)
    o Python development libraries (optional - for the Python interface 
       for ARCLIB)
    o libuuid library

More specifically, the contents available in these packages (Names may vary depending on distribution):

    o gsoap-devel >= 2.7.2
    o libxml2-devel >= 2.4.0
    o globus-common-devel
    o globus-ftp-client-devel
    o globus-ftp-control-devel
    o globus-gass-transfer-devel
    o globus-gsi-credential-devel
    o globus-gsi-sysconfig-devel
    o globus-gss-assist-devel
    o globus-io-devel
    o openldap-devel
    o globus-rls-client-devel
    o globus-rsl-devel
    o gettext
    o python-devel
    o voms-devel
    o mysql-devel
    o bdii
    o libuuid-devel or e2fsprogs-devel (depending on distribution)

Note that many Linux distributions provide packaged versions of these
libraries and tools, including Globus, LFC, gSOAP and VOMS. It is
highly recommended to use these packages if possible. All packages
that are required but are not part of Linux distribution repositories
are available from the NorduGrid repositories for supported platforms.

Recommended way of setting up your own build of ARC is to enable the
NorduGrid repositories for your system, install all dependencies for
ARC from there and then only build ARC yourself according to
instructions below.

Basic BUILD with autotools
==========================

The build is using the GNU autotools. This means that a standard installation
can be made with:

  ./configure
  make
  make install

If you are building from SVN you need to start with:

  ./bootstrap

If you want to create your own packages from SVN, you first run:

  ./bootstrap
  ./configure
  make dist

then, depending on if you are on Debian or RedHat you run:

  dpkg-buildpackage

or

  rpmbuild -ba build/nordugrid-arc.spec


The configure script accepts the usual options with the addition of (defaults in brackets):

  --disable-python-wrappers          Disable Python wrappers for ARCLIB
  --enable-pkgdirs                   Use pkg directories. Useful for /usr installations.
  --enable-globus-openldap           Use OpenLDAP provided as part of Globus
  --disable-voms                     Disable VOMS support
  --disable-lcas                     Disable LCAS support
  --disable-lcmaps                   Disable LCMAPS support
  --disable-lfc                      Disable LFC support
  --enable-experimental              Enable experimental code
  --disable-rpath-hack               Do not rpath external and internal libraries in libraries/binaries
  --enable-docs                      Build documentation
  --disable-services                 Do not build service components

  --with-sysv-scripts-location=<PATH>    Location of the SYSV init scripts. [autodetect]
  --with-monitor-prefix=<PATH>           Specify the location of the Grid Monitor WWW scripts. [LOCALSTATEDIR/www/html/gridmonitor]
  --with-monitor-local-prefix=<PATH>     Specify the relative location of the Grid Monitor WWW scripts. [gridmonitor]
  --with-cron-scripts-prefix=<PATH>      Specify the location of the cron directory. [SYSCONFDIR/cron.d]
  --with-profile-scripts-prefix=<PATH>   Specify the location of the profile directory. [SYSCONFDIR/profile.d]
  --with-gsoap-location=<PATH>           Specify the gSOAP installation path. [autodetect]
  --with-mysql-location=<PATH>           Specify the MySQL installation path. [autodetect]
  --with-libxml-location=<PATH>          Specify the libxml2 installation path. [autodetect]
  --with-gacl-location=<PATH>            Specify the GACL installation path. [/opt/gridsite|autodetect]
  --with-nordugrid-location=<PATH>       OBSOLETE Specify the nordugrid installation path. [/usr]
  --with-flavor=(flavor)                 Specify the gpt build flavor. [autodetect]
  --with-default-globus-location=<PATH>  Specify the default globus location. [autodetect]
  --with-voms-location=<PATH>            Specify the VOMS installation path. [/usr]
  --with-lcas-location=<PATH>            Specify the LCAS installation path. [/opt/glite]
  --with-lcmaps-location=<PATH>          Specify the LCMAPS installation path. [/opt/glite]
  --with-lfc-location=<PATH>           Specify the LFC installation path. [/opt/glite]

Note that using --disable-pkgdirs will install the software without package
directories suitable for /opt/nordugrid installation:

   /opt/nordugrid/bin
   /opt/nordugrid/lib 
   /opt/nordugrid/libexec
   ..

For a "standard" install the --prefix=/usr/local will place the software in
nordugrid subdirectories:

   /usr/local/bin
   /usr/local/lib/nordugrid 
   /usr/local/libexec/nordugrid 
   ..

'make' builds the full middleware containing server, client, monitor and
documentation, currently modular builds (such as 'make client', or 'make
server') are not supported yet.


Building with RPM
=================

ARC can be built using RPM. From a tar.gz file do:

   rpmbuild -ta nordugrid-arc-<version>.tar.gz

and from a .src.rpm do:

   rpmbuild --rebuild nordugrid-arc-<version>.src.rpm

Source RPMs are configured with the --disable-pkgdirs switch and binary
builds are relocatable (consult the relocation_instructions).
 
In terms of RPMs the build requirements can be satisfied with the following
packages:

   o gsoap-devel >= 2.7.2
   o libxml2-devel >= 2.4.0
   o globus-common-devel
   o globus-ftp-client-devel
   o globus-ftp-control-devel
   o globus-gass-transfer-devel
   o globus-gsi-credential-devel
   o globus-gsi-sysconfig-devel
   o globus-gss-assist-devel
   o globus-io-devel
   o openldap-devel
   o globus-rls-client-devel
   o globus-rsl-devel
   o gettext
   o python-devel
   o voms-devel
   o mysql-devel
   o libuuid-devel or e2fsprogs-devel (depending on distribution)

Note that the naming convention above might not correspond exactly to the
naming used on your system.


Binary RPMs: runtime requirements
=================================

The RPMs created by rpmbuild are:


   o nordugrid-arc-client         - Client programs
   o nordugrid-arc-server         - Server-side meta-package with dependencies on all components
   o nordugrid-arc-gridftpd       - Gridftpd package
   o nordugrid-arc-grid-manager   - Grid-manager package
   o nordugrid-arc-infosys-ldap   - Information system and information index server
   o nordugrid-arc-gridmap-utils  - Utilities for managing gridmap-files
   o nordugrid-arc-ca-utils       - Utilities for maintaining CA files    
   o nordugrid-arc-monitor        - Grid monitor web interface (should be installed on a Web server)
   o nordugrid-arc-doc            - Documentation
   o nordugrid-arc-libs           - Runtime libraries
   o nordugrid-arc-libs-devel     - Development files
   o nordugrid-arc-python         - Python bindings of ARClib


Special requirements of the Grid Monitor (not expressed in RPM requirements):

In order to have a fully functional Grid Monitor you should follow the
instructions given in the README file of the nordugrid-arc-monitor package.



INSTALLATION
============

For server or client setup and configuration please refer to the server or
client installation instructions available from the www.nordugrid.org.
Reading the relocation_instructions.html available in the doc/ folder can be
useful as well. The middleware comes with documented server-side configuration
templates (arc.conf.template). Client installation is also discussed in the
"NorduGrid User Guide".
