[arch-commits] Commit in postgresql/trunk (PKGBUILD postgresql postgresql.confd)

2011-09-26 Thread Dan McGee
Date: Monday, September 26, 2011 @ 16:58:47
  Author: dan
Revision: 138523

bashify init script, prepare for 9.1.1 release

Modified:
  postgresql/trunk/PKGBUILD
  postgresql/trunk/postgresql
  postgresql/trunk/postgresql.confd

--+
 PKGBUILD |   13 +++
 postgresql   |   62 -
 postgresql.confd |   17 +++---
 3 files changed, 47 insertions(+), 45 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2011-09-26 20:47:05 UTC (rev 138522)
+++ PKGBUILD2011-09-26 20:58:47 UTC (rev 138523)
@@ -3,7 +3,7 @@
 
 pkgbase=postgresql
 pkgname=('postgresql-libs' 'postgresql-docs' 'postgresql')
-pkgver=9.1.0
+pkgver=9.1.1
 _majorver=${pkgver%.*}
 pkgrel=1
 arch=('i686' 'x86_64')
@@ -118,8 +118,13 @@
 ${pkgdir}/etc/logrotate.d/postgresql
 }
 
-md5sums=('0497b9da1d7c380c340a9a87ba5500fe'
- '2bc5ca8d850d48fb3bb8a6d69832b6f9'
- 'bcde874133a2e07d160fb8f0b48bb842'
+md5sums=('061a9f17323117c9358ed60f33ecff78'
+ '4a6e9b63f2aa50195735f2b46aba040b'
+ '2bef962971bac882022c41a72efabb96'
  '96f82c38f3f540b53f3e5144900acf17'
  'd28e443f9f65a5712c52018b84e27137')
+sha256sums=('c794016bcf3fc1f561bc86796c6c9d050e3d8d2d55356515126e048275ae56f2'
+'b2931d7a719e765f14811b9109310b2418d3064bfcedef699573fc25854a2201'
+'92fe999c34824a9b8fe4b7212d58f60247e3d0514dd38807758eac64c4198190'
+'57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
+'6abb842764bbed74ea4a269d24f1e73d1c0b1d8ecd6e2e6fb5fb10590298605e')

Modified: postgresql
===
--- postgresql  2011-09-26 20:47:05 UTC (rev 138522)
+++ postgresql  2011-09-26 20:58:47 UTC (rev 138523)
@@ -7,70 +7,66 @@
 # Default PGROOT if it wasn't defined in the conf.d file
 PGROOT=${PGROOT:-/var/lib/postgres}
 PGLOG=${PGLOG:-/var/log/postgresql.log}
-PG_CTL=/usr/bin/pg_ctl -D \$PGROOT/data\ -l \$PGLOG\ -s -w
-if [ -n $PGOPTS ]; then
-PG_CTL=$PG_CTL -o \$PGOPTS\
-fi
+PGCTL_BIN=/usr/bin/pg_ctl
+PGCTL_ARGS=(-D $PGROOT/data -l $PGLOG -s -w)
+[[ $PGOPTS ]]  PGCTL_ARGS+=(-o $PGOPTS)
 
 postgres_init() {
 # initialization
-if [ ! -d $PGROOT/data ]; then
+if [[ ! -d $PGROOT/data ]]; then
 mkdir -p $PGROOT/data  chown -R postgres:postgres $PGROOT
-su - postgres -c /usr/bin/initdb $INITOPTS -D \$PGROOT/data\
+su - postgres -c /usr/bin/initdb $INITOPTS -D '$PGROOT/data'
 fi
-if [ ! -e $PGLOG ]; then
+if [[ ! -e $PGLOG ]]; then
 touch $PGLOG
 chown postgres $PGLOG
 fi
 }
 
-case $1 in
+do_postgres() {
+  su - postgres -c '$PGCTL_BIN' $(printf '%q ' ${PGCTL_ARGS[@]}) $@
+}
+
+case $1 in
   start)
 postgres_init
 stat_busy Starting PostgreSQL
-su - postgres -c \
- $PG_CTL start
-if [ $? -gt 0 ]; then
-  stat_fail
-  exit 1
-else
+if do_postgres start; then
   add_daemon postgresql
   stat_done
+else
+  stat_fail
+  exit 1
 fi
 ;;
   stop)
 stat_busy Stopping PostgreSQL
-su - postgres -c \
-  $PG_CTL stop -m fast
-if [ $? -gt 0 ]; then
-  stat_fail
-else
+if do_postgres stop -m fast; then
   rm_daemon postgresql
   stat_done
+else
+  stat_fail
+  exit 1
 fi
 ;;
   reload)
 stat_busy Reloading PostgreSQL
-su - postgres -c \
-  $PG_CTL reload
-if [ $? -gt 0 ]; then
+if do_postgres reload; then
+  stat_done
+else
   stat_fail
   exit 1
-else
-  stat_done
 fi
 ;;
   restart)
-postgres_init
+postgres_init
 stat_busy Restarting PostgreSQL
-su - postgres -c \
-  $PG_CTL restart -m fast
-if [ $? -gt 0 ]; then
-  stat_fail
-  exit 1
-else
+if do_postgres restart -m fast; then
   add_daemon postgresql
   stat_done
+else
+  stat_fail
+  exit 1
 fi
 ;;
   status)
@@ -78,6 +74,6 @@
 ck_status postgresql
 ;;
   *)
-echo usage: $0 {start|stop|reload|restart|status}  
+echo usage: $0 {start|stop|reload|restart|status}
+exit 1
 esac
-exit 0

Modified: postgresql.confd
===
--- postgresql.confd2011-09-26 20:47:05 UTC (rev 138522)
+++ postgresql.confd2011-09-26 20:58:47 UTC (rev 138523)
@@ -1,10 +1,11 @@
-#
-# Parameters to be passed to postgresql
-#
-PGROOT=/var/lib/postgres
-# Passed to initdb if necessary
-INITOPTS=--locale $LANG
-# Default log file location
+##
+## Parameters to be passed to postgresql
+##
+## Default data directory location
+#PGROOT=/var/lib/postgres
+## Passed to initdb if necessary
+#INITOPTS=--locale $LANG
+## Default log file location
 #PGLOG=/var/log/postgresql.log
-# Additional options to pass via pg_ctl's '-o' option
+## Additional options to pass via pg_ctl's '-o' option
 

[arch-commits] Commit in postgresql/trunk (PKGBUILD postgresql postgresql.confd)

2010-02-10 Thread Daniel Griffiths
Date: Wednesday, February 10, 2010 @ 19:02:45
  Author: dgriffiths
Revision: 68142

FS#12432

Modified:
  postgresql/trunk/PKGBUILD
  postgresql/trunk/postgresql
  postgresql/trunk/postgresql.confd

--+
 PKGBUILD |   43 ++-
 postgresql   |2 +-
 postgresql.confd |3 ++-
 3 files changed, 25 insertions(+), 23 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2010-02-10 23:43:54 UTC (rev 68141)
+++ PKGBUILD2010-02-11 00:02:45 UTC (rev 68142)
@@ -3,19 +3,19 @@
 
 pkgname=postgresql
 pkgver=8.4.2
-pkgrel=1
+pkgrel=2
 pkgdesc=A sophisticated object-relational DBMS
-arch=(i686 x86_64)
+arch=('i686' 'x86_64')
+url=http://www.postgresql.org;
 license=('BSD')
 backup=('etc/conf.d/postgresql' 'etc/pam.d/postgresql')
-url=http://www.postgresql.org/;
-depends=(postgresql-libs=$pkgver libxml2 'readline=6.0')
+depends=(postgresql-libs=${pkgver} libxml2 'readline=6.0')
 options=('!makeflags')
 
source=(ftp://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2
 \
 postgresql postgresql.confd build.patch postgresql.pam)
 
 build() {
-  cd ${startdir}/src/$pkgname-$pkgver || return 1
+  cd ${srcdir}/${pkgname}-${pkgver} || return 1
 
   # patch to remove regress/test make target (won't build with it present)
   patch -Np1 -i ../build.patch || return 1
@@ -31,43 +31,44 @@
   make || return 1
 
   # install
-  make DESTDIR=${startdir}/pkg install || return 1
+  make DESTDIR=${pkgdir} install || return 1
 
   (
   cd contrib/adminpack;
   make || return 1;
-  make DESTDIR=${startdir}/pkg install || return 1;
+  make DESTDIR=${pkgdir} install || return 1;
   );
 
 
   # clean up unneeded installed items
-  rm -rf $startdir/pkg/usr/include/postgresql/internal || return 1
-  rm -rf $startdir/pkg/usr/include/libpq || return 1
+  rm -rf ${pkgdir}/usr/include/postgresql/internal || return 1
+  rm -rf ${pkgdir}/usr/include/libpq || return 1
   # the below line is expected to produce an error; fix this one day
-  rm -f $startdir/pkg/usr/include/*
-  rm -f $startdir/pkg/usr/bin/pg_config || return 1
+  #rm -f ${pkgdir}/usr/include/*
+  find ${pkgdir}/usr/include -maxdepth 1 -type f -execdir rm {} + || return 1
+  rm -f ${pkgdir}/usr/bin/pg_config || return 1
   
   # Maintaining the lib below because of qt
-  #rm -f $startdir/pkg/usr/lib/libpgport.a || return 1
+  #rm -f ${pkgdir}/usr/lib/libpgport.a || return 1
 
   # install launch script
-  install -D -m755 ../postgresql $startdir/pkg/etc/rc.d/postgresql \
+  install -D -m755 ../postgresql ${pkgdir}/etc/rc.d/postgresql \
|| return 1
 
   # install license
-  install -D -m644 COPYRIGHT $startdir/pkg/usr/share/licenses/$pkgname/LICENSE 
|| return 1
+  install -D -m644 COPYRIGHT ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE 
|| return 1
 
   # install conf file
-  install -D -m644 $startdir/src/postgresql.confd \
-$startdir/pkg/etc/conf.d/postgresql || return 1
+  install -D -m644 ${srcdir}/postgresql.confd \
+${pkgdir}/etc/conf.d/postgresql || return 1
 
-  install -D -m644 $startdir/src/postgresql.pam \
-$startdir/pkg/etc/pam.d/postgresql
+  install -D -m644 ${srcdir}/postgresql.pam \
+${pkgdir}/etc/pam.d/postgresql
 
-  chown root:root $startdir/pkg/usr/share/doc/postgresql/html/*
+  chown root:root ${pkgdir}/usr/share/doc/postgresql/html/*
 }
 md5sums=('d738227e2f1f742d2f2d4ab56496c5c6'
- '7d8ea2abb6a8cdacf35604bda659a34a'
- 'df6ddf9e2ab4700a3415f17c0f4f4172'
+ '2c9a8bf7942b627931e3242daa6c58d4'
+ 'd63a05943cf0a2726aa2070f3033c569'
  '4d74f4227dc5e12bf95b3490758d86c9'
  '96f82c38f3f540b53f3e5144900acf17')

Modified: postgresql
===
--- postgresql  2010-02-10 23:43:54 UTC (rev 68141)
+++ postgresql  2010-02-11 00:02:45 UTC (rev 68142)
@@ -21,7 +21,7 @@
 fi
 if [ ! -d $PGROOT ]; then
   mkdir -p $PGROOT/data  chown postgres.postgres $PGROOT/data
-  su - postgres -c /usr/bin/initdb -D $PGROOT/data
+  su - postgres -c /usr/bin/initdb $INITOPTS -D $PGROOT/data
 fi
 if [ ! -e /var/log/postgresql.log ]; then
   touch /var/log/postgresql.log

Modified: postgresql.confd
===
--- postgresql.confd2010-02-10 23:43:54 UTC (rev 68141)
+++ postgresql.confd2010-02-11 00:02:45 UTC (rev 68142)
@@ -1,4 +1,5 @@
 #
 # Parameters to be passed to postgresql
 #
-PGROOT=/var/lib/postgres
\ No newline at end of file
+PGROOT=/var/lib/postgres
+INITOPTS=--locale $LANG