<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [postgis-users] Compiliing PostGIS vs PostgresSQL</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Sorry everyone. I e-mailed these instructions many hours ago, but only to myself, so I thought it was from the Users' list when the message showed in my inbox.</FONT></P>

<P><FONT SIZE=2>Here are my instructions for installing PostGIS with the default PostgreSQL from RPM and/or fresh Linux operating system install. </FONT></P>

<P><FONT SIZE=2>You should already have a PostgreSQL directory structure such as this in your system;</FONT>
</P>

<P><FONT SIZE=2>/usr/include/pgsql </FONT>
</P>

<P><FONT SIZE=2>/usr/share/pgsql </FONT>
</P>

<P><FONT SIZE=2>/usr/lib/pgsql </FONT>
</P>

<P><FONT SIZE=2>/var/lib/pgsql </FONT>
</P>

<P><FONT SIZE=2>Now, you can install PostGIS into these directories or you can mimic a PostgreSQL install in another directory such as /usr/local/pgsql. I like to install PostGIS alone in /usr/local/pgsql to make it easier for updates. I'll give instructions for both methods. Make sure PostgreSQL is shut down (no postmaster process running).</FONT></P>

<P><FONT SIZE=2>For PostGIS installation into /usr/local/pgsql; </FONT>
</P>

<P><FONT SIZE=2>1) Download postgresql-7.X.X.tar.gz, un-zip and un-tar (match the current version of PostgreSQL installed on your system). </FONT></P>

<P><FONT SIZE=2>2) Run the configure script with --prefix=/usr/local/pgsql and then run make. You don't need to run make install.</FONT>
</P>

<P><FONT SIZE=2>3) Create these directories manually; </FONT>
</P>

<P><FONT SIZE=2>   /usr/local/pgsql/bin </FONT>
<BR><FONT SIZE=2>   /usr/local/pgsql/doc </FONT>
<BR><FONT SIZE=2>   /usr/local/pgsql/include </FONT>
<BR><FONT SIZE=2>   /usr/local/pgsql/lib </FONT>
<BR><FONT SIZE=2>   /usr/local/pgsql/man </FONT>
<BR><FONT SIZE=2>   /usr/local/pgsql/share </FONT>
</P>

<P><FONT SIZE=2>4) Install PostGIS as per Refractions instructions. </FONT>
</P>

<P><FONT SIZE=2>You will notice PostGIS sitting in the directories in /usr/local/pgsql. I like to enter each directory and copy the PostGIS files to a folder in that directory stipulating PostGIS's version. This is how I keep multiple PostGIS versions on my system.</FONT></P>

<P><FONT SIZE=2>For PostGIS installation into default RedHat (and other Linux versions) PostgreSQL install; </FONT>
</P>

<P><FONT SIZE=2>1) Move the following directories to *.bak (or some other name) </FONT>
</P>

<P><FONT SIZE=2>   mv /usr/include/pgsql /usr/include/pgsql.bak </FONT>
<BR><FONT SIZE=2>      /usr/share/pgsql </FONT>
<BR><FONT SIZE=2>      /usr/lib/pgsql </FONT>
<BR><FONT SIZE=2>      /var/lib/pgsql </FONT>
</P>

<P><FONT SIZE=2>You have to move the directories because PostgreSQL will see those directories and then configure itself to install to /*/*/postgres instead of /*/*/pgsql.</FONT></P>

<P><FONT SIZE=2>2) Download postgresql-7.X.X.tar.gz, un-zip and un-tar (match the current version of PostgreSQL installed on your system). </FONT></P>

<P><FONT SIZE=2>3) Run the configure script with --prefix=/usr and then run make. You don't need to run make install. </FONT>
</P>

<P><FONT SIZE=2>4) Move the previous directories to their original names </FONT>
</P>

<P><FONT SIZE=2>   mv /usr/include/pgsql.bak /usr/include/pgsql </FONT>
</P>

<P><FONT SIZE=2>5) Install PostGIS as per Refractions instructions. </FONT>
</P>

<P><FONT SIZE=2>Hope this has enough info. E-mail me if you get in a bind and I'll help you out. </FONT>
</P>

<P><FONT SIZE=2>Darren H.</FONT>
</P>

</BODY>
</HTML>