postgresql-pgpool-II/postgresql-pgpool-II.spec
2012-02-01 19:57:31 +04:00

461 lines
18 KiB
RPMSpec

%define short_name pgpool-II
%define major 0
%define libname %mklibname pcp %{major}
%define devname %mklibname pcp -d
Summary: Pgpool is a connection pooling/replication server for PostgreSQL
Name: postgresql-%{short_name}
Version: 3.0
Release: %mkrel 1
License: BSD
Group: 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
Source3: pgpool.conf.mirroring
Source4: pgpool-copy-base-backup
Source5: pgpool-archive_command
Source6: pgpool-mirroring_failback
# (proyvind): These are all patches of mine, briefly described in changelog for
# 2.3.3-1, eventually they should preferably make their way in some
# form or another when I, or someone else who feels like it gets
# around to it.. ;)
Patch1: pgpool-II-3.0-pgpool.conf-mdkconf.patch
Patch2: pgpool-II-3.0-logfile.patch
# there's a slight/minimal chance for a race condition through use of waitpid(2),
# TODO:
# <jbj> the easiest fix is to create a pipe to serialize the operation of parent <-> child
# <jbj> whoever runs 1st closes the pipe fd, whoever runs last blocks on the read and the close causes a 0b read (aka EOF)
# <jbj> ... usleep is just a bandaid because you don't know who long to wait. using pipe(2) to strictly force the parent <-> child ordering is the better fix.
# <jbj> but the usleep will "work" almost always.
Patch3: pgpool-II-3.0-verify-child-pid-survival.patch
Patch4: pgpool-II-2.3.3-support-libsetproctitle.patch
Patch5: pgpool-II-3.0-recovery-script-customizations.patch
Patch6: pgpool-II-3.0-custom-unix-socket-dir.patch
Patch7: pgpool-II-3.0-fix-segfault-of-child-on-syntax-error-ext_query_prot.patch
Patch8: pgpool-II-3.0-fix-md5-auth-bug.patch
Patch9: pgpool-II-3.0-add-md5-username-option.patch
Requires(post,preun): rpm-helper
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: postgresql-devel pam-devel openssl-devel
BuildRequires: setproctitle-devel
Suggests: postgresql-server postgresql-contrib-virtual
Provides: %{short_name} = %{version}-%{release}
# This only being unversioned obsoletes only is fully intended as it's
# not meant to be an automatic, unvoluntarily upgrade of pgpool, but
# meant to replace it if user explicitly chooses to install the package
# it self.. So matching provides are excluded with intent as well.
Obsoletes: pgpool
%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 -n %{libname}
Summary: Library for pgpool-II
Group: System/Libraries
%description -n %{libname}
Library for pgpool-II.
%package -n %{devname}
Summary: Development headers for pgpool-II
Group: Development/C
Provides: %{name}-devel = %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
%description -n %{devname}
Development headers and libraries for pgpool-II.
%prep
%setup -q -n %{short_name}-%{version}
iconv -f iso-8859-1 -t utf-8 TODO -o TODO
%patch1 -p1 -b .mdkconf~
%patch2 -p1 -b .stdout_log~
%patch3 -p1 -b .verify_child_pid~
%patch4 -p1 -b .setproctitle~
%patch5 -p1 -b .recovery~
%patch6 -p1 -b .socketdir~
%patch7 -p1 -b .syntax_err_segfault~
%patch8 -p1 -b .md5_auth_bug~
%patch9 -p1 -b .md5_user_option~
autoreconf -fi
cp %{SOURCE4} sample/copy-base-backup
cp %{SOURCE5} sample/archive_command
cp %{SOURCE6} sample/mirroring_failback
%build
%configure2_5x --with-pgsql-includedir=%{_includedir}/pgsql \
--with-pgsql-libdir=%{_libdir}/pgsql \
--disable-static \
--with-pam \
--with-openssl \
--disable-rpath \
--sysconfdir=%{_sysconfdir}/%{short_name}
%make
%make -C sql/pgpool-recovery
%make -C sql/pgpool-regclass
%install
rm -rf %{buildroot}
%makeinstall_std
%makeinstall_std -C sql/pgpool-recovery
%makeinstall_std -C sql/pgpool-regclass
install -d %{buildroot}%{_localstatedir}/run/{pgpool,postgresql}
install -d %{buildroot}%{_sysconfdir}/logrotate.d
tee %{buildroot}/%{_sysconfdir}/logrotate.d/pgpool <<EOH
/var/log/postgres/pgpool {
notifempty
missingok
copytruncate
}
EOH
for i in %{buildroot}/%{_sysconfdir}/%{short_name}/*sample*
do mv $i `echo $i |sed -e 's#sample-##g' -e 's#\.sample##g'`
done
install -m644 %{SOURCE3} -D %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf.mirroring
install -m755 %{SOURCE1} -D %{buildroot}%{_initrddir}/pgpool
install -m640 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/sysconfig/pgpool
sed -e 's#/usr/local#/usr#g' -i sample/*
install -m644 sample/dist_def_pgbench.sql %{buildroot}%{_datadir}/%{short_name}
install -m644 sample/replicate_def_pgbench.sql %{buildroot}%{_datadir}/%{short_name}
for i in archive_command copy-base-backup mirroring_failback pgpool_recovery pgpool_recovery_pitr pgpool_remote_start; do
install -m755 sample/$i %{buildroot}%{_datadir}/%{short_name}/$i
done
touch %{buildroot}%{_sysconfdir}/%{short_name}/pool_passwd
%clean
rm -rf %{buildroot}
%posttrans
%create_ghostfile %{_sysconfdir}/%{short_name}/pool_passwd postgres postgres 644
%_post_service pgpool
%preun
%_preun_service pgpool
%files
%defattr(-,root,root)
%doc README TODO COPYING AUTHORS ChangeLog NEWS
%doc doc/pgpool-en.html doc/pgpool.css doc/tutorial-en.html
%lang(ja) %doc README.euc_jp doc/pgpool-ja.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_proc_count
%{_bindir}/pcp_proc_info
%{_bindir}/pcp_recovery_node
%{_bindir}/pcp_stop_pgpool
%{_bindir}/pcp_systemdb_info
%{_bindir}/pg_md5
%{_mandir}/man8/pgpool.8*
%dir %{_datadir}/%{short_name}
%{_datadir}/%{short_name}/archive_command
%{_datadir}/%{short_name}/copy-base-backup
%{_datadir}/%{short_name}/mirroring_failback
%{_datadir}/%{short_name}/system_db.sql
%{_datadir}/%{short_name}/pgpool.pam
%{_datadir}/%{short_name}/pgpool_recovery_pitr
%{_datadir}/%{short_name}/dist_def_pgbench.sql
%{_datadir}/%{short_name}/pgpool_recovery
%{_datadir}/%{short_name}/pgpool_remote_start
%{_datadir}/%{short_name}/replicate_def_pgbench.sql
%{_datadir}/postgresql/contrib/pgpool-recovery.sql
%{_datadir}/postgresql/contrib/pgpool-regclass.sql
%{_initrddir}/pgpool
%{_libdir}/postgresql/pgpool-recovery.so
%{_libdir}/postgresql/pgpool-regclass.so
%attr(700,postgres,postgres) %dir %{_localstatedir}/run/pgpool
%attr(775,postgres,postgres) %dir %{_localstatedir}/run/postgresql
%dir %{_sysconfdir}/%{short_name}
%config(noreplace) %{_sysconfdir}/%{short_name}/*.conf*
%ghost %attr(644,postgres,postgres) %{_sysconfdir}/%{short_name}/pool_passwd
%attr(640,root,postgres) %config(noreplace) %{_sysconfdir}/sysconfig/pgpool
%config(noreplace) %{_sysconfdir}/logrotate.d/pgpool
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libpcp.so.%{major}*
%files -n %{devname}
%defattr(-,root,root)
%{_includedir}/pcp.h
%{_includedir}/pool_type.h
%{_libdir}/libpcp.so
%{_libdir}/libpcp.la
%changelog
* Wed Oct 06 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 3.0-1mdv2011.0
+ Revision: 583659
- Add a new option for md5 authentication: -U, --username=NAME (P9, from upstream)
- Fix bug with md5 auth. If there's more than 1 servers to be authenticated, it
segfaults (P8, from upstream)
- Fix a bug that causes segfault of a child process when syntax error occurred in
extended query protocol. (P7, from upstream)
- fix 'rh_status_q()' to properly return the right return code on MES 5
- switch back to using '/tmp' for sockets dir again now that postgresql init
script won't wipe it out anymore..
- add crude failback script for mirroring setup...
- quote all pcp_* arguments in initscript
- change attributes for sysconfig file to make it only readable by postgres group
- make recovery script more robust..
- actually use PGPOOLCONF variable and add it to sysconfig file
- clean up variable setting and loading from sysconfig files a bit further
- pass log file as argument rather than as a setting in configuration file
- load sysconfig file after variables have been set so it's settings may override
- check status of postgresql using it's init script which now has been fixed
- fix 'immediate' stop mode
- disable query_cache in mirroring config, otherwise pgpool will fail if systemdb
is down
- fix status() usage to work with both current cooker & MES 5 in init script
- prettify stop() in init script
- don't depend on postgresql, make it optional...
- fix recovery scripts, sorta..
- new release: 3.0
- change unix domain socket path to /var/run/postgresql (P6)
- fix broken copy-base-backup script
- fix a type in init script
- don't own files within postgresql installation
- prettify output of 'extendedstatus' a bit
- print 'unix-socket' in place of missing host in list of nodes to get same
number of arguments for 'extendedstatus' to display them correctly
- disable replicate_select & ssl by default for mirroring setup
- make it possible to override options passed to pcp_* tools in extendedstatus()
* don't try to printing out an extendedstatus if pgool isn't running
- make 'fast' default stop mode
- ensure postgres being owner of recovery script symlinks
- create symlinks to recovery scripts during init, otherwise postgres directory
might get populated before postgresql 'initdb' gets too, making it fail...
- fix weight of mirror
- fix broken symlinks and location for recovery scripts..
- update logging patch to patch pool_config.l as well
- install all the files required for recovery in the same, appropriate way
- fix script breakage due to missing variables..
- make log output filename consistent with postgresql and match logrotate config
- adjust our recovery scripts for our use and for recovery by PITR
- fix initialization order so that we get things into template1 before using it
- work around messy issue with initscripts in MES 5.1 not handling status() properly..
- be more explicit about paths to ensure 'copy-base-backup' doesn't get lost...
- only listen on localhost by default for mirroring config
- fix paths to rescue scripts..
- make sure to create functions etc. in the right tables..
- enable lobj_lock_table by creating a locking table in template1
- fix installation of recovery functions
- don't hardcode to use unix sockets for host connecting to..
- print list of pids for idle processes separately, all at once
- start on an extendedstatus() action
- add recovery scripts of ours to mirroring config
- don't pollute output with redundant messages about terminating in init script
- fix ghost file creation
- pass pgpool options as arguments in stead for greater flexibility
- install various sample recovery scripts etc. and one of our own
- add options for fast and immediate stop as well in initscript.. (would they
serve better as arguments, and be easier reusable for restart etc. as well..?)
- update init script to initialize necessary databases, functions etc.
- add support for setproctitle() through libsetproctitle()
- build and install pgpool-recovery as well
- fix incorrect argument for pgsql libdir passed to configure
- set socket path always to /tmp to ensure compatibility with posgresql, although
postgresql should really be confined to use /var/run/postgresql itself in the
future..
- use autoreconf in stead of libtoolize for build to work on MES 5.1
- switch to snapshot tarball generated from V2_3_STABLE branch
- backport a fix making ssl connections hang
- add another configuration file for mirroring purposes
- add a provides for pgpool-II
- add dependency on postgresql-contrib, as we need dblink from it
* Mon Jul 12 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 2.3.3-1mdv2011.0
+ Revision: 551253
- convert TODO file into UTF-8
- fix group of devel package
- add a note regarding obsoletes
- use %%posttrans rather than %%post
- add missing 'Requires(post,preun): rpm-helper'
- fix incorrect group
- fix mixed-use-of-spaces-and-tabs
- add some more content to sysconfig file
- add logrotate
- set daemon output loggin through configuration rather by an argument
- fix proper regexp for configuration files to get proper naming..
- add dependency on postgresql-server
- import postgresql-pgpool-II
* Tue Jun 29 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 2.3.3-1
- Update to 2.3.3
- verify that child process forked actually survives and return the dead
child process' exit code in stead of default success code if it happens to
die (P2)
- add support for logging directly to file when running as daemon, so one
doesn't have to mess with job control, output redirection etc. (P1)
- fix string format warnings (P0)
- enable openssl support
- rewrite init script
- adapt to Mandriva Linux
* Fri Dec 25 2009 Devrim GUNDUZ <devrim@gunduz.org> - 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 <devrim@gunduz.org> - 2.2.6-1
- Update to 2.2.6
* Sun Nov 01 2009 Devrim GUNDUZ <devrim@gunduz.org> - 2.2.5-2
- Remove init script from all runlevels before uninstall. Per RH Bugzilla
#532177
* Sun Oct 4 2009 Devrim Gunduz <devrim@CommandPrompt.com> 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 <devrim@CommandPrompt.com> 2.2.4-1
- Update to 2.2.4
- Re-apply a fix for #442372
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu May 7 2009 Devrim Gunduz <devrim@CommandPrompt.com> 2.2.2-1
- Update to 2.2.2
* Mon Mar 23 2009 Devrim Gunduz <devrim@CommandPrompt.com> 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 <devrim@CommandPrompt.com> 2.2-1
- Update to 2.2
- Update URL
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Dec 4 2008 Michael Schwendt <mschwendt@fedoraproject.org> 2.1-2
- Include /usr/share/pgpool-II directory.
* Tue Aug 12 2008 Devrim Gunduz <devrim@CommandPrompt.com> 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 <devrim@CommandPrompt.com> 2.1-0.2.beta2
- Fix Requires: issue, per #442021 (Alex Lancaster)
* Sun Apr 6 2008 Devrim Gunduz <devrim@CommandPrompt.com> 2.1-beta2
- Update to 2.1 beta2
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.0.1-3.1
- Autorebuild for GCC 4.3
* Mon Jan 21 2008 Devrim GUNDUZ <devrim@commandprompt.com> 2.0.1-2.1
- Rebuilt against PostgreSQL 8.3
* Sat Jan 19 2008 Devrim Gunduz <devrim@CommandPrompt.com> 2.0.1-2
- Fix Requires of -devel package, per bz#429436
* Sun Jan 13 2008 Devrim Gunduz <devrim@CommandPrompt.com> 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 <devrim@CommandPrompt.com> 1.3-1
- Update to 1.3
* Fri Oct 5 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.2.1-1
- Update to 1.2.1
* Wed Aug 29 2007 Devrim Gunduz <devrim@CommandPrompt.com> 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 <devrim@CommandPrompt.com> 1.2-4
- Fixed the directory name where sample conf files and sql files
are installed.
* Sun Aug 5 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.2-3
- Added a patch for sample conf file to use Fedora defaults
* Sun Aug 5 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.2-2
- Added an init script for pgpool
- Added /etc/sysconfig/pgpool
* Wed Aug 1 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.2-1
- Update to 1.2
* Fri Jun 15 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.1.1-1
- Update to 1.1.1
* Sat Jun 2 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.1-1
- Update to 1.1
- added --disable-rpath configure parameter.
- Chowned sample conf files, so that they can work with pgpoolAdmin.
* Thu Apr 22 2007 Devrim Gunduz <devrim@CommandPrompt.com> 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.
* Thu Apr 22 2007 Devrim Gunduz <devrim@CommandPrompt.com> 1.0.2-3
- Rebuilt for the correct tarball
- Fixed man8 file ownership, per bugzilla review #229321
* Tue Feb 20 2007 Jarod Wilson <jwilson@redhat.com> 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 <devrim@commandprompt.com> 1.0.2-1
- Update to 1.0.2-1
* Mon Oct 02 2006 Devrim Gunduz <devrim@commandprompt.com> 1.0.1-5
- Rebuilt
* Mon Oct 02 2006 Devrim Gunduz <devrim@commandprompt.com> 1.0.1-4
- Added -libs and RPM
- Fix .so link problem
- Cosmetic changes to spec file
* Thu Sep 27 2006 - Devrim GUNDUZ <devrim@commandprompt.com> 1.0.1-3
- Fix spec, per Yoshiyuki Asaba
* Thu Sep 26 2006 - Devrim GUNDUZ <devrim@commandprompt.com> 1.0.1-2
- Fixed rpmlint errors
- Fixed download url
- Added ldconfig for .so files
* Thu Sep 21 2006 - David Fetter <david@fetter.org> 1.0.1-1
- Initial build pgpool-II 1.0.1 for PgPool Global Development Group