<!-- $Id: installation.sgml,v 1.13 2005/06/16 14:42:56 cbbrowne Exp $ -->
<sect1 id="installation">
<title>&slony1; Installation</title>

<para>You should have obtained the &slony1; source from the previous
step. Unpack it.</para>

<screen>
gunzip slony.tar.gz;
tar xf slony.tar
</screen>

<para> This will create a directory under the current directory with
the &slony1; sources.  Head into that that directory for the rest of
the installation procedure.</para>

<sect2>
<title>Short Version</title>

<para>
<screen>
PGMAIN=/usr/local/pgsql746-freebsd-2005-04-01 \
./configure \
    --prefix=$PGMAIN \
    --bindir=$PGMAIN/bin \
    --datadir=$PGMAIN/share \
    --libdir=$PGMAIN/lib \
    --with-pgconfigdir=$PGMAIN/bin \
    --with-pgbindir=$PGMAIN/bin \
    --with-pgincludedir=$PGMAIN/include \
    --with-pglibdir=$PGMAIN/lib \
    --with-pgsharedir=$PGMAIN/share
gmake all; gmake install
</screen>
</para></sect2>

<sect2>
<title>Configuration</title>

<para>The first step of the installation procedure is to configure the
source tree for your system.  This is done by running the
<application>configure</application> script.  In early versions,
<application>configure</application> needed to know where your
&postgres; source tree is, which was done with the
<option>--with-pgsourcetree=</option> option.  As of version 1.1, this
is no longer necessary, as &slony1; has included within its own code
base certain parts needed for platform portability.  It now only needs
to make reference to parts of &postgres; that are actually part of the
installation.  Therefore, &slony1; is configured by pointing it to the
various library, binary, and include directories.  For a full list of
these options, use the command <command>./configure --help</command>
</para>

</sect2>

<sect2>
<title>Example</title>

<screen>
PGMAIN=/opt/dbs/pgsql746-aix-2005-04-01 \
./configure \
    --prefix=$PGMAIN \
    --bindir=$PGMAIN/bin \
    --datadir=$PGMAIN/share \
    --libdir=$PGMAIN/lib \
    --with-pgconfigdir=$PGMAIN/bin \
    --with-pgbindir=$PGMAIN/bin \
    --with-pgincludedir=$PGMAIN/include \
    --with-pglibdir=$PGMAIN/lib \
    --with-pgsharedir=$PGMAIN/share
</screen>

<para>The <application>configure</application> script will run a
number of tests to guess values for various dependent variables and
try to detect some quirks of your system.  &slony1; is known to need a
modified version of <application>libpq</application> on specific
platforms such as Solaris2.X on SPARC.  The patch for libpq version
7.4.2 can be found at <ulink id="threadpatch" url=
"http://developer.postgresql.org/~wieck/slony1/download/threadsafe-libpq-742.diff.gz">
http://developer.postgresql.org/~wieck/slony1/download/threadsafe-libpq-742.diff.gz
</ulink> Similar patches may need to be constructed for other
versions; see the FAQ entry on <link linkend="threadsafety"> thread
safety </link>. </para>
</sect2>

<sect2>
<title>Build</title>

<para>To start the build process, type

<screen>
gmake all
</screen></para>

<para> Be sure to use GNU make; on BSD systems, it is called
<application>gmake</application>; on Linux, GNU make is typically the
<quote>native</quote> <application>make</application>, so the name of
the command you type in may be either <command>make</command> or
<command>gmake</command>.  On other platforms, you may need additional
packages or even install GNU make from scratch.  The build may take
anywhere from a few seconds to 2 minutes depending on how fast your
hardware is at compiling things.  The last line displayed should
be</para>

<para> <command> All of Slony-I is successfully made.  Ready to
install.  </command></para>
</sect2>

<sect2>
<title> Installing &slony1;</title>

<para> To install &slony1;, enter

<command>
gmake install
</command></para>

<para>This will install files into postgresql install directory as
specified by the <option>--prefix</option> option used in the
&postgres; installation.  Make sure you have appropriate permissions
to write into that area.  Normally you need to do this either as root
or as the postgres user.  </para>
</sect2>
</sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:"book.sgml"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
