OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 15-Dec-2007 10:33:57
Branch: HEAD Handle: 2007121509335600
Added files:
openpkg-src/pgpool2 pgpool2.patch pgpool2.spec rc.pgpool2
Log:
new package: pgpool2 2.0.1 (PostgreSQL Connection Pooling (version
II))
Summary:
Revision Changes Path
1.1 +12 -0 openpkg-src/pgpool2/pgpool2.patch
1.1 +134 -0 openpkg-src/pgpool2/pgpool2.spec
1.1 +81 -0 openpkg-src/pgpool2/rc.pgpool2
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/pgpool2/pgpool2.patch
============================================================================
$ cvs diff -u -r0 -r1.1 pgpool2.patch
--- /dev/null 2007-12-15 10:33:43 +0100
+++ pgpool2.patch 2007-12-15 10:33:56 +0100
@@ -0,0 +1,12 @@
+Index: Makefile.in
+--- Makefile.in.orig 2007-11-21 11:14:16 +0100
++++ Makefile.in 2007-12-15 10:29:38 +0100
+@@ -18,7 +18,7 @@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+ VPATH = @srcdir@
+-pkgdatadir = $(datadir)/@PACKAGE@
++pkgdatadir = $(datadir)/pgpool
+ pkglibdir = $(libdir)/@PACKAGE@
+ pkgincludedir = $(includedir)/@PACKAGE@
+ top_builddir = .
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/pgpool2/pgpool2.spec
============================================================================
$ cvs diff -u -r0 -r1.1 pgpool2.spec
--- /dev/null 2007-12-15 10:33:43 +0100
+++ pgpool2.spec 2007-12-15 10:33:57 +0100
@@ -0,0 +1,134 @@
+##
+## pgpool2.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package versions
+%define V_pgpool 2.0.1
+%define V_pgpool_dir 1521
+
+# package information
+Name: pgpool2
+Summary: PostgreSQL Connection Pooling (version II)
+URL: http://pgpool.projects.postgresql.org/
+Vendor: Tatsuo Ishii
+Packager: OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class: PLUS
+Group: Database
+License: GPL
+Version: %{V_pgpool}
+Release: 20071215
+
+# list of sources
+Source0:
http://pgfoundry.org/frs/download.php/%{V_pgpool_dir}/pgpool-II-%{V_pgpool}.tar.gz
+Source1: rc.pgpool2
+Patch0: pgpool2.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20060823, make
+PreReq: OpenPKG, openpkg >= 20060823
+BuildPreReq: postgresql, openssl, getopt
+PreReq: postgresql, openssl, getopt
+AutoReq: no
+AutoReqProv: no
+
+%description
+ PGPool is a connection pool server for PostgreSQL. PGPool runs
+ between PostgreSQL's clients (front ends) and servers (back ends).
+ A PostgreSQL client can connect to PGPool as if it were a standard
+ PostgreSQL server. PGPool caches the connection to the PostgreSQL
+ server to reduce the overhead to establish the connection to it.
+ Also, PGPool could use two PostgreSQL servers for fail over. If the
+ first server goes down, PGPool will automatically switch to the
+ secondary server. Moreover, PGPool supports scheduled switch over.
+
+%track
+ prog pgpool = {
+ version = %{V_pgpool_dir}-%{V_pgpool}
+ url = http://pgfoundry.org/frs/?group_id=1000055
+ regex = /(\d+/pgpool-II-__VER__)\.tar\.gz
+ transform = "s/^(\\d+)\/pgpool-II-(\d+(\.\d+)+)/$1-$2/; $_"
+ }
+
+%prep
+ %setup -q -n pgpool-II-%{V_pgpool}
+ %patch -p0
+
+%build
+ # configure program
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O} %{l_cppflags}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}" \
+ LIBS="-lgetopt -lssl -lcrypto -lcrypt" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --sysconfdir=%{l_prefix}/etc/pgpool \
+ --with-pgsrc=/dummy \
+ --disable-shared
+
+ # build program
+ %{l_make} %{l_mflags -O}
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+
+ # install program
+ %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+ # install default configuration
+ mv $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pcp.conf.sample \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pcp.conf
+ mv $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pgpool.conf.sample \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pgpool.conf
+ mv $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pool_hba.conf.sample \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pool_hba.conf
+ %{l_shtool} subst \
+ -e 's;\(logdir = .\).*\(.\)$;\1%{l_prefix}/var/pgpool\2;' \
+ -e 's;\(socket_dir = .\).*\(.\)$;\1%{l_prefix}/var/pgpool\2;' \
+ -e 's;\(backend_socket_dir =
.\).*\(.\)$;\1%{l_prefix}/var/postgresql/run\2;' \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pgpool.conf
+
+ # install run-command script
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE rc.pgpool2} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # create run-time directory
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/var/pgpool
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/pgpool/*' \
+ '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/pgpool'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/pgpool2/rc.pgpool2
============================================================================
$ cvs diff -u -r0 -r1.1 rc.pgpool2
--- /dev/null 2007-12-15 10:33:43 +0100
+++ rc.pgpool2 2007-12-15 10:33:57 +0100
@@ -0,0 +1,81 @@
[EMAIL PROTECTED]@/bin/openpkg rc
+##
+## rc.pgpool2 -- Run-Commands
+##
+
+%config
+ pgpool2_enable="$openpkg_rc_def"
+ pgpool2_instances="default"
+ pgpool2_log_prolog="true"
+ pgpool2_log_epilog="true"
+ pgpool2_log_numfiles="10"
+ pgpool2_log_minsize="1M"
+ pgpool2_log_complevel="9"
+
+%common
+ pgpool2_etcdir="@l_prefix@/etc/pgpool"
+ pgpool2_vardir="@l_prefix@/var/pgpool"
+ pgpool2_signal () {
+ [ -f $pgpool2_vardir/$1.pid ] && kill -$2 `cat
$pgpool2_vardir/$1.pid`
+ }
+ pgpool2_cfgfiles () {
+ for instance in $pgpool2_instances; do
+ cfgfile=`echo "$instance" |\
+ sed -e 's;^;X;' \
+ -e 's;Xdefault$;pgpool;' \
+ -e 's;X\(.*\)$;pgpool-\1;' \
+ -e 's;$;.conf;'`
+ if [ -f "$pgpool2_etcdir/$cfgfile" ]; then
+ echo "$pgpool2_etcdir/$cfgfile"
+ fi
+ done
+ }
+
+%status -u @l_nusr@ -o
+ pgpool2_usable="unknown"
+ pgpool2_active="yes"
+ if rcService pgpool2 enable yes; then
+ for cfgfile in `pgpool2_cfgfiles`; do
+ name=`echo "$cfgfile" | sed -e 's;^.*/\([^/]*\)$;\1;' -e
's;\.conf$;;'`
+ pgpool2_signal $name 0
+ if [ $? -ne 0 ]; then
+ pgpool2_active="no"
+ break
+ fi
+ done
+ fi
+ echo "pgpool2_enable=\"$pgpool2_enable\""
+ echo "pgpool2_usable=\"$pgpool2_usable\""
+ echo "pgpool2_active=\"$pgpool2_active\""
+
+%start -p 200 -u @l_nusr@
+ rcService pgpool2 enable yes || exit 0
+ rcService pgpool2 active yes && exit 0
+ for cfgfile in `pgpool2_cfgfiles`; do
+ @l_prefix@/sbin/pgpool -f $cfgfile
+ done
+
+%stop -p 800 -u @l_nusr@
+ rcService pgpool2 enable yes || exit 0
+ rcService pgpool2 active no && exit 0
+ for cfgfile in `pgpool2_cfgfiles`; do
+ @l_prefix@/sbin/pgpool -f $cfgfile stop
+ done
+
+%restart -u @l_nusr@
+ rcService pgpool2 enable yes || exit 0
+ rcService pgpool2 active no && exit 0
+ rc pgpool stop start
+
+%daily -u @l_nusr@
+ rcService pgpool2 enable yes || exit 0
+ for cfgfile in `pgpool2_cfgfiles`; do
+ name=`echo "$cfgfile" | sed -e 's;^.*/\([^/]*\)$;\1;' -e
's;\.conf$;;'`
+ shtool rotate -f \
+ -n ${pgpool2_log_numfiles} -s ${pgpool2_log_minsize} -d \
+ -z ${pgpool2_log_complevel} -o @l_nusr@ -g @l_ngrp@ -m 644 \
+ -P "${pgpool2_log_prolog}" \
+ -E "${pgpool2_log_epilog}" \
+ $pgpool2_vardir/$name.log
+ done
+
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]