%global short_name pgpool-II %if 0%{?rhel} && 0%{?rhel} <= 6 %global systemd_enabled 0 %else %global systemd_enabled 1 %endif %global _varrundir %{_localstatedir}/run/pgpool Summary: Pgpool is a connection pooling/replication server for PostgreSQL Name: postgresql-%{short_name} Version: 3.4.1 Release: 1%{?dist} License: BSD Group: Applications/Databases URL: http://pgpool.net Source0: http://www.pgpool.net/mediawiki/images/%{short_name}-%{version}.tar.gz Source1: pgpool.service Source2: pgpool.sysconfig Source3: pgpool.init BuildRequires: postgresql-devel pam-devel %if %{systemd_enabled} BuildRequires: systemd # We require this to be present for %%{_prefix}/lib/tmpfiles.d Requires: 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 Provides: postgresql-pgpool = 3.4.3 Obsoletes: postgresql-pgpool <= 3.4.2 %description pgpool-II is a inherited project of pgpool (to classify from pgpool-II, it is sometimes called as pgpool-I). For those of you not familiar with pgpool-I, it is a multi-functional middle ware for PostgreSQL that features connection pooling, replication and load balancing functions. pgpool-I allows a user to connect at most two PostgreSQL servers for higher availability or for higher search performance compared to a single PostgreSQL server. pgpool-II, on the other hand, allows multiple PostgreSQL servers (DB nodes) to be connected, which enables queries to be executed simultaneously on all servers. In other words, it enables "parallel query" processing. Also, pgpool-II can be started as pgpool-I by changing configuration parameters. 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 Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development headers and libraries for pgpool-II. %package extensions Summary: Postgresql extensions for pgpool-II Group: Applications/Databases Obsoletes: postgresql-pgpool-II-recovery <= 3.3.4-1 Provides: postgresql-pgpool-II-recovery = %{version}-%{release} Requires: postgresql-server(:MODULE_COMPAT_%{postgresql_major}) Requires: %{name}%{?_isa} = %{version}-%{release} %description extensions Postgresql extensions libraries and sql files for pgpool-II. %prep %setup -q -n %{short_name}-%{version} %build %configure \ --with-pgsql-includedir=%{_includedir}/pgsql \ --with-pgsql=%{_libdir}/pgsql \ --disable-static \ --with-pam \ --sysconfdir=%{_sysconfdir}/%{short_name}/ # https://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} make %{?_smp_mflags} -C src/sql/pgpool-recovery make %{?_smp_mflags} -C src/sql/pgpool-regclass %install make %{?_smp_mflags} DESTDIR=%{buildroot} install make %{?_smp_mflags} DESTDIR=%{buildroot} install -C src/sql/pgpool-recovery make %{?_smp_mflags} DESTDIR=%{buildroot} install -C src/sql/pgpool-regclass 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 mv %{buildroot}/%{_sysconfdir}/%{short_name}/pgpool.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf 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 644 %{SOURCE1} %{buildroot}%{_unitdir}/pgpool.service # ... and make a tmpfiles script to recreate it at reboot. mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir} cat > $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf </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 ||: # 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 %doc README TODO COPYING 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}/pcp_watchdog_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 %if %{systemd_enabled} %ghost %{_varrundir} %{_tmpfilesdir}/%{name}.conf %{_unitdir}/pgpool.service %else %{_sysconfdir}/init.d/pgpool %endif %dir %{_sysconfdir}/%{short_name} %attr(644,root,root) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf %config(noreplace) %{_sysconfdir}/sysconfig/pgpool %files devel %{_includedir}/libpcp_ext.h %{_includedir}/pcp.h %{_includedir}/pool_process_reporting.h %{_includedir}/pool_type.h %{_libdir}/libpcp.so %files extensions %{_libdir}/pgsql/pgpool-recovery.so %{_datadir}/pgsql/extension/pgpool-recovery.sql %{_datadir}/pgsql/extension/pgpool_recovery--1.1.sql %{_datadir}/pgsql/extension/pgpool_recovery.control %{_datadir}/pgsql/extension/pgpool-regclass.sql %{_datadir}/pgsql/extension/pgpool_regclass--1.0.sql %{_datadir}/pgsql/extension/pgpool_regclass.control # From PostgreSQL 9.4 pgpool-regclass.so is not needed anymore # because 9.4 or later has to_regclass. %{_libdir}/pgsql/pgpool-regclass.so %changelog * Thu Feb 5 2015 Devrim Gündüz - 3.4.1-1 - Update to 3.4.1 * Tue Jan 06 2015 Jozef Mlich - 3.4.0-6 - rebuild because of broken dependency requires postgresql-server(:MODULE_COMPAT_9.3) * Mon Dec 15 2014 Jozef Mlich - 3.4.0-5 - incorrect permissions on init script. * Thu Dec 11 2014 Jozef Mlich - 3.4.0-4 - incorrect epoch in obsoletes of recovery subpackage - fixed some rpmlint warnings * Wed Dec 10 2014 Pavel Raiskup - 3.4.0-3 - lint the spec file, remove RPATH (rhbz#1166534) * Fri Nov 21 2014 Pavel Raiskup - 3.4.0-2 - remove redundant 'cd ../..' in sub-shell, cleanup comments, use %%_smp_mflags, use %%global * Wed Nov 12 2014 Jozef Mlich - 3.4.0-1 - update to 3.4.0 see http://www.pgpool.net/docs/pgpool-II-3.4.0/NEWS.txt - recovery subpackage renamed to extensions - added module compat for extensions * Tue Sep 09 2014 Jozef Mlich - 3.3.4-1 - update to 3.3.4 see http://www.pgpool.net/docs/pgpool-II-3.3.4/NEWS.txt * Sun Aug 17 2014 Fedora Release Engineering - 3.3.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Thu Jun 12 2014 Pavel Raiskup - 3.3.3-2 - create %%_varrundir after installation, specify it on one place, * Thu Jun 12 2014 Jozef Mlich - 3.3.3-1 - adding tmpfiles.d (allow pid file to be created in /var/run/pgpool - dir created after reboot) - Rebase to pgpool-II 3.3.3 (#1094713) * Sat Jun 07 2014 Fedora Release Engineering - 3.2.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu Sep 19 2013 Pavel Raiskup - 3.2.0-4 - Rebuilt against PostgreSQL 9.3 (#1007855) * Sun Aug 04 2013 Fedora Release Engineering - 3.2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu Feb 14 2013 Fedora Release Engineering - 3.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Sep 19 2012 Tom Callaway - 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 - 3.1.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Apr 24 2012 Devrim GUNDUZ - 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 - 3.1.2-1 - update to 3.1.2 * Tue Mar 27 2012 Devrim Gunduz - 3.1.2-1 - update to 3.1.2 * Sat Jan 14 2012 Fedora Release Engineering - 3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Sep 12 2011 Tom Callaway - 3.1-1 - update to 3.1 - convert to systemd * Wed Feb 09 2011 Fedora Release Engineering - 2.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Fri Dec 25 2009 Devrim GUNDUZ - 2.3.1-1 - Update to 2.3.1 - Adjust order of startup and kill, per RH bugzilla #545739. * Tue Dec 1 2009 Devrim GUNDUZ - 2.2.6-1 - Update to 2.2.6 * Sun Nov 01 2009 Devrim GUNDUZ - 2.2.5-2 - Remove init script from all runlevels before uninstall. Per RH Bugzilla #532177 * Sun Oct 4 2009 Devrim Gunduz 2.2.5-1 - 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 2.2.4-1 - Update to 2.2.4 - Re-apply a fix for #442372 * Sun Jul 26 2009 Fedora Release Engineering - 2.2.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu May 7 2009 Devrim Gunduz 2.2.2-1 - Update to 2.2.2 * Mon Mar 23 2009 Devrim Gunduz 2.2-1.1 - Fix pid file path in init script. - Fix spec file -- we don't use short_name macro in pgcore spec file. - Create pgpool pid file directory. - Fix stop/start routines, also improve init script a bit. - Install conf files to a new directory (/etc/pgpool-II), and get rid of sample conf files. * Sun Mar 1 2009 Devrim Gunduz 2.2-1 - Update to 2.2 - Update URL * Thu Feb 26 2009 Fedora Release Engineering - 2.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Dec 4 2008 Michael Schwendt 2.1-2 - Include /usr/share/pgpool-II directory. * Tue Aug 12 2008 Devrim Gunduz 2.1-1 - Update to 2.1 Gold - Set group of sample config files to root, not apache. Fixes RH #442372. - Update patch #1: Fix build failure caused by new default patch fuzz = 0 policy in rawhide * Fri Apr 11 2008 Devrim Gunduz 2.1-0.2.beta2 - Fix Requires: issue, per #442021 (Alex Lancaster) * Sun Apr 6 2008 Devrim Gunduz 2.1-beta2 - Update to 2.1 beta2 * Mon Feb 18 2008 Fedora Release Engineering - 2.0.1-3.1 - Autorebuild for GCC 4.3 * Mon Jan 21 2008 Devrim GUNDUZ 2.0.1-2.1 - Rebuilt against PostgreSQL 8.3 * Sat Jan 19 2008 Devrim Gunduz 2.0.1-2 - Fix Requires of -devel package, per bz#429436 * Sun Jan 13 2008 Devrim Gunduz 2.0.1-1 - Update to 2.0.1 - Add a temp patch that will disappear in 2.0.2 * Tue Oct 23 2007 Devrim Gunduz 1.3-1 - Update to 1.3 * Fri Oct 5 2007 Devrim Gunduz 1.2.1-1 - Update to 1.2.1 * Wed Aug 29 2007 Devrim Gunduz 1.2-5 - Chmod sysconfig/pgpool to 644, not 755. Per BZ review. - Run chkconfig --add pgpool during %%post. * Thu Aug 16 2007 Devrim Gunduz 1.2-4 - Fixed the directory name where sample conf files and sql files are installed. * Sun Aug 5 2007 Devrim Gunduz 1.2-3 - Added a patch for sample conf file to use Fedora defaults * Sun Aug 5 2007 Devrim Gunduz 1.2-2 - Added an init script for pgpool - Added /etc/sysconfig/pgpool * Wed Aug 1 2007 Devrim Gunduz 1.2-1 - Update to 1.2 * Fri Jun 15 2007 Devrim Gunduz 1.1.1-1 - Update to 1.1.1 * Sat Jun 2 2007 Devrim Gunduz 1.1-1 - Update to 1.1 - added --disable-rpath configure parameter. - Chowned sample conf files, so that they can work with pgpoolAdmin. * Sun Apr 22 2007 Devrim Gunduz 1.0.2-4 - Added postgresql-devel as BR, per bugzilla review. - Added --disable-static flan, per bugzilla review. - Removed superfluous manual file installs, per bugzilla review. * Sun Apr 22 2007 Devrim Gunduz 1.0.2-3 - Rebuilt for the correct tarball - Fixed man8 file ownership, per bugzilla review #229321 * Tue Feb 20 2007 Jarod Wilson 1.0.2-2 - Create proper devel package, drop -libs package - Nuke rpath - Don't install libtool archive and static lib - Clean up %%configure line - Use proper %%_smp_mflags - Install config files properly, without .sample on the end - Preserve timestamps on header files * Tue Feb 20 2007 Devrim Gunduz 1.0.2-1 - Update to 1.0.2-1 * Mon Oct 02 2006 Devrim Gunduz 1.0.1-5 - Rebuilt * Mon Oct 02 2006 Devrim Gunduz 1.0.1-4 - Added -libs and RPM - Fix .so link problem - Cosmetic changes to spec file * Wed Sep 27 2006 - Devrim GUNDUZ 1.0.1-3 - Fix spec, per Yoshiyuki Asaba * Tue Sep 26 2006 - Devrim GUNDUZ 1.0.1-2 - Fixed rpmlint errors - Fixed download url - Added ldconfig for .so files * Thu Sep 21 2006 - David Fetter 1.0.1-1 - Initial build pgpool-II 1.0.1 for PgPool Global Development Group