#!/bin/sh
# build-pgsql8.sh Sa 03 Mär 2007 18:28:30 CET
# 
# Build script for Postgresql
# (c) 2007 Mario Günterberg <mg@havelsoft.com>


PG_VER=8.2.4
PG_PREFIX=/usr/local/postgresql-$PG_VER

echo "Installation tool for Postgresql $PG_VER"
echo "Configuring Postgresql $PG_VER..."
echo " "
sleep 3

cd postgresql-$PG_VER

./configure CFLAGS="-O3 -march=i686 -mtune=i686"  --prefix=$PG_PREFIX \
	--without-docdir \
	--mandir=/usr/local/share/man \
	--enable-locale \
	--enable-recode \
	--enable-integer-datetimes \
	--enable-thread-safety \
	--enable-multibyte \
	--enable-nls=ALL \
	--with-perl \
	--with-python \
	--with-pam \
	--with-openssl \
	--with-tcl \
	--with-krb5 \
	--with-ldap
	
echo " "
echo "done... "
echo " "
sleep 3
echo "Building Postgresql $PG_VER..."
make -j4
make -j4 -C contrib
make -j4 -C contrib/xml2
make -j4 -C contrib/adminpack
echo " "
echo "done... "
echo " "

# If you don't run as sudo/root leave the comments.

#sleep 3
#echo "Installing Postgresql $PG_VER..."
#make install
#make -C contrib install
#make -C contrib/xml2 install
#make -C contrib/adminpack install
#ln -s $PG_PREFIX /usr/local/postgresql
#echo " "
#echo "done... "
