Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Tom Callaway
3c64d963b4 3.2.0 2012-09-19 16:59:24 -04:00
3 changed files with 73 additions and 22 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# pgpool This is the init script for starting up pgpool-II # 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 # description: Starts and stops the pgpool daemon
# processname: pgpool # processname: pgpool
# pidfile: /var/run/pgpool.pid # pidfile: /var/run/pgpool.pid
@ -14,9 +14,6 @@
# #
# v2.2.5 Devrim GUNDUZ <devrim@CommandPrompt.com> # v2.2.5 Devrim GUNDUZ <devrim@CommandPrompt.com>
# - Fix logging. # - Fix logging.
#
# v2.3 Devrim GUNDUZ <devrim@CommandPrompt.com>
# - Adjust order of startup and kill, per RH bugzilla #545739.
if [ -r /etc/sysconfig/pgpool ]; then if [ -r /etc/sysconfig/pgpool ]; then
. /etc/sysconfig/pgpool . /etc/sysconfig/pgpool

View file

@ -1,22 +1,36 @@
%define short_name pgpool-II %define short_name pgpool-II
%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 Summary: Pgpool is a connection pooling/replication server for PostgreSQL
Name: postgresql-%{short_name} Name: postgresql-%{short_name}
Version: 3.1.3 Version: 3.2.0
Release: 2%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: Applications/Databases Group: Applications/Databases
URL: http://pgpool.net URL: http://pgpool.net
Source0: http://www.pgpool.net/download.php?f=%{short_name}-%{version}.tar.gz Source0: http://www.pgpool.net/download.php?f=%{short_name}-%{version}.tar.gz
Source1: pgpool.service Source1: pgpool.service
Source2: pgpool.sysconfig Source2: pgpool.sysconfig
Source3: pgpool.init
Patch1: pgpool-3.1-conf.sample.patch Patch1: pgpool-3.1-conf.sample.patch
BuildRequires: postgresql-devel pam-devel BuildRequires: postgresql-devel pam-devel
BuildRequires: systemd-units %if %{systemd_enabled}
BuildRequires: systemd
Requires(post): systemd-sysv Requires(post): systemd-sysv
Requires(post): systemd-units Requires(post): systemd
Requires(preun): systemd-units Requires(preun): systemd
Requires(postun): systemd-units 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 Obsoletes: postgresql-pgpool
%description %description
@ -38,13 +52,21 @@ pgpool-II that is executed in pgpool-I mode enables multiple
DB nodes to be connected, which was not possible in pgpool-I. DB nodes to be connected, which was not possible in pgpool-I.
%package devel %package devel
Summary: The development files for pgpool-II Summary: The development files for pgpool-II
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%description devel %description devel
Development headers and libraries for pgpool-II. 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 %prep
%setup -q -n %{short_name}-%{version} %setup -q -n %{short_name}-%{version}
%patch1 -p1 -b .samplefix %patch1 -p1 -b .samplefix
@ -53,9 +75,11 @@ Development headers and libraries for pgpool-II.
%configure --with-pgsql-includedir=%{_includedir}/pgsql --with-pgsql=%{_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} make %{?_smp_flags}
( cd sql/pgpool-recovery && make %{?_smp_flags} )
%install %install
make %{?_smp_flags} DESTDIR=%{buildroot} install 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}%{_datadir}/%{short_name}
install -d %{buildroot}%{_sysconfdir}/%{short_name} install -d %{buildroot}%{_sysconfdir}/%{short_name}
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pcp.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf mv %{buildroot}/%{_sysconfdir}/%{short_name}/pcp.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf
@ -65,8 +89,14 @@ mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-master-slave %{b
mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-replication %{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}/ mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample-stream %{buildroot}%{_datadir}/%{short_name}/
%if %{systemd_enabled}
install -d %{buildroot}%{_unitdir} install -d %{buildroot}%{_unitdir}
install -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/pgpool.service 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}%{_sysconfdir}/sysconfig install -d %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/pgpool
@ -75,26 +105,34 @@ rm -f %{buildroot}%{_libdir}/libpcp.{a,la}
%post %post
/sbin/ldconfig /sbin/ldconfig
if [ $1 -eq 1 ] ; then %if %{systemd_enabled}
# Initial installation %systemd_post pgpool.service
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %else
fi # This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add pgpool
%endif
%preun %preun
%if %{systemd_enabled}
%systemd_preun pgpool.service
%else
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
# Package removal, not upgrade /sbin/service pgpool stop >/dev/null 2>&1
/bin/systemctl --no-reload disable pgpool.service > /dev/null 2>&1 || : /sbin/chkconfig --del pgpool
/bin/systemctl stop pgpool.service > /dev/null 2>&1 || :
fi fi
%endif
%postun %postun
/sbin/ldconfig /sbin/ldconfig
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %if %{systemd_enabled}
%systemd_postun_with_restart pgpool.service
%else
if [ $1 -ge 1 ] ; then if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall /sbin/service pgpool condrestart >/dev/null 2>&1 || :
/bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || :
fi fi
%endif
%if %{systemd_enabled}
%triggerun -- pgpool < 3.1-1 %triggerun -- pgpool < 3.1-1
# Save the current service runlevel info # Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply pgpool # User must manually run systemd-sysv-convert --apply pgpool
@ -104,6 +142,7 @@ fi
# Run these because the SysV package being removed won't do them # Run these because the SysV package being removed won't do them
/sbin/chkconfig --del pgpool >/dev/null 2>&1 || : /sbin/chkconfig --del pgpool >/dev/null 2>&1 || :
/bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || : /bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || :
%endif
%files %files
%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 %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
@ -129,7 +168,11 @@ fi
%{_datadir}/%{short_name}/pgpool.conf.sample-stream %{_datadir}/%{short_name}/pgpool.conf.sample-stream
%{_libdir}/libpcp.so.* %{_libdir}/libpcp.so.*
%{_datadir}/%{short_name}/pgpool.pam %{_datadir}/%{short_name}/pgpool.pam
%if %{systemd_enabled}
%{_unitdir}/pgpool.service %{_unitdir}/pgpool.service
%else
%{_sysconfdir}/init.d/pgpool
%endif
%attr(764,root,root) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf %attr(764,root,root) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf
%config(noreplace) %{_sysconfdir}/sysconfig/pgpool %config(noreplace) %{_sysconfdir}/sysconfig/pgpool
@ -140,8 +183,19 @@ fi
%{_includedir}/pool_type.h %{_includedir}/pool_type.h
%{_libdir}/libpcp.so %{_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 %changelog
* Wed Sep 19 2012 Tom Callaway <spot@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@lists.fedoraproject.org> - 3.1.3-2 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View file

@ -1 +1 @@
3094f4a8cc24a7ff5e40e37b1db243e7 pgpool-II-3.1.3.tar.gz b3194d7ff15c2c74a803a323c4afd22b pgpool-II-3.2.0.tar.gz