diff options
author | Aaron W. Swenson <titanofold@gentoo.org> | 2012-08-14 19:50:17 +0000 |
---|---|---|
committer | Aaron W. Swenson <titanofold@gentoo.org> | 2012-08-14 19:50:17 +0000 |
commit | 0dc7c10cb488020d3246a6e1a86444aa493b08d2 (patch) | |
tree | 97a63596389172158482260cd234773ea0d350b1 /dev-db | |
parent | Version bump. Drop old version. (diff) | |
download | gentoo-2-0dc7c10cb488020d3246a6e1a86444aa493b08d2.tar.gz gentoo-2-0dc7c10cb488020d3246a6e1a86444aa493b08d2.tar.bz2 gentoo-2-0dc7c10cb488020d3246a6e1a86444aa493b08d2.zip |
More complete ebuild and initialization script. Now downloads the correct tarball fixing bug 423639.
(Portage version: 2.1.10.65/cvs/Linux x86_64)
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/pgpool2/ChangeLog | 11 | ||||
-rw-r--r-- | dev-db/pgpool2/files/pgpool2.confd | 17 | ||||
-rw-r--r-- | dev-db/pgpool2/files/pgpool2.initd | 76 | ||||
-rw-r--r-- | dev-db/pgpool2/files/pgpool_run_paths.patch | 180 | ||||
-rw-r--r-- | dev-db/pgpool2/metadata.xml | 5 | ||||
-rw-r--r-- | dev-db/pgpool2/pgpool2-3.0.4.ebuild | 75 | ||||
-rw-r--r-- | dev-db/pgpool2/pgpool2-3.0.7.ebuild | 77 | ||||
-rw-r--r-- | dev-db/pgpool2/pgpool2-3.1.3.ebuild | 77 | ||||
-rw-r--r-- | dev-db/pgpool2/pgpool2-3.2.0-r1.ebuild | 113 | ||||
-rw-r--r-- | dev-db/pgpool2/pgpool2-3.2.0.ebuild | 77 |
10 files changed, 385 insertions, 323 deletions
diff --git a/dev-db/pgpool2/ChangeLog b/dev-db/pgpool2/ChangeLog index 8dddd837b496..9ec68d7d77e8 100644 --- a/dev-db/pgpool2/ChangeLog +++ b/dev-db/pgpool2/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-db/pgpool2 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/ChangeLog,v 1.10 2012/08/04 12:57:24 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/ChangeLog,v 1.11 2012/08/14 19:50:17 titanofold Exp $ + +*pgpool2-3.2.0-r1 (14 Aug 2012) + + 14 Aug 2012; Aaron W. Swenson <titanofold@gentoo.org> +files/pgpool2.confd, + -pgpool2-3.0.4.ebuild, -pgpool2-3.0.7.ebuild, -pgpool2-3.1.3.ebuild, + -pgpool2-3.2.0.ebuild, +pgpool2-3.2.0-r1.ebuild, + +files/pgpool_run_paths.patch, files/pgpool2.initd, metadata.xml: + More complete ebuild and initialization script. Now downloads the correct + tarball fixing bug 423639. *pgpool2-3.2.0 (04 Aug 2012) diff --git a/dev-db/pgpool2/files/pgpool2.confd b/dev-db/pgpool2/files/pgpool2.confd new file mode 100644 index 000000000000..b2dd2a69e02e --- /dev/null +++ b/dev-db/pgpool2/files/pgpool2.confd @@ -0,0 +1,17 @@ +# NICE_QUIT ignores new connections and wait for clients to disconnect from +# server before shutting down. NICE_TIMEOUT in seconds determines how long to +# wait for this to succeed. +NICE_TIMEOUT=60 + +# Forecfully disconnect clients from server and shut down. This is performed +# after NICE_QUIT. Terminated client connections have their open transactions +# rolled back. +# Set RUDE_QUIT to "NO" to disable. RUDE_TIMEOUT in seconds. +RUDE_QUIT="YES" +RUDE_TIMEOUT=30 + +# If the server still fails to shutdown, you can force it to quit by setting +# this to YES. +# Set FORCE_QUIT to "YES" to enable. FORCE_TIMEOUT in seconds. +FORCE_QUIT="NO" +FORCE_TIMEOUT=2
\ No newline at end of file diff --git a/dev-db/pgpool2/files/pgpool2.initd b/dev-db/pgpool2/files/pgpool2.initd index 20f7ca2d6a3c..9b1864239cea 100644 --- a/dev-db/pgpool2/files/pgpool2.initd +++ b/dev-db/pgpool2/files/pgpool2.initd @@ -1,29 +1,75 @@ #!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/files/pgpool2.initd,v 1.2 2011/03/02 08:52:52 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/files/pgpool2.initd,v 1.3 2012/08/14 19:50:17 titanofold Exp $ + +extra_started_commands="reload" + +CONFIGFILE="/etc/pgpool2/pgpool.conf" +LOGFILE="/var/log/pgpool2.log" +PIDFILE="" depend() { - need net + use net + use postgresql } -ARGS="-f /etc/pgpool2/pgpool.conf -a /etc/pgpool2/pool_hba.conf -F /etc/pgpool2/pcp.conf -D" -LOGFILE="/var/log/pgpool2.log" +get_config() { + [ -f ${CONFIGFILE} ] || return 1 + + eval echo $(sed -e 's:#.*::' ${CONFIGFILE} | \ + awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }') +} + +PIDFILE="$(get_config pid_file_name)" + +prep() { + checkpath -o pgpool:postgres -m 0770 -d $(dirname ${PIDFILE}) || return 1 + checkpath -o pgpool:postgres -m 0770 -d $(get_config logdir) || return 1 + checkpath -o pgpool:postgres -m 0660 -f ${LOGFILE} || return 1 + checkpath -o postgres:postgres -m 0770 -d $(get_config socket_dir) || return 1 + checkpath -o postgres:postgres -m 0770 -d $(get_config pcp_socket_dir) || return 1 +} start() { - ebegin "Starting pgpool2" - /usr/bin/pgpool ${ARGS} >> "${LOGFILE}" 2>&1 - eend $? + prep || return 1 + + ebegin "Starting pgpool2" + + start-stop-daemon --start \ + --user pgpool:postgres \ + --pidfile ${PIDFILE} \ + --exec /usr/bin/pgpool + + eend } stop() { - ebegin "Stopping pgpool2" - /usr/bin/pgpool -m fast stop >> "${LOGFILE}" 2>&1 - eend $? + local seconds=$(( ${NICE_TIMEOUT} + ${RUDE_TIMEOUT} + ${FORCE_TIMEOUT} )) + ebegin "Stopping pgpool (this can take up to ${seconds} seconds)" + + local retval + local retries=SIGTERM/${NICE_TIMEOUT} + + if [ "${RUDE_QUIT}" != "NO" ] ; then + einfo "RUDE_QUIT enabled." + retries="${retries}/SIGINT/${RUDE_TIMEOUT}" + fi + if [ "${FORCE_QUIT}" = "YES" ] ; then + einfo "FORCE_QUIT enabled." + ewarn "A recover-run might be executed on next startup." + retries="${retries}/SIGQUIT/${FORCE_TIMEOUT}" + fi + + # Loops through nice, rude, and force quit in one go. + start-stop-daemon --stop \ + --pidfile ${PIDFILE} \ + --retry ${retries} + + eend } -restart() { - svc_stop - sleep 3 - svc_start +reload() { + start-stop-daemon --signal HUP \ + --pidfile ${PIDFILE} } diff --git a/dev-db/pgpool2/files/pgpool_run_paths.patch b/dev-db/pgpool2/files/pgpool_run_paths.patch new file mode 100644 index 000000000000..a1912af15e4c --- /dev/null +++ b/dev-db/pgpool2/files/pgpool_run_paths.patch @@ -0,0 +1,180 @@ +diff -Naurw a/pgpool.conf.sample b/pgpool.conf.sample +--- a/pgpool.conf.sample 2012-07-19 03:06:21.000000000 -0400 ++++ b/pgpool.conf.sample 2012-08-14 07:33:39.200695855 -0400 +@@ -31,10 +31,8 @@ + port = 9999 + # Port number + # (change requires restart) +-socket_dir = '/tmp' ++socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + +@@ -43,10 +41,8 @@ + pcp_port = 9898 + # Port number for pcp + # (change requires restart) +-pcp_socket_dir = '/tmp' ++pcp_socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path for pcp +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + # - Backend Connection Settings - +@@ -176,10 +172,10 @@ + # FILE LOCATIONS + #------------------------------------------------------------------------------ + +-pid_file_name = '/var/run/pgpool/pgpool.pid' ++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid' + # PID file name + # (change requires restart) +-logdir = '/tmp' ++logdir = '@PGPOOL_SOCKETDIR@' + # Directory of pgPool status file + # (change requires restart) + +diff -Naurw a/pgpool.conf.sample-master-slave b/pgpool.conf.sample-master-slave +--- a/pgpool.conf.sample-master-slave 2012-07-16 22:56:37.000000000 -0400 ++++ b/pgpool.conf.sample-master-slave 2012-08-14 07:33:39.201695842 -0400 +@@ -31,10 +31,8 @@ + port = 9999 + # Port number + # (change requires restart) +-socket_dir = '/tmp' ++socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + +@@ -43,10 +41,8 @@ + pcp_port = 9898 + # Port number for pcp + # (change requires restart) +-pcp_socket_dir = '/tmp' ++pcp_socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path for pcp +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + # - Backend Connection Settings - +@@ -176,10 +172,10 @@ + # FILE LOCATIONS + #------------------------------------------------------------------------------ + +-pid_file_name = '/var/run/pgpool/pgpool.pid' ++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid' + # PID file name + # (change requires restart) +-logdir = '/tmp' ++logdir = '@PGPOOL_SOCKETDIR@' + # Directory of pgPool status file + # (change requires restart) + +diff -Naurw a/pgpool.conf.sample-replication b/pgpool.conf.sample-replication +--- a/pgpool.conf.sample-replication 2012-07-16 22:56:37.000000000 -0400 ++++ b/pgpool.conf.sample-replication 2012-08-14 07:33:39.202695830 -0400 +@@ -31,10 +31,8 @@ + port = 9999 + # Port number + # (change requires restart) +-socket_dir = '/tmp' ++socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + +@@ -43,10 +41,8 @@ + pcp_port = 9898 + # Port number for pcp + # (change requires restart) +-pcp_socket_dir = '/tmp' ++pcp_socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path for pcp +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + # - Backend Connection Settings - +@@ -176,10 +172,10 @@ + # FILE LOCATIONS + #------------------------------------------------------------------------------ + +-pid_file_name = '/var/run/pgpool/pgpool.pid' ++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid' + # PID file name + # (change requires restart) +-logdir = '/tmp' ++logdir = '@PGPOOL_SOCKETDIR@' + # Directory of pgPool status file + # (change requires restart) + +diff -Naurw a/pgpool.conf.sample-stream b/pgpool.conf.sample-stream +--- a/pgpool.conf.sample-stream 2012-07-16 22:56:37.000000000 -0400 ++++ b/pgpool.conf.sample-stream 2012-08-14 07:33:39.203695818 -0400 +@@ -31,10 +31,8 @@ + port = 9999 + # Port number + # (change requires restart) +-socket_dir = '/tmp' ++socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + +@@ -43,10 +41,8 @@ + pcp_port = 9898 + # Port number for pcp + # (change requires restart) +-pcp_socket_dir = '/tmp' ++pcp_socket_dir = '@PGSQL_SOCKETDIR@' + # Unix domain socket path for pcp +- # The Debian package defaults to +- # /var/run/postgresql + # (change requires restart) + + # - Backend Connection Settings - +@@ -176,10 +172,10 @@ + # FILE LOCATIONS + #------------------------------------------------------------------------------ + +-pid_file_name = '/var/run/pgpool/pgpool.pid' ++pid_file_name = '@PGPOOL_SOCKETDIR@/pgpool.pid' + # PID file name + # (change requires restart) +-logdir = '/tmp' ++logdir = '@PGPOOL_SOCKETDIR@' + # Directory of pgPool status file + # (change requires restart) + +diff -Naurw a/pool.h b/pool.h +--- a/pool.h 2012-07-02 00:09:18.000000000 -0400 ++++ b/pool.h 2012-08-14 07:26:56.005764702 -0400 +@@ -61,13 +61,13 @@ + #define HBA_CONF_FILE_NAME "pool_hba.conf" + + /* pid file directory */ +-#define DEFAULT_LOGDIR "/tmp" ++#define DEFAULT_LOGDIR "@PGPOOL_SOCKETDIR@" + + /* Unix domain socket directory */ +-#define DEFAULT_SOCKET_DIR "/tmp" ++#define DEFAULT_SOCKET_DIR "@PGSQL_SOCKETDIR@" + + /* pid file name */ +-#define DEFAULT_PID_FILE_NAME "/var/run/pgpool/pgpool.pid" ++#define DEFAULT_PID_FILE_NAME "@PGPOOL_SOCKETDIR@/pgpool.pid" + + /* status file name */ + #define STATUS_FILE_NAME "pgpool_status" diff --git a/dev-db/pgpool2/metadata.xml b/dev-db/pgpool2/metadata.xml index d06e452b35af..d724a3dd009d 100644 --- a/dev-db/pgpool2/metadata.xml +++ b/dev-db/pgpool2/metadata.xml @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <herd>postgresql</herd> + <herd>postgresql</herd> + <use> + <flag name='memcached'>Use memcached for query caching.</flag> + </use> </pkgmetadata> diff --git a/dev-db/pgpool2/pgpool2-3.0.4.ebuild b/dev-db/pgpool2/pgpool2-3.0.4.ebuild deleted file mode 100644 index 9f216ea0da7a..000000000000 --- a/dev-db/pgpool2/pgpool2-3.0.4.ebuild +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-3.0.4.ebuild,v 1.2 2012/04/23 15:00:44 titanofold Exp $ - -EAPI=4 - -[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" - -ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool" -ECVS_MODULE="pgpool-II" -[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" -inherit base autotools ${SCM_ECLASS} -unset SCM_ECLASS - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="http://pgpool.projects.postgresql.org/" -[[ ${PV} == 9999 ]] || SRC_URI="http://pgfoundry.org/frs/download.php/3076/${MY_P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" -IUSE="pam ssl static-libs" - -RDEPEND=" - dev-db/postgresql-base - pam? ( sys-auth/pambase ) - ssl? ( dev-libs/openssl ) -" -DEPEND="${DEPEND} - sys-devel/bison - !!dev-db/pgpool -" - -AUTOTOOLS_IN_SOURCE_BUILD="1" - -DOCS=( - "NEWS" - "doc/where_to_send_queries.pdf" -) -HTML_DOCS=( - "doc/pgpool-en.html" - "doc/pgpool.css" - "doc/tutorial-en.html" -) - -S=${WORKDIR}/${MY_P} - -src_prepare() { - sed -i \ - -e 's:/tmp/:/var/run/postgresql:g' \ - pgpool.conf.sample pool.h || die - sed -i \ - -e '/ACLOCAL_AMFLAGS/ d' \ - Makefile.am || die - base_src_prepare - eautoreconf -} - -src_configure() { - econf \ - --sysconfdir="${EROOT}/etc/${PN}" \ - --disable-rpath \ - $(use_enable static-libs static) \ - $(use_with ssl openssl) \ - $(use_with pam) -} - -src_install() { - base_src_install - find "${ED}" -name '*.la' -exec rm -f {} + - # move misc data to proper folder - mv "${ED}/usr/share/${PN/2/-II}" "${ED}/usr/share/${PN}" || die - - newinitd "${FILESDIR}/${PN}.initd" ${PN} -} diff --git a/dev-db/pgpool2/pgpool2-3.0.7.ebuild b/dev-db/pgpool2/pgpool2-3.0.7.ebuild deleted file mode 100644 index 43b7108c1bdc..000000000000 --- a/dev-db/pgpool2/pgpool2-3.0.7.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-3.0.7.ebuild,v 1.1 2012/04/23 15:00:45 titanofold Exp $ - -EAPI=4 - -[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" - -ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool" -ECVS_MODULE="pgpool-II" -[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" -inherit base autotools ${SCM_ECLASS} -unset SCM_ECLASS - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="http://pgpool.projects.postgresql.org/" -[[ ${PV} == 9999 ]] || SRC_URI="http://pgfoundry.org/frs/download.php/3076/${MY_P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" -IUSE="pam ssl static-libs" - -RDEPEND=" - dev-db/postgresql-base - pam? ( sys-auth/pambase ) - ssl? ( dev-libs/openssl ) -" -DEPEND="${DEPEND} - sys-devel/bison - !!dev-db/pgpool -" - -AUTOTOOLS_IN_SOURCE_BUILD="1" - -DOCS=( - "NEWS" - "doc/where_to_send_queries.pdf" -) -HTML_DOCS=( - "doc/pgpool-en.html" - "doc/pgpool.css" - "doc/tutorial-en.html" -) - -# Those turkeys didn't update the directory name!' -#S=${WORKDIR}/${MY_P} -S="${WORKDIR}/pgpool-II-3.0.4" - -src_prepare() { - sed -i \ - -e 's:/tmp/:/var/run/postgresql:g' \ - pgpool.conf.sample pool.h || die - sed -i \ - -e '/ACLOCAL_AMFLAGS/ d' \ - Makefile.am || die - base_src_prepare - eautoreconf -} - -src_configure() { - econf \ - --sysconfdir="${EROOT}/etc/${PN}" \ - --disable-rpath \ - $(use_enable static-libs static) \ - $(use_with ssl openssl) \ - $(use_with pam) -} - -src_install() { - base_src_install - find "${ED}" -name '*.la' -exec rm -f {} + - # move misc data to proper folder - mv "${ED}/usr/share/${PN/2/-II}" "${ED}/usr/share/${PN}" || die - - newinitd "${FILESDIR}/${PN}.initd" ${PN} -} diff --git a/dev-db/pgpool2/pgpool2-3.1.3.ebuild b/dev-db/pgpool2/pgpool2-3.1.3.ebuild deleted file mode 100644 index c3405a15379b..000000000000 --- a/dev-db/pgpool2/pgpool2-3.1.3.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-3.1.3.ebuild,v 1.1 2012/04/23 15:00:45 titanofold Exp $ - -EAPI=4 - -[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" - -ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool" -ECVS_MODULE="pgpool-II" -[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" -inherit base autotools ${SCM_ECLASS} -unset SCM_ECLASS - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="http://pgpool.projects.postgresql.org/" -[[ ${PV} == 9999 ]] || SRC_URI="http://pgfoundry.org/frs/download.php/3076/${MY_P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" -IUSE="pam ssl static-libs" - -RDEPEND=" - dev-db/postgresql-base - pam? ( sys-auth/pambase ) - ssl? ( dev-libs/openssl ) -" -DEPEND="${DEPEND} - sys-devel/bison - !!dev-db/pgpool -" - -AUTOTOOLS_IN_SOURCE_BUILD="1" - -DOCS=( - "NEWS" - "doc/where_to_send_queries.pdf" -) -HTML_DOCS=( - "doc/pgpool-en.html" - "doc/pgpool.css" - "doc/tutorial-en.html" -) - -# Those turkeys didn't update the directory name!' -#S=${WORKDIR}/${MY_P} -S="${WORKDIR}/pgpool-II-3.0.4" - -src_prepare() { - sed -i \ - -e 's:/tmp/:/var/run/postgresql:g' \ - pgpool.conf.sample pool.h || die - sed -i \ - -e '/ACLOCAL_AMFLAGS/ d' \ - Makefile.am || die - base_src_prepare - eautoreconf -} - -src_configure() { - econf \ - --sysconfdir="${EROOT}/etc/${PN}" \ - --disable-rpath \ - $(use_enable static-libs static) \ - $(use_with ssl openssl) \ - $(use_with pam) -} - -src_install() { - base_src_install - find "${ED}" -name '*.la' -exec rm -f {} + - # move misc data to proper folder - mv "${ED}/usr/share/${PN/2/-II}" "${ED}/usr/share/${PN}" || die - - newinitd "${FILESDIR}/${PN}.initd" ${PN} -} diff --git a/dev-db/pgpool2/pgpool2-3.2.0-r1.ebuild b/dev-db/pgpool2/pgpool2-3.2.0-r1.ebuild new file mode 100644 index 000000000000..e44fade1be67 --- /dev/null +++ b/dev-db/pgpool2/pgpool2-3.2.0-r1.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-3.2.0-r1.ebuild,v 1.1 2012/08/14 19:50:17 titanofold Exp $ + +EAPI=4 + +[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" + +ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool" +ECVS_MODULE="pgpool-II" +[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" +inherit base autotools ${SCM_ECLASS} +unset SCM_ECLASS + +DESCRIPTION="Connection pool server for PostgreSQL" +HOMEPAGE="http://www.pgpool.net/" +[[ ${PV} == 9999 ]] || SRC_URI="http://www.pgpool.net/download.php?f=${MY_P}.tar.gz -> ${MY_P}.tar.gz" +LICENSE="BSD" +SLOT="0" +[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" +IUSE="memcached pam ssl static-libs" + +RDEPEND=" + dev-db/postgresql-base + memcached? ( dev-libs/libmemcached ) + pam? ( sys-auth/pambase ) + ssl? ( dev-libs/openssl ) +" +DEPEND="${RDEPEND} + sys-devel/bison + !!dev-db/pgpool +" + +AUTOTOOLS_IN_SOURCE_BUILD="1" + +S=${WORKDIR}/${MY_P} + +pkg_setup() { + enewgroup postgres 70 + enewuser pgpool -1 -1 -1 postgres + + # We need the postgres user as well so we can set the proper + # permissions on the sockets without getting into fights with + # PostgreSQL's initialization scripts. + enewuser postgres 70 /bin/bash /var/lib/postgresql postgres +} + +src_prepare() { + epatch "${FILESDIR}/pgpool_run_paths.patch" + + local pg_config_manual="$(pg_config --includedir)/pg_config_manual.h" + local pgsql_socket_dir=$(grep DEFAULT_PGSOCKET_DIR "${pg_config_manual}" | \ + sed 's|.*\"\(.*\)\"|\1|g') + local pgpool_socket_dir="$(dirname $pgsql_socket_dir)/pgpool" + + sed "s|@PGSQL_SOCKETDIR@|${pgsql_socket_dir}|g" \ + -i *.conf.sample* pool.h || die + + sed "s|@PGPOOL_SOCKETDIR@|${pgpool_socket_dir}|g" \ + -i *.conf.sample* pool.h || die +} + +src_configure() { + local myconf + use memcached && \ + myconf="--with-memcached=\"${EROOT%/}/usr/include/libmemcached\"" + + econf \ + --disable-rpath \ + --sysconfdir="${EROOT%/}/etc/${PN}" \ + $(use_with pam) \ + $(use_with ssl openssl) \ + $(use_enable static-libs static) \ + ${myconf} +} + +src_compile() { + emake + + cd sql + emake +} + +src_install() { + emake DESTDIR="${D}" install + + cd sql + emake DESTDIR="${D}" install + cd "${S}" + + # `contrib' moved to `extension' with PostgreSQL 9.1 + local pgslot=$(postgresql-config show) + if [[ ${pgslot//.} > 90 ]] ; then + cd "${ED%/}$(pg_config --sharedir)" + mv contrib extension || die + cd "${S}" + fi + + newinitd "${FILESDIR}/${PN}.initd" ${PN} + newconfd "${FILESDIR}/${PN}.confd" ${PN} + + # Documentation + dodoc NEWS TODO doc/where_to_send_queries.{pdf,odg} + dohtml -r doc + + # Examples and extras + insinto "/usr/share/${PN}" + doins doc/{pgpool_remote_start,basebackup.sh,recovery.conf.sample} + mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die + + # One more thing: Evil la files! + find "${ED}" -name '*.la' -exec rm -f {} + +} diff --git a/dev-db/pgpool2/pgpool2-3.2.0.ebuild b/dev-db/pgpool2/pgpool2-3.2.0.ebuild deleted file mode 100644 index 8a04b79cf8e3..000000000000 --- a/dev-db/pgpool2/pgpool2-3.2.0.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/pgpool2/pgpool2-3.2.0.ebuild,v 1.1 2012/08/04 12:57:24 patrick Exp $ - -EAPI=4 - -[[ ${PV} == 9999 ]] && MY_P=${PN/2/-II} || MY_P="${PN/2/-II}-${PV}" - -ECVS_SERVER="cvs.pgfoundry.org:/cvsroot/pgpool" -ECVS_MODULE="pgpool-II" -[[ ${PV} == 9999 ]] && SCM_ECLASS="cvs" -inherit base autotools ${SCM_ECLASS} -unset SCM_ECLASS - -DESCRIPTION="Connection pool server for PostgreSQL" -HOMEPAGE="http://pgpool.projects.postgresql.org/" -[[ ${PV} == 9999 ]] || SRC_URI="http://pgfoundry.org/frs/download.php/3076/${MY_P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -[[ ${PV} == 9999 ]] || KEYWORDS="~amd64 ~x86" -IUSE="pam ssl static-libs" - -RDEPEND=" - dev-db/postgresql-base - pam? ( sys-auth/pambase ) - ssl? ( dev-libs/openssl ) -" -DEPEND="${DEPEND} - sys-devel/bison - !!dev-db/pgpool -" - -AUTOTOOLS_IN_SOURCE_BUILD="1" - -DOCS=( - "NEWS" - "doc/where_to_send_queries.pdf" -) -HTML_DOCS=( - "doc/pgpool-en.html" - "doc/pgpool.css" - "doc/tutorial-en.html" -) - -# Those turkeys didn't update the directory name!' -#S=${WORKDIR}/${MY_P} -S="${WORKDIR}/pgpool-II-3.0.4" - -src_prepare() { - sed -i \ - -e 's:/tmp/:/var/run/postgresql:g' \ - pgpool.conf.sample pool.h || die - sed -i \ - -e '/ACLOCAL_AMFLAGS/ d' \ - Makefile.am || die - base_src_prepare - eautoreconf -} - -src_configure() { - econf \ - --sysconfdir="${EROOT}/etc/${PN}" \ - --disable-rpath \ - $(use_enable static-libs static) \ - $(use_with ssl openssl) \ - $(use_with pam) -} - -src_install() { - base_src_install - find "${ED}" -name '*.la' -exec rm -f {} + - # move misc data to proper folder - mv "${ED}/usr/share/${PN/2/-II}" "${ED}/usr/share/${PN}" || die - - newinitd "${FILESDIR}/${PN}.initd" ${PN} -} |