[postgresql-pgpool-II/el6] 3.2.0
Tom Callaway
spot at fedoraproject.org
Wed Sep 19 20:59:58 UTC 2012
commit a93b390c3fd492f860d06fa1a2069d830d177c2f
Author: Tom Callaway <spot at fedoraproject.org>
Date: Wed Sep 19 17:00:42 2012 -0400
3.2.0
pgpool-3.1-conf.sample.patch | 40 ++++++++++
pgpool.init | 5 +-
pgpool.service | 10 +++
postgresql-pgpool-II.spec | 170 +++++++++++++++++++++++++++++++++---------
sources | 2 +-
5 files changed, 188 insertions(+), 39 deletions(-)
---
diff --git a/pgpool-3.1-conf.sample.patch b/pgpool-3.1-conf.sample.patch
new file mode 100644
index 0000000..990614a
--- /dev/null
+++ b/pgpool-3.1-conf.sample.patch
@@ -0,0 +1,40 @@
+diff -up pgpool-II-3.1/pgpool.conf.sample.orig pgpool-II-3.1/pgpool.conf.sample
+--- pgpool-II-3.1/pgpool.conf.sample.orig 2011-08-25 17:04:43.000000000 -0400
++++ pgpool-II-3.1/pgpool.conf.sample 2011-09-12 10:51:53.136935503 -0400
+@@ -33,8 +33,6 @@ port = 9999
+ # (change requires restart)
+ socket_dir = '/tmp'
+ # Unix domain socket path
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+
+@@ -45,12 +43,16 @@ pcp_port = 9898
+ # (change requires restart)
+ pcp_socket_dir = '/tmp'
+ # Unix domain socket path for pcp
+- # The Debian package defaults to
+- # /var/run/postgresql
+ # (change requires restart)
+
+ # - Backend Connection Settings -
+
++backend_hostname0 = 'localhost'
++backend_port0 = 5432
++backend_weight0 = 1
++backend_data_directory0 = '/var/lib/pgsql/data'
++backend_flag0 = 'ALLOW_TO_FAILOVER'
++
+ #backend_hostname0 = 'host1'
+ # Host name or IP address to connect to for backend 0
+ #backend_port0 = 5432
+@@ -179,7 +181,7 @@ debug_level = 0
+ pid_file_name = '/var/run/pgpool/pgpool.pid'
+ # PID file name
+ # (change requires restart)
+-logdir = '/tmp'
++logdir = '/var/log/pgpool'
+ # Directory of pgPool status file
+ # (change requires restart)
+
diff --git a/pgpool.init b/pgpool.init
index e0a4119..f09b982 100755
--- a/pgpool.init
+++ b/pgpool.init
@@ -1,7 +1,7 @@
#!/bin/sh
# pgpool This is the init script for starting up pgpool-II
#
-# chkconfig: - 235 74 33
+# chkconfig: - 64 36
# description: Starts and stops the pgpool daemon
# processname: pgpool
# pidfile: /var/run/pgpool.pid
@@ -14,9 +14,6 @@
#
# v2.2.5 Devrim GUNDUZ <devrim at CommandPrompt.com>
# - Fix logging.
-#
-# v2.3 Devrim GUNDUZ <devrim at CommandPrompt.com>
-# - Adjust order of startup and kill, per RH bugzilla #545739.
if [ -r /etc/sysconfig/pgpool ]; then
. /etc/sysconfig/pgpool
diff --git a/pgpool.service b/pgpool.service
new file mode 100644
index 0000000..01bb6c4
--- /dev/null
+++ b/pgpool.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=PGPool-II Middleware Between PostgreSQL Servers And PostgreSQL Database Clients
+After=syslog.target network.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/pgpool
+ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec
index ff30969..fd4f10e 100644
--- a/postgresql-pgpool-II.spec
+++ b/postgresql-pgpool-II.spec
@@ -1,20 +1,37 @@
%define short_name pgpool-II
-
-Summary: Pgpool is a connection pooling/replication server for PostgreSQL
-Name: postgresql-%{short_name}
-Version: 2.3.1
-Release: 1%{?dist}
-License: BSD
-Group: Applications/Databases
-URL: http://pgpool.projects.PostgreSQL.org
-Source0: http://pgfoundry.org/frs/download.php/2506/%{short_name}-%{version}.tar.gz
-Source1: pgpool.init
-Source2: pgpool.sysconfig
-Patch1: pgpool.conf.sample.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: postgresql-devel pam-devel
-
-Obsoletes: postgresql-pgpool
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%define systemd_enabled 0
+%else
+%define systemd_enabled 1
+%endif
+
+Summary: Pgpool is a connection pooling/replication server for PostgreSQL
+Name: postgresql-%{short_name}
+Version: 3.2.0
+Release: 1%{?dist}
+License: BSD
+Group: Applications/Databases
+URL: http://pgpool.net
+Source0: http://www.pgpool.net/download.php?f=%{short_name}-%{version}.tar.gz
+Source1: pgpool.service
+Source2: pgpool.sysconfig
+Source3: pgpool.init
+Patch1: pgpool-3.1-conf.sample.patch
+BuildRequires: postgresql-devel pam-devel
+%if %{systemd_enabled}
+BuildRequires: systemd
+Requires(post): systemd-sysv
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+# This is for /sbin/service
+Requires(preun): initscripts
+Requires(postun): initscripts
+%endif
+Obsoletes: postgresql-pgpool
%description
pgpool-II is a inherited project of pgpool (to classify from
@@ -35,25 +52,34 @@ pgpool-II that is executed in pgpool-I mode enables multiple
DB nodes to be connected, which was not possible in pgpool-I.
%package devel
-Summary: The development files for pgpool-II
+Summary: The development files for pgpool-II
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Development headers and libraries for pgpool-II.
+%package recovery
+Summary: PGPool recovery add-on for PostgreSQL
+Group: Applications/Databases
+Requires: %{name} = %{version}-%{release}
+
+%description recovery
+PGPool recovery add-on for PostgreSQL.
+
%prep
%setup -q -n %{short_name}-%{version}
-%patch1 -p0
+%patch1 -p1 -b .samplefix
%build
-%configure --with-pgsql-includedir=%{_includedir}/pgsql --with-pgsql-lib=%{_libdir}/pgsql --disable-static --with-pam --disable-rpath --sysconfdir=%{_sysconfdir}/%{short_name}/
+%configure --with-pgsql-includedir=%{_includedir}/pgsql --with-pgsql=%{_libdir}/pgsql --disable-static --with-pam --disable-rpath --sysconfdir=%{_sysconfdir}/%{short_name}/
make %{?_smp_flags}
+( cd sql/pgpool-recovery && make %{?_smp_flags} )
%install
-rm -rf %{buildroot}
make %{?_smp_flags} DESTDIR=%{buildroot} install
+( cd sql/pgpool-recovery && make %{?_smp_flags} DESTDIR=%{buildroot} install )
install -d %{buildroot}%{_datadir}/%{short_name}
install -d %{buildroot}%{_sysconfdir}/%{short_name}
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pcp.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf
@@ -61,62 +87,138 @@ mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample %{buildroot}%{_s
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pool_hba.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-master-slave %{buildroot}%{_datadir}/%{short_name}/
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-replication %{buildroot}%{_datadir}/%{short_name}/
+mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-stream %{buildroot}%{_datadir}/%{short_name}/
+
+%if %{systemd_enabled}
+install -d %{buildroot}%{_unitdir}
+install -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/pgpool.service
+%else
+install -d %{buildroot}%{_sysconfdir}/init.d
+install -m 755 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/pgpool
+%endif
-install -d %{buildroot}%{_initrddir}
-install -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/pgpool
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool
# nuke libtool archive and static lib
rm -f %{buildroot}%{_libdir}/libpcp.{a,la}
-%clean
-rm -rf %{buildroot}
-
%post
/sbin/ldconfig
-chkconfig --add pgpool
+%if %{systemd_enabled}
+%systemd_post pgpool.service
+%else
+# This adds the proper /etc/rc*.d links for the script
+/sbin/chkconfig --add pgpool
+%endif
%preun
-if [ $1 = 0 ] ; then
- /sbin/service pgpool condstop >/dev/null 2>&1
- chkconfig --del pgpool
+%if %{systemd_enabled}
+%systemd_preun pgpool.service
+%else
+if [ $1 -eq 0 ] ; then
+ /sbin/service pgpool stop >/dev/null 2>&1
+ /sbin/chkconfig --del pgpool
+fi
+%endif
+
+%postun
+/sbin/ldconfig
+%if %{systemd_enabled}
+%systemd_postun_with_restart pgpool.service
+%else
+if [ $1 -ge 1 ] ; then
+ /sbin/service pgpool condrestart >/dev/null 2>&1 || :
fi
+%endif
+
+%if %{systemd_enabled}
+%triggerun -- pgpool < 3.1-1
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply pgpool
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save pgpool >/dev/null 2>&1 ||:
-%postun -p /sbin/ldconfig
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del pgpool >/dev/null 2>&1 || :
+/bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || :
+%endif
%files
-%defattr(-,root,root,-)
%doc README README.euc_jp TODO COPYING INSTALL AUTHORS ChangeLog NEWS doc/pgpool-en.html doc/pgpool-ja.html doc/pgpool.css doc/tutorial-en.html doc/tutorial-ja.html
%{_bindir}/pgpool
%{_bindir}/pcp_attach_node
%{_bindir}/pcp_detach_node
%{_bindir}/pcp_node_count
%{_bindir}/pcp_node_info
+%{_bindir}/pcp_pool_status
%{_bindir}/pcp_proc_count
%{_bindir}/pcp_proc_info
+%{_bindir}/pcp_promote_node
%{_bindir}/pcp_recovery_node
%{_bindir}/pcp_stop_pgpool
%{_bindir}/pcp_systemdb_info
%{_bindir}/pg_md5
%{_mandir}/man8/pgpool*
%dir %{_datadir}/%{short_name}
+%{_datadir}/%{short_name}/insert_lock.sql
%{_datadir}/%{short_name}/system_db.sql
%{_datadir}/%{short_name}/pgpool.conf.sample-master-slave
%{_datadir}/%{short_name}/pgpool.conf.sample-replication
+%{_datadir}/%{short_name}/pgpool.conf.sample-stream
%{_libdir}/libpcp.so.*
%{_datadir}/%{short_name}/pgpool.pam
-%{_initrddir}/pgpool
+%if %{systemd_enabled}
+%{_unitdir}/pgpool.service
+%else
+%{_sysconfdir}/init.d/pgpool
+%endif
%attr(764,root,root) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf
%config(noreplace) %{_sysconfdir}/sysconfig/pgpool
%files devel
-%defattr(-,root,root,-)
+%{_includedir}/libpcp_ext.h
%{_includedir}/pcp.h
+%{_includedir}/pool_process_reporting.h
%{_includedir}/pool_type.h
%{_libdir}/libpcp.so
+%files recovery
+%{_libdir}/pgsql/pgpool-recovery.so
+%{_datadir}/pgsql/contrib/pgpool-recovery.sql
+%{_datadir}/pgsql/contrib/uninstall_pgpool-recovery.sql
+%doc sample/pgpool_recovery*
+
%changelog
+* Wed Sep 19 2012 Tom Callaway <spot at fedoraproject.org> - 3.2.0-1
+- update to 3.2.0
+- add recovery subpackage (thanks to Dmitry S. Makovey)
+- add rhel conditionalization (thanks to Dmitry S. Makovey)
+- update systemd scriptlets
+
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.1.3-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Tue Apr 24 2012 Devrim GUNDUZ <devrim at gunduz.org> - 3.1.3-1
+- Update to 3.1.3, per changes described at:
+ http://www.pgpool.net/docs/pgpool-II-3.1.3/doc/NEWS.txt
+
+* Tue Mar 27 2012 Devrim Gunduz <devrim at gunduz.org> - 3.1.2-1
+- update to 3.1.2
+
+* Tue Mar 27 2012 Devrim Gunduz <devrim at gunduz.org> - 3.1.2-1
+- update to 3.1.2
+
+* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Mon Sep 12 2011 Tom Callaway <spot at fedoraproject.org> - 3.1-1
+- update to 3.1
+- convert to systemd
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.3.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
* Fri Dec 25 2009 Devrim GUNDUZ <devrim at gunduz.org> - 2.3.1-1
- Update to 2.3.1
- Adjust order of startup and kill, per RH bugzilla #545739.
@@ -129,7 +231,7 @@ fi
#532177
* Sun Oct 4 2009 Devrim Gunduz <devrim at CommandPrompt.com> 2.2.5-1
-- Update to 2.2.5, for various fixes described at
+- Update to 2.2.5, for various fixes described at
http://lists.pgfoundry.org/pipermail/pgpool-general/2009-October/002188.html
* Sat Oct 3 2009 Devrim Gunduz <devrim at CommandPrompt.com> 2.2.4-1
diff --git a/sources b/sources
index 59dbedc..aa256c1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-032fc94eaa71ed99276234b7a110cdf5 pgpool-II-2.3.1.tar.gz
+b3194d7ff15c2c74a803a323c4afd22b pgpool-II-3.2.0.tar.gz
More information about the scm-commits
mailing list