| This page is user contributed documentation. See the bottom of the page for information about the author. | |
$
unset LD_LIBRARY_PATH LD_RUN_PATH
$ PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin
$ LD_OPTIONS='-R$ORIGIN/../lib'
On SPARC boxes, leave out the -march=i586 and
-mcpu=i686 options. $ CFLAGS='-O2 -march=i586 -mcpu=i686
-I/opt/pgsql/include'
$ CPPFLAGS='-O2 -march=i586 -mcpu=i686 -I/opt/pgsql/include'
$ export CFLAGS CPPFLAGS LD_OPTIONS PATH
Extract, compile and install Readline $ gunzip
readline-4.2a.tar.gz
$ tar xfp readline-4.2a.tar
$ cd readline-4.2a
$ ./configure --prefix=/opt/pgsql
$ make shared
$ make install-shared
$ cd ..
The environment variables for installing Readline
are fine for installing OpenSSL too, so extract, compile and
install it: $ gunzip openssl-0.9.6h.tar.gz
$ tar xfp openssl-0.9.6h.tar
$ cd openssl-0.9.6h
$ ./config --prefix=/opt/pgsql threads shared
$ make
$ make test
$ make install
$ cd ..
The environment variables for comping and installing
PostgreSQL need to be a bit different, so change these now:
$ LD_OPTIONS='-L/opt/pgsql/lib -R$ORIGIN/../lib
-R/opt/pgsql/lib -i -s -z origin'
On SPARC boxes, leave out the -march=i586 and
-mcpu=i686 options. $ CFLAGS=`getconf LFS_CFLAGS`' -O2
-march=i586 -mcpu=i686 -funroll-loops -fexpensive-optimizations
-I/opt/pgsql/include'
$ CPPFLAGS=`getconf LFS_CFLAGS`' -O2 -march=i586 -mcpu=i686
-funroll-loops -fexpensive-optimizations -I/opt/pgsql/include'
$ export CFLAGS CPPFLAGS LD_OPTIONS
Extract and compile PostgreSQL: $ gunzip
postgresql-7.3.2.tar.gz
$ tar xfp postgresql-7.3.2.tar
$ cd postgresql-7.3.2
$ ./configure --prefix=/opt/pgsql --with-openssl
$ make
$ make check
The "GEOMETRY" test may slightly fail here, so you
should check the src/test/regress/regression.diffs file just to
ensure the only differences are in a very, very small decimal
point and not something significant. This kind of extremely small
difference is generally acceptable. Now install it: $ make
install
$ make install-all-headers
Set the PostgreSQL environment variables in the
profile of the "postgres" user: $ echo 'PGHOME=/opt/pgsql'
> /opt/pgsql/.profile
$ echo 'PATH=$PGHOME/bin:$PATH' >> /opt/pgsql/.profile
$ echo 'PGDATA=$PGHOME/data' >> /opt/pgsql/.profile
$ echo 'export PGHOME PATH PGDATA' >> /opt/pgsql/.profile
Initialise the database: $ cd
$ . .profile
$ initdb
$ exit
#
Install the PostgreSQL startup script from:
# cp 732solaris8-startup /etc/init.d/pgsql
# ln /etc/init.d/pgsql /etc/rc3.d/S05pgsql
# ln /etc/init.d/pgsql /etc/rc0.d/K30pgsql
As a note, you shouldn't have to add any of the
PostgreSQL directories to LD_LIBRARY_PATH for the client
applications to work.