From 99fc9c864b19164e77ffc973042cb4b625c1e2c1 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sat, 4 Oct 2014 17:39:40 +0200 Subject: [PATCH] postgresql: update to 9.3.5. --- srcpkgs/postgresql/files/postgresql/log/run | 2 ++ .../postgresql/files/postgresql/log/supervise | 1 + srcpkgs/postgresql/files/postgresql/run | 30 +++++++++++++++++ srcpkgs/postgresql/files/postgresql/supervise | 1 + srcpkgs/postgresql/template | 32 +++++++++++++++---- 5 files changed, 59 insertions(+), 7 deletions(-) create mode 100755 srcpkgs/postgresql/files/postgresql/log/run create mode 120000 srcpkgs/postgresql/files/postgresql/log/supervise create mode 100755 srcpkgs/postgresql/files/postgresql/run create mode 120000 srcpkgs/postgresql/files/postgresql/supervise diff --git a/srcpkgs/postgresql/files/postgresql/log/run b/srcpkgs/postgresql/files/postgresql/log/run new file mode 100755 index 00000000000..e564447b60d --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec logger -p daemon.info -t postgres diff --git a/srcpkgs/postgresql/files/postgresql/log/supervise b/srcpkgs/postgresql/files/postgresql/log/supervise new file mode 120000 index 00000000000..e83e93328a9 --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql/log/supervise @@ -0,0 +1 @@ +/run/runit/supervise.postgresql-log \ No newline at end of file diff --git a/srcpkgs/postgresql/files/postgresql/run b/srcpkgs/postgresql/files/postgresql/run new file mode 100755 index 00000000000..8f72ac77d85 --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql/run @@ -0,0 +1,30 @@ +#!/bin/sh +. /etc/default/postgresql +: ${PGDATA:="$PGROOT/data"} + +if [ "$PGROOT" != "/var/lib/postgresql" ]; then + echo "Creating symlink /var/lib/postgresql -> $PGROOT" + + # Remove /var/lib/postgres if empty dir, but not if symlink + if [ ! -L /var/lib/postgres ] && [ -d /var/lib/postgres ]; then + rmdir /var/lib/postgres + fi + + ln -sf "$PGROOT" /var/lib/postgresql +fi + + +if [ ! -d "$PGDATA" ]; then + echo "Initializing database in $PGDATA" + + mkdir -p "$PGDATA" + chown -R postgres:postgres "$PGDATA" + + su - postgres -m -c "/usr/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null + + if [ -f /etc/postgresql/postgresql.conf ]; then + ln -sf /etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf" + fi +fi + +exec chpst -u postgres:postgres postgres -D "$PGDATA" $PGOPTS 2>&1 diff --git a/srcpkgs/postgresql/files/postgresql/supervise b/srcpkgs/postgresql/files/postgresql/supervise new file mode 120000 index 00000000000..ab35157e85b --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql/supervise @@ -0,0 +1 @@ +/run/runit/supervise.postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template index c1266e5de6f..0abbba6a72e 100644 --- a/srcpkgs/postgresql/template +++ b/srcpkgs/postgresql/template @@ -1,9 +1,10 @@ # Template file for 'postgresql' pkgname=postgresql -version=8.4.22 -revision=2 +version=9.3.5 +revision=1 build_style=gnu-configure -configure_args="--with-docdir=/usr/share/doc --with-openssl --with-python +make_build_target="world" +configure_args="--with-openssl --with-python --with-pam --datadir=/usr/share/postgresql --enable-thread-safety --with-perl --with-tcl --without-ldap --without-gssapi --without-krb5 --without-bonjour --with-libxml --with-libxslt --disable-rpath @@ -13,9 +14,9 @@ maintainer="Juan RP " homepage="http://www.postgresql.org" license="BSD" distfiles="ftp://ftp.postgresql.org/pub/source/v${version}/${pkgname}-${version}.tar.bz2" -checksum=5c1d56ce77448706d9dd03b2896af19d9ab1b9b8dcdb96c39707c74675ca3826 +checksum=14176ffb1f90a189e7626214365be08ea2bfc26f26994bafb4235be314b9b4b0 -hostmakedepends="flex" +hostmakedepends="flex docbook docbook2x openjade" makedepends="libfl-devel readline-devel>=6.3 libressl-devel perl>=5.20 tcl-devel>=8.6 python-devel libxml2-devel libxslt-devel pam-devel" conf_files=" @@ -33,10 +34,25 @@ if [ "$CROSS_BUILD" ]; then configure_args+=" --without-perl --without-python --without-tcl" fi +build_options="systemd" + +pre_build() { + # http://www.postgresql.org/docs/9.3/static/docguide-toolsets.html + export SGML_CATALOG_FILES="/usr/share/sgml/openjade/catalog:/usr/share/sgml/iso8879/catalog:/usr/share/sgml/docbook/dsssl/modular/catalog:/usr/share/sgml/docbook/4.2/catalog" +} + post_install() { + vmkdir usr/share/man + cp -r doc/src/sgml/man? ${DESTDIR}/usr/share/man + vmkdir usr/share/doc/postgresql + cp -r doc/src/sgml/html ${DESTDIR}/usr/share/doc/postgresql + vmkdir etc/sv + cp -r ${FILESDIR}/postgresql ${DESTDIR}/etc/sv vinstall ${FILESDIR}/${pkgname}.confd 644 etc/default ${pkgname} - vinstall ${FILESDIR}/${pkgname}.service 644 usr/lib/systemd/system - vinstall ${FILESDIR}/${pkgname}-initdb 755 usr/lib/systemd/scripts + if [ "$build_option_systemd" ]; then + vinstall ${FILESDIR}/${pkgname}.service 644 usr/lib/systemd/system + vinstall ${FILESDIR}/${pkgname}-initdb 755 usr/lib/systemd/scripts + fi vinstall ${FILESDIR}/${pkgname}.pam 644 etc/pam.d ${pkgname} vinstall ${DESTDIR}/usr/share/${pkgname}/${pkgname}.conf.sample \ 644 etc/${pkgname} ${pkgname}.conf @@ -72,6 +88,8 @@ postgresql-libs-devel_package() { done vmove usr/include vmove "usr/lib/*.a" + vmove "usr/lib/pkgconfig/*" + vmove usr/share/man/man3 vmove usr/lib/postgresql/pgxs for d in $(find ${DESTDIR}/usr/share/locale \ -type f -name pg_config\* -o -name ecpg\*); do