diff --git a/srcpkgs/postgresql-client b/srcpkgs/postgresql-client new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-client @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-doc b/srcpkgs/postgresql-doc new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-doc @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-libs b/srcpkgs/postgresql-libs new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-libs @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-libs-devel b/srcpkgs/postgresql-libs-devel new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-libs-devel @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-plperl b/srcpkgs/postgresql-plperl new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-plperl @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-plpython b/srcpkgs/postgresql-plpython new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-plpython @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql-pltcl b/srcpkgs/postgresql-pltcl new file mode 120000 index 00000000000..360e6d1a1f4 --- /dev/null +++ b/srcpkgs/postgresql-pltcl @@ -0,0 +1 @@ +postgresql \ No newline at end of file diff --git a/srcpkgs/postgresql/INSTALL b/srcpkgs/postgresql/INSTALL new file mode 100644 index 00000000000..64fb82939a8 --- /dev/null +++ b/srcpkgs/postgresql/INSTALL @@ -0,0 +1,23 @@ +# *-*-shell-*-* +# +case ${ACTION} in +post) + cat << _EOF +===================================================================== + +Please note that to properly initialize the PostgreSQL server, +a configuration file should be copied to /var/lib/postgresql from +/usr/share/postgresql/postgresql.conf.sample. + +To initialize the PostgreSQL data directory, use this: + + $ sudo su -l postgres -c initdb -D /var/lib/postgresql/data + +To start the server finally use: + + $ /etc/init.d/postgresql start + +===================================================================== +_EOF + ;; +esac diff --git a/srcpkgs/postgresql/depends b/srcpkgs/postgresql/depends new file mode 100644 index 00000000000..eb6270e19d9 --- /dev/null +++ b/srcpkgs/postgresql/depends @@ -0,0 +1,2 @@ +abi_depends=">=8.4.2" +api_depends="${abi_depends}" diff --git a/srcpkgs/postgresql/files/postgresql.confd b/srcpkgs/postgresql/files/postgresql.confd new file mode 100644 index 00000000000..efacaf595a7 --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql.confd @@ -0,0 +1,54 @@ +# Configuration file for the PostgreSQL server. +# +# PostgreSQL's Database Directory +PGDATA="/var/lib/postgresql/data" + +# PostgreSQL User +PGUSER="postgres" + +# PostgreSQL Group +PGGROUP="postgres" + +# Extra options to run postmaster with, e.g.: +# -N is the maximal number of client connections +# -B is the number of shared buffers and has to be at least 2x the value for -N +# Please read the man-page to postmaster for more options. Many of these options +# can be set directly in the configuration-file. +#PGOPTS="-N 512 -B 1024" + + +# SERVER SHUTDOWN: +# The server will receive 3 signals in the worst case: +# 1. SIGTERM +# This signals the server to ignore new connections and to +# wait for all clients to end their transactions before shutting down. +# Use WAIT_FOR_DISCONNECT to control how much time the clients +# should have until the next signal is being sent. +# 2. SIGINT +# Tell the server to forcefully disconnect all clients. +# Terminating a client results in a rollback of the open transactions for this client. +# Use WAIT_FOR_CLEANUP to determine how much time the server has +# for cleanup. +# 3. SIGQUIT +# This will terminate the server immediately and results in a recovery run for the next start. + +# Wait for clients to disconnect +WAIT_FOR_DISCONNECT=30 + +# Time the server has to clean up +WAIT_FOR_CLEANUP=60 + +# Time the server has to quit (with a recover-run on next startup) +# Set to 0 to deactivate it +WAIT_FOR_QUIT=60 + +# Comment this out if you don't want to wait for the server to +# startup before continuing. For example, if this server is a +# PITR log shipping based replication standby +WAIT_FOR_START="-w" + +# If you have to export environment variables for the database process, +# this can be done here. +# +# Example: +# export R_HOME="/usr/lib/R" diff --git a/srcpkgs/postgresql/files/postgresql.rc b/srcpkgs/postgresql/files/postgresql.rc new file mode 100644 index 00000000000..36da5f3b9c9 --- /dev/null +++ b/srcpkgs/postgresql/files/postgresql.rc @@ -0,0 +1,106 @@ +#!/sbin/runscript +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.4,v 1.4 2010/01/26 22:01:21 patrick Exp $ + +opts="${opts} reload" + +depend() +{ + use net + provide postgresql +} + +checkconfig() +{ + if [ ! -d "$PGDATA" ] ; then + eerror "Directory not found: $PGDATA" + eerror "Please make sure that PGDATA points to the right path." + return 1 + fi +} + +start() +{ + checkconfig || return 1 + + ebegin "Starting PostgreSQL" + + if [ -f "$PGDATA/postmaster.pid" ] ; then + rm -f "$PGDATA/postmaster.pid" + fi + + local retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" ${PG_EXTRA_ENV} pg_ctl \ + start ${WAIT_FOR_START} -o '--silent-mode=true ${PGOPTS}'" + retval=$? + [ $retval -ne 0 ] && eend $retval && return $retval + + # The following is to catch the case of an already running server + # in which pg_ctl doesn't know to which server it connected to and + # false reports the server as 'up' + sleep 2 + if [ ! -f "$PGDATA/postmaster.pid" ] ; then + eerror "The pid-file doesn't exist but pg_ctl reported \ +a running server." + eerror "Please check whether there is another server running \ +on the same port or read the log-file." + eend 1 + return 1 + fi + + local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + ps -p "${pid}" &> /dev/null + eend $? +} + +stop() +{ + ebegin "Stopping PostgreSQL (this can take up to \ +$(( ${WAIT_FOR_DISCONNECT} + ${WAIT_FOR_CLEANUP} )) seconds)" + + local retval + + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" pg_ctl \ + stop -t ${WAIT_FOR_DISCONNECT} -m smart" + + retval=$? + [ $retval -eq 0 ] && eend $retval && return $retval + + ewarn "Some clients did not disconnect within \ +${WAIT_FOR_DISCONNECT} seconds." + ewarn "Going to shutdown the server anyway." + + su -l ${PGUSER} -c "env PGDATA=\"${PGDATA}\" pg_ctl stop -m fast" + retval=$? + [ $retval -eq 0 ] && eend $retval && return $retval + + if [ ${WAIT_FOR_QUIT} -eq 0 ] ; then + eerror "Server did not shut down and sending the \ +SIGQUIT has been disabled." + eend $retval + return $retval + fi + + ewarn "Shutting down the server gracefully failed." + ewarn "Forcing it to shutdown which leads to a recover-run \ +on next startup." + + su -l ${PGUSER} -c "env PGDATA=\"${PGDATA}\" pg_ctl stop -m immediate" + retval=$? + [ $retval -eq 0 ] && eend $retval && return $retval + + eerror "Forced shutdown failed!!! Something is wrong with your \ +system, please take care of it manually." + eend $? +} + +reload() +{ + ebegin "Reloading PostgreSQL configuration" + su -l ${PGUSER} -c "env PGDATA=\"${PGDATA}\" pg_ctl reload" + eend $? +} diff --git a/srcpkgs/postgresql/postgresql-client.template b/srcpkgs/postgresql/postgresql-client.template new file mode 100644 index 00000000000..7777f25af1c --- /dev/null +++ b/srcpkgs/postgresql/postgresql-client.template @@ -0,0 +1,43 @@ +# Template file for 'postgresql-client'. +# +short_desc="Client frontends programs for PostgreSQL" +long_desc="${long_desc} + + This package contains client and administrative programs for PostgreSQL: + these are the interactive terminal client psql and programs for creating + and removing users and databases. + + This is the client package for PostgreSQL 8.4. If you install PostgreSQL + 8.4 on a standalone machine, you need the server package postgresql, too. + On a network, you can install this package on many client machines, while + the server package may be installed on only one machine." + +Add_dependency run glibc +Add_dependency run zlib +Add_dependency run openssl +Add_dependency run readline +Add_dependency run postgresql-libs + +do_install() +{ + mkdir -p ${DESTDIR}/usr/bin ${DESTDIR}/usr/share/man/man1 \ + ${DESTDIR}/usr/share/postgresql + + for f in clusterdb createdb createlang createuser dropdb droplang \ + dropuser pg_dump pg_dumpall pg_restore psql reindexdb \ + vacuumdb; do + mv ${SRCPKGDESTDIR}/usr/bin/${f} ${DESTDIR}/usr/bin + mv ${SRCPKGDESTDIR}/usr/share/man/man1/${f}.1 \ + ${DESTDIR}/usr/share/man/man1 + done + mv ${SRCPKGDESTDIR}/usr/share/man/man7 ${DESTDIR}/usr/share/man + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name pgscripts\* -o \ + -name psql\* -o \ + -name pg_dump\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done + mv ${SRCPKGDESTDIR}/usr/share/postgresql/psqlrc.* \ + ${DESTDIR}/usr/share/postgresql +} diff --git a/srcpkgs/postgresql/postgresql-doc.template b/srcpkgs/postgresql/postgresql-doc.template new file mode 100644 index 00000000000..fc384a0c4f9 --- /dev/null +++ b/srcpkgs/postgresql/postgresql-doc.template @@ -0,0 +1,15 @@ +# Template file for 'postgresql-doc'. +# +short_desc="${sourcepkg} documentation" +long_desc="${long_desc} + + This package contains all README files, user manual, and examples for + PostgreSQL 8.4. The manual is in HTML format." + +noarch=yes + +do_install() +{ + mkdir -p ${DESTDIR}/usr/share + mv ${SRCPKGDESTDIR}/usr/share/doc ${DESTDIR}/usr/share +} diff --git a/srcpkgs/postgresql/postgresql-libs-devel.template b/srcpkgs/postgresql/postgresql-libs-devel.template new file mode 100644 index 00000000000..399f17e3641 --- /dev/null +++ b/srcpkgs/postgresql/postgresql-libs-devel.template @@ -0,0 +1,30 @@ +# Template file for 'postgresql-libs-devel'. +# +short_desc="PostgreSQL shared libraries (development files)" +long_desc="${long_desc} + + This package provides the development files required to build any + PostgreSQL application." + +Add_dependency run glibc +Add_dependency run postgresql-libs + +do_install() +{ + mkdir -p ${DESTDIR}/usr/lib/postgresql ${DESTDIR}/usr/bin \ + ${DESTDIR}/usr/share/man/man1 + for f in pg_config ecpg; do + mv ${SRCPKGDESTDIR}/usr/bin/${f} ${DESTDIR}/usr/bin + mv ${SRCPKGDESTDIR}/usr/share/man/man1/${f}* \ + ${DESTDIR}/usr/share/man/man1 + done + mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr + mv ${SRCPKGDESTDIR}/usr/lib/*.{a,so} ${DESTDIR}/usr/lib + mv ${SRCPKGDESTDIR}/usr/lib/postgresql/pgxs \ + ${DESTDIR}/usr/lib/postgresql + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name pg_config\* -o -name ecpg\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done +} diff --git a/srcpkgs/postgresql/postgresql-libs.template b/srcpkgs/postgresql/postgresql-libs.template new file mode 100644 index 00000000000..625ea411c4e --- /dev/null +++ b/srcpkgs/postgresql/postgresql-libs.template @@ -0,0 +1,20 @@ +# Template file for 'postgresql-libs'. +# +short_desc="PostgreSQL shared libraries" +long_desc="${long_desc} + + This package provides the shared libraries used by PostgreSQL applications." + +Add_dependency run glibc +Add_dependency run openssl + +do_install() +{ + mkdir -p ${DESTDIR}/usr/lib + mv ${SRCPKGDESTDIR}/usr/lib/*.so.* ${DESTDIR}/usr/lib + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name libpq5\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done +} diff --git a/srcpkgs/postgresql/postgresql-plperl.template b/srcpkgs/postgresql/postgresql-plperl.template new file mode 100644 index 00000000000..42fe1972179 --- /dev/null +++ b/srcpkgs/postgresql/postgresql-plperl.template @@ -0,0 +1,24 @@ +# Template file for 'postgresql-plperl'. +# +short_desc="PL/Perl procedural language for PostgreSQL" +long_desc="${long_desc} + + PL/Tcl enables an SQL developer to write procedural language functions for + PostgreSQL 8.4 in Perl. You need this package if you have any PostgreSQL 8.4 + functions that use the languages plperl or plperlu." + +Add_dependency run glibc +Add_dependency run postgresql +Add_dependency run perl + +do_install() +{ + mkdir -p ${DESTDIR}/usr/lib/postgresql + mv ${SRCPKGDESTDIR}/usr/lib/postgresql/plperl* \ + ${DESTDIR}/usr/lib/postgresql + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name plperl\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done +} diff --git a/srcpkgs/postgresql/postgresql-plpython.template b/srcpkgs/postgresql/postgresql-plpython.template new file mode 100644 index 00000000000..eebdb312b40 --- /dev/null +++ b/srcpkgs/postgresql/postgresql-plpython.template @@ -0,0 +1,24 @@ +# Template file for 'postgresql-plpython'. +# +short_desc="PL/Python procedural language for PostgreSQL" +long_desc="${long_desc} + + PL/Tcl enables an SQL developer to write procedural language functions for + PostgreSQL 8.4 in Python. You need this package if you have any PostgreSQL 8.4 + functions that use the languages plpython or plpythonu." + +Add_dependency run glibc +Add_dependency run postgresql +Add_dependency run python + +do_install() +{ + mkdir -p ${DESTDIR}/usr/lib/postgresql + mv ${SRCPKGDESTDIR}/usr/lib/postgresql/plpython* \ + ${DESTDIR}/usr/lib/postgresql + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name plpython\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done +} diff --git a/srcpkgs/postgresql/postgresql-pltcl.template b/srcpkgs/postgresql/postgresql-pltcl.template new file mode 100644 index 00000000000..51bfd4e83a3 --- /dev/null +++ b/srcpkgs/postgresql/postgresql-pltcl.template @@ -0,0 +1,29 @@ +# Template file for 'postgresql-pltcl'. +# +short_desc="PL/Tcl procedural language for PostgreSQL" +long_desc="${long_desc} + + PL/Tcl enables an SQL developer to write procedural language functions for + PostgreSQL 8.4 in Tcl. You need this package if you have any PostgreSQL 8.4 + functions that use the languages pltcl or pltclu." + +Add_dependency run glibc +Add_dependency run postgresql +Add_dependency run tcl + +do_install() +{ + mkdir -p ${DESTDIR}/usr/bin ${DESTDIR}/usr/lib/postgresql \ + ${DESTDIR}/usr/share/postgresql + + mv ${SRCPKGDESTDIR}/usr/bin/pltcl* ${DESTDIR}/usr/bin + mv ${SRCPKGDESTDIR}/usr/lib/postgresql/pltcl* \ + ${DESTDIR}/usr/lib/postgresql + for d in $(find ${SRCPKGDESTDIR}/usr/share/locale \ + -type f -name pltcl\*); do + mkdir -p ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + mv ${d} ${DESTDIR}/$(dirname ${d#${SRCPKGDESTDIR}}) + done + mv ${SRCPKGDESTDIR}/usr/share/postgresql/*.pltcl \ + ${DESTDIR}/usr/share/postgresql +} diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template new file mode 100644 index 00000000000..4b013bb79b2 --- /dev/null +++ b/srcpkgs/postgresql/template @@ -0,0 +1,57 @@ +# Template file for 'postgresql' +pkgname=postgresql +version=8.4.2 +distfiles="ftp://ftp.postgresql.org/pub/source/v${version}/${pkgname}-${version}.tar.bz2" +build_style=gnu_configure +configure_args="--with-docdir=/usr/share/doc --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 +--with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-gnu-ld" +short_desc="Sophisticated open-source Object-Relational DBMS" +maintainer="Juan RP " +checksum=adb3c5c90396195d76e986f835c2bd0e0dad438f91f4dc2b62048caf6d9869f2 +long_desc=" + PostgreSQL is a powerful, open source object-relational database system. + It has more than 15 years of active development and a proven architecture + that has earned it a strong reputation for reliability, data integrity, + and correctness." + +subpackages="${pkgname}-doc ${pkgname}-libs ${pkgname}-libs-devel" +subpackages="${subpackages} ${pkgname}-plperl ${pkgname}-plpython" +subpackages="${subpackages} ${pkgname}-pltcl ${pkgname}-client" + +conf_files="/etc/conf.d/postgresql" + +# Create 'postgres' user for the server. +system_accounts="postgres" +postgres_homedir="/var/lib/postgresql" +postgres_shell="/bin/sh" +postgres_descr="PostgreSQL database server user" + +# Add the OpenRC service. +openrc_services="postgresql default" + +Add_dependency run glibc +Add_dependency run pam +Add_dependency run openssl +Add_dependency run libxml2 +Add_dependency run postgresql-libs + +Add_dependency build gettext +Add_dependency build perl +Add_dependency build tcl-devel +Add_dependency build python-devel +Add_dependency build openssl-devel +Add_dependency build zlib-devel +Add_dependency build libxml2-devel +Add_dependency build pam-devel +Add_dependency build readline-devel + +post_install() +{ + install -D -m644 ${FILESDIR}/postgresql.confd \ + ${DESTDIR}/etc/conf.d/postgresql + install -D -m755 ${FILESDIR}/postgresql.rc \ + ${DESTDIR}/etc/init.d/postgresql +} diff --git a/xbps-src/common/mapping_shlib_binpkg.txt b/xbps-src/common/mapping_shlib_binpkg.txt index 766bbe20267..f14808b3c83 100644 --- a/xbps-src/common/mapping_shlib_binpkg.txt +++ b/xbps-src/common/mapping_shlib_binpkg.txt @@ -476,3 +476,7 @@ libstrigihtmlgui.so strigi strigi-devel libstreams.so strigi strigi-devel libstrigiqtdbusclient.so strigi strigi-devel libclucene.so clucene clucene-devel +libecpg_compat.so postgresql-libs postgresql-libs-devel +libecpg.so postgresql-libs postgresql-libs-devel +libpgtypes.so postgresql-libs postgresql-libs-devel +libpq.so postgresql-libs postgresql-libs-devel