summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/postgresql/README.SBo9
-rw-r--r--system/postgresql/postgresql.SlackBuild43
-rw-r--r--system/postgresql/postgresql.info6
-rw-r--r--system/postgresql/rc.postgresql.new12
4 files changed, 49 insertions, 21 deletions
diff --git a/system/postgresql/README.SBo b/system/postgresql/README.SBo
index 48b30ddc28..c876890a36 100644
--- a/system/postgresql/README.SBo
+++ b/system/postgresql/README.SBo
@@ -5,7 +5,7 @@ the trick.
Additionally, a logrotation script and init script are included.
For production level log file handling please read
-http://www.postgresql.org/docs/8.4/interactive/logfile-maintenance.html
+http://www.postgresql.org/docs/9.2/interactive/logfile-maintenance.html
In order to start postgresql at boot and stop it properly at shutdown,
make sure rc.postgresql is executable and add the following lines to
@@ -25,13 +25,16 @@ the following files:
/etc/rc.d/rc.postgresql stop
fi
-Additionally, rc.postgresql script has additionalg modes for stop/restart:
+Additionally, rc.postgresql script has additional modes for stop/restart:
force-stop|force-restart (i.e. pg_ctl 'fast' mode)
unclean-stop|unclean-restart (i.e. pg_ctl 'immediate' mode)
See http://www.postgresql.org/docs/8.4/static/app-pg-ctl.html
This script builds postgresql with some useful extension modules from
the contrib directory, see PG_EXTENSIONS in SlackBuild file.
+To build PostgreSQL with all extensions, use the following command:
+
+ # PG_EXTENSIONS=ALL ./postgresql.SlackBuild
Please note that in order to actually use extension, you must execute
-accompanying SQL scripts located in /usr/share/postgresql/contrib
+'CREATE EXTENSION [ IF NOT EXISTS ] extension_name' for each extension.
diff --git a/system/postgresql/postgresql.SlackBuild b/system/postgresql/postgresql.SlackBuild
index 9816ed5c21..679db6d085 100644
--- a/system/postgresql/postgresql.SlackBuild
+++ b/system/postgresql/postgresql.SlackBuild
@@ -1,8 +1,8 @@
#!/bin/sh
## Slackware build script for PostgreSQL
-## $Revision: 5ad45bfd049c $
-## $Date: 2011/09/27 08:41:46 $
+## $Revision: af516b7c1f99 $
+## $Date: 2012/11/29 20:42:02 $
##
## Copyright 2007-2011 Adis Nezirovic <adis _at_ linux.org.ba>
## Licensed under GNU GPL v2
@@ -10,7 +10,7 @@
# Modified by the SlackBuilds.org Project
PRGNAM=postgresql
-VERSION=${VERSION:-9.1.4}
+VERSION=${VERSION:-9.2.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -44,17 +44,24 @@ elif ! grep ^postgres: /etc/passwd 2>&1 > /dev/null; then
exit 1
fi
+# Enable NLS builds using 'ENABLE_NLS=1 ./postgresql.SlackBuild'
+if [ ! -z $ENABLE_NLS ];then
+ NLS=enable
+else
+ NLS=disable
+fi
+
if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686 -DLINUX_OOM_SCORE_ADJ=0"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686 -DLINUX_OOM_SCORE_ADJ=0"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
+ SLKCFLAGS="-O2 -fPIC -DLINUX_OOM_SCORE_ADJ=0"
LIBDIRSUFFIX="64"
else
- SLKCFLAGS="-O2"
+ SLKCFLAGS="-O2 -DLINUX_OOM_SCORE_ADJ=0"
LIBDIRSUFFIX=""
fi
@@ -83,6 +90,8 @@ CFLAGS="$SLKCFLAGS" \
--with-libxml \
--with-libxslt \
--enable-thread-safety \
+ --with-system-tzdata=/usr/share/zoneinfo \
+ --$NLS-nls \
--build=$ARCH-slackware-linux
make
@@ -91,21 +100,27 @@ make install-docs DESTDIR=$PKG
# Some interesting additional modules:
-# http://www.postgresql.org/docs/9.0/static/contrib.html
+# http://www.postgresql.org/docs/9.2/static/contrib.html
#
# adminpack - helper extension for pgAdmin
# pgcrypto - extension for some business applications
# hstore, ltree, xml2 - useful extensions for developers
# pg_archivecleanup, pg_standby - high availability helpers
-# pg_upgrade - online upgrade between postgresql versions
+# pg_upgrade, pg_upgrade_support - online upgrade between postgresql versions
-PG_EXTENSIONS="adminpack pgcrypto hstore ltree xml2 pg_archivecleanup pg_standby pg_upgrade"
+PG_EXTENSIONS=${PG_EXTENSIONS:-"adminpack pgcrypto hstore ltree xml2 pg_archivecleanup pg_standby pg_upgrade pg_upgrade_support"}
-for ext in $PG_EXTENSIONS; do
- cd $TMP/$PRGNAM-$VERSION/contrib/$ext
- make
+if [ "x$PG_EXTENSIONS" = "xALL" ];then
+ cd $TMP/$PRGNAM-$VERSION/contrib
+ make all
make install-strip DESTDIR=$PKG
-done
+else
+ for ext in $PG_EXTENSIONS; do
+ cd $TMP/$PRGNAM-$VERSION/contrib/$ext
+ make
+ make install-strip DESTDIR=$PKG
+ done
+fi
cd $TMP/$PRGNAM-$VERSION
diff --git a/system/postgresql/postgresql.info b/system/postgresql/postgresql.info
index b24e54b933..89d7016884 100644
--- a/system/postgresql/postgresql.info
+++ b/system/postgresql/postgresql.info
@@ -1,8 +1,8 @@
PRGNAM="postgresql"
-VERSION="9.1.4"
+VERSION="9.2.1"
HOMEPAGE="http://www.postgresql.org"
-DOWNLOAD="ftp://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2"
-MD5SUM="a8035688dba988b782725ac1aec60186"
+DOWNLOAD="ftp://ftp.postgresql.org/pub/source/v9.2.1/postgresql-9.2.1.tar.bz2"
+MD5SUM="c0b4799ea9850eae3ead14f0a60e9418"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/system/postgresql/rc.postgresql.new b/system/postgresql/rc.postgresql.new
index 5eef25badd..6ccda6a335 100644
--- a/system/postgresql/rc.postgresql.new
+++ b/system/postgresql/rc.postgresql.new
@@ -18,6 +18,14 @@ DATADIR=/var/lib/pgsql/data
POSTGRES=/usr/bin/postgres
PIDFILE=postmaster.pid
+# oom-killer score
+# if defined and set to -1000, main postmaster wont be killed
+# by Linux OOM killer, but individual backends still could be
+# (since OOM_SCORE_ADJ in SlackBuild is set to 0)
+#
+# http://www.kernel.org/doc/Documentation/filesystems/proc.txt
+OOM_SCORE_ADJ=-1000
+
# Return values (according to LSB):
# 0 - success
# 1 - generic or unspecified error
@@ -65,6 +73,7 @@ case "$1" in
if [ ! -f $DATADIR/$PIDFILE ]; then
rm -f /tmp/.s.PGSQL.5432
rm -f /tmp/.s.PGSQL.5432.lock
+ test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
pg_ctl start -w -l $LOGFILE -D $DATADIR
exit 0
else
@@ -89,7 +98,7 @@ case "$1" in
;;
"unclean-stop")
- # Take care: This will abort server process itself
+ # Take care! This will abort server process itself
# resulting with database recovery on next start.
echo "Shutting down PostgreSQL (immediate)..."
pg_ctl stop -l $LOGFILE -D $DATADIR -m immediate
@@ -97,6 +106,7 @@ case "$1" in
"restart")
echo "Restarting PostgreSQL..."
+ test x"$OOM_SCORE_ADJ" != x && echo "$OOM_SCORE_ADJ" > /proc/self/oom_score_adj
pg_ctl restart -l $LOGFILE -D $DATADIR -m smart
;;