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: 11-Oct-2005 08:51:25
Branch: HEAD Handle: 2005101107512500
Added files:
openpkg-src/pgpool pgpool.spec rc.pgpool
Log:
first cut for a stand-alone PGPool package
Summary:
Revision Changes Path
1.1 +126 -0 openpkg-src/pgpool/pgpool.spec
1.1 +68 -0 openpkg-src/pgpool/rc.pgpool
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/pgpool/pgpool.spec
============================================================================
$ cvs diff -u -r0 -r1.1 pgpool.spec
--- /dev/null 2005-10-11 08:51:21 +0200
+++ pgpool.spec 2005-10-11 08:51:25 +0200
@@ -0,0 +1,126 @@
+##
+## pgpool.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2005 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 information
+Name: pgpool
+Summary: PostgreSQL Connection Pooling
+URL: http://pgpool.projects.postgresql.org/
+Vendor: Tatsuo Ishii
+Packager: OpenPKG
+Distribution: OpenPKG
+Class: EVAL
+Group: Database
+License: GPL
+Version: 2.6.3
+Release: 20051011
+
+# list of sources
+Source0:
http://pgfoundry.org/frs/download.php/426/pgpool-%{version}.tar.gz
+Source1: rc.pgpool
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130
+PreReq: OpenPKG, openpkg >= 20040130
+BuildPreReq: getopt
+PreReq: 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 = %{version}
+ url = http://pgpool.projects.postgresql.org/
+ regex = pgpool-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q
+
+%build
+ # configure program
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O} %{l_cppflags}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}" \
+ LIBS="-lgetopt" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --sysconfdir=%{l_prefix}/etc/pgpool \
+ --with-pgsrc=/dummy
+
+ # build program
+ %{l_make} %{l_mflags -O}
+
+%install
+ # create installation hierarchy
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/sbin \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool \
+ $RPM_BUILD_ROOT%{l_prefix}/var/pgpool \
+ $RPM_BUILD_ROOT%{l_prefix}/man/cat8
+
+ # install program
+ %{l_shtool} install -c -s -m 755 \
+ pgpool $RPM_BUILD_ROOT%{l_prefix}/sbin/
+
+ # install documentation
+ %{l_shtool} install -c -m 644 \
+ README $RPM_BUILD_ROOT%{l_prefix}/man/cat8/pgpool.8
+
+ # install default configuration
+ %{l_shtool} install -c -m 644 \
+ -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;' \
+ pgpool.conf.sample $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pgpool.conf
+
+ # install run-command script
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE rc.pgpool} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # 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/pgpool/rc.pgpool
============================================================================
$ cvs diff -u -r0 -r1.1 rc.pgpool
--- /dev/null 2005-10-11 08:51:21 +0200
+++ rc.pgpool 2005-10-11 08:51:25 +0200
@@ -0,0 +1,68 @@
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+## rc.pgpool -- Run-Commands
+##
+
+%config
+ pgpool_enable="$openpkg_rc_def"
+ pgpool_log_prolog="true"
+ pgpool_log_epilog="true"
+ pgpool_log_numfiles="10"
+ pgpool_log_minsize="1M"
+ pgpool_log_complevel="9"
+
+%common
+ pgpool_etcdir="@l_prefix@/etc/pgpool"
+ pgpool_vardir="@l_prefix@/var/pgpool"
+ pgpool_signal () {
+ [ -f $pgpool_vardir/$1.pid ] && kill -$2 `cat $pgpool_vardir/$1.pid`
+ }
+
+%status -u @l_nusr@ -o
+ pgpool_usable="unknown"
+ pgpool_active="yes"
+ if rcService pgpool enable yes; then
+ for cfgfile in $pgpool_etcdir/*.conf; do
+ name=`echo "$cfgfile" | sed -e 's;^.*/\([^/]*\)$;\1;' -e
's;\.conf$;;'`
+ pgpool_signal $name 0
+ if [ $? -ne 0 ]; then
+ pgpool_active="no"
+ break
+ fi
+ done
+ fi
+ echo "pgpool_enable=\"$pgpool_enable\""
+ echo "pgpool_usable=\"$pgpool_usable\""
+ echo "pgpool_active=\"$pgpool_active\""
+
+%start -p 200 -u @l_nusr@
+ rcService pgpool enable yes || exit 0
+ rcService pgpool active yes && exit 0
+ for cfgfile in $pgpool_etcdir/*.conf; do
+ @l_prefix@/sbin/pgpool -f $cfgfile
+ done
+
+%stop -p 800 -u @l_nusr@
+ rcService pgpool enable yes || exit 0
+ rcService pgpool active no && exit 0
+ for cfgfile in $pgpool_etcdir/*.conf; do
+ @l_prefix@/sbin/pgpool -f $cfgfile stop
+ done
+
+%restart -u @l_nusr@
+ rcService pgpool enable yes || exit 0
+ rcService pgpool active no && exit 0
+ rc pgpool stop start
+
+%daily -u @l_nusr@
+ rcService pgpool enable yes || exit 0
+ for cfgfile in $pgpool_etcdir/*.conf; do
+ name=`echo "$cfgfile" | sed -e 's;^.*/\([^/]*\)$;\1;' -e
's;\.conf$;;'`
+ shtool rotate -f \
+ -n ${pgpool_log_numfiles} -s ${pgpool_log_minsize} -d \
+ -z ${pgpool_log_complevel} -o @l_nusr@ -g @l_ngrp@ -m 644 \
+ -P "${pgpool_log_prolog}" \
+ -E "${pgpool_log_epilog}" \
+ $pgpool_vardir/$name.log
+ done
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]