# $Id: smeserver-postgresql.spec,v 1.4 2008/11/25 16:20:28 slords Exp $ # Authority: charliebrady # Name: Charlie Brady Summary: e-smith specific postgresql configuration and templates. %define name smeserver-postgresql Name: %{name} %define version 0.0.1 %define release 24 Version: %{version} Release: %{release}%{?dist} License: GPL Group: Networking/Daemons Source: %{name}-%{version}.tar.gz Patch0: smeserver-postgresql-0.0.1.chpst.patch Patch1: smeserver-postgresql-0.0.1.config_templates.patch Patch2: smeserver-postgresql-0.0.1.chpst.patch2 Patch3: smeserver-postgresql-0.0.1.config_templates.patch2 Patch4: smeserver-postgresql-0.0.1.restore.patch Patch5: smeserver-postgresql-0.0.1.restore.patch2 Patch6: smeserver-postgresql-0.0.1.tcpip_socket.patch Patch7: smeserver-postgresql-0.0.1.permissions.patch Patch8: smeserver-postgresql-0.0.1.chpst.patch3 Patch9: smeserver-postgresql-0.0.1.permissions.patch2 Patch10: smeserver-postgresql-0.0.1.tcpip_socket.patch2 Patch11: smeserver-postgresql-0.0.1.startup.patch Patch12: smeserver-postgresql-0.0.1.sigterm.patch Patch13: smeserver-postgresql-0.0.1.disabled_pre_backup.patch Patch14: smeserver-postgresql-0.0.1.restore.patch3 Patch15: smeserver-postgresql-0.0.1.restore.patch4 Patch16: smeserver-postgresql-0.0.1.restore.patch5 Patch17: smeserver-postgresql-0.0.1.restore.patch6 Patch18: smeserver-postgresql-0.0.1.tcpip_socket.patch3 Patch19: smeserver-postgresql-0.0.1.tcpip_socket.patch4 BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Requires: e-smith-base Requires: postgresql Requires: postgresql-server Requires: e-smith-lib >= 1.15.1-19 BuildRequires: e-smith-devtools >= 1.13.1-03 AutoReqProv: no %changelog * Tue Sep 11 2007 Charlie Brady 0.0.1-24 - Add support for localhost/private/public access settings to determine which network interfaces to bind to. * Thu May 24 2007 Charlie Brady 0.0.1-23 - Determine correct format for network access specs in postgresql.conf at template expansion time (postgresql 7 and 8 need different directives). * Sun Apr 29 2007 Shad L. Lords - Clean up spec so package can be built by koji/plague * Tue Feb 06 2007 Charlie Brady 0.0.1-22 - Escape braces in full restore template. * Thu Dec 07 2006 Shad L. Lords - Update to new release naming. No functional changes. - Make Packager generic * Fri Dec 01 2006 Charlie Brady 0.0.1-21 - Tighten permissions of dump file so that it is never world readable. - Fix restore scriptlet so that it exits silently if there is no dump to restore from. - Fix taint problem with restore script. - Fix services2adjust symlink names so that postgresl is stopped prior to restore, and restarted during timezone change. * Wed Oct 18 2006 Charlie Brady 0.0.1-20 - Expand template for 00_restore_backup pgsql.init script during pre-restore event, so that the dump is restored following next reboot. * Tue Oct 17 2006 Charlie Brady 0.0.1-19 - Fix permissions problem with restore from backup. * Mon Sep 25 2006 Charlie Brady 0.0.1-18 - Ensure that pre-backup event does not fail if postgresql is disabled. - Apply sigterm patch - included in -17 source, but not applied in build. * Thu Sep 21 2006 Charlie Brady 0.0.1-17 - Add control/t script so that SIGINT is used to terminate postgresql (so that existing connections cannot keep the server up indefinitely). * Thu Sep 14 2006 Charlie Brady 0.0.1-16 - Fix run script so that conf templates are not run until after initdb. * Thu Sep 7 2006 Charlie Brady 0.0.1-15 - Fix permissions of run files (typo). * Tue Aug 29 2006 Charlie Brady 0.0.1-14 - Fix comparison operator in tcpip template fragment. * Tue Aug 29 2006 Charlie Brady 0.0.1-13 - Fix ownership of config files (typo). * Tue Aug 29 2006 Charlie Brady 0.0.1-12 - Run all pgsql.init scripts is user 'postgres'. * Thu Aug 24 2006 Charlie Brady 0.0.1-11 - Require passwords for local socket and loopback socket connections except for 'postgres' user connecting via Unix domain socket. * Mon Aug 21 2006 Charlie Brady 0.0.1-10 - Add option to accept connections on tcpip socket. * Fri Aug 04 2006 Charlie Brady 0.0.1-09 - Fix permissions on log/run file, and fix name of pgsql/init directory. * Wed Jun 28 2006 Charlie Brady - [0.0.1-08] - Deal more correctly with pgsql.init startup race condition. * Wed Jun 28 2006 Charlie Brady - [0.0.1-07] - Add full database restore feature. * Wed Jun 28 2006 Charlie Brady - [0.0.1-06] - Move config templates to the correct place. - Fix delete-db action to remove empty subdirectories of /var/lib/pgsql/data. * Wed Jun 28 2006 Charlie Brady - [0.0.1-05] - Use chpst rather than setuidgid in run script. * Wed Jun 28 2006 Charlie Brady - [0.0.1-04] - Add minimal templated configuration files. * Wed Jun 28 2006 Charlie Brady - [0.0.1-03] - Fix broken pqsql.init. * Wed Jun 28 2006 Charlie Brady - [0.0.1-02] - Add missing /etc/e-smith/pgsql/init directory * Wed May 24 2006 Charlie Brady - [0.0.1-01] - initial release %description This package adds necessary startup and configuration items for postgresql. %prep %setup %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %build mkdir -p root/etc/e-smith/pgsql/init perl createlinks mkdir -p root/etc/rc.d/init.d/supervise ln -s ../daemontools root/etc/rc.d/init.d/supervise/postgresql mkdir -p root/etc/rc.d/rc7.d ln -s /etc/rc.d/init.d/e-smith-service root/etc/rc.d/rc7.d/S50postgresql ln -s /etc/rc.d/init.d/e-smith-service root/etc/rc.d/rc7.d/S99pgsql.init mkdir -p root/service ln -s /var/service/postgresql root/service touch root/var/service/postgresql/down mkdir -p root/var/log/postgresql mkdir -p root/home/e-smith/db/pgsql mkdir -p root/etc/e-smith/pgsql/init %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ --file /var/service/postgresql/run 'attr(0750,root,root)' \ --file /var/service/postgresql/log/run 'attr(0750,root,root)' \ --file /var/service/postgresql/control/t 'attr(0750,root,root)' \ --dir '/var/log/postgresql' 'attr(2750,smelog,smelog)' \ --dir '/home/e-smith/db' 'attr(0750,root,root)' \ --dir '/home/e-smith/db/pgsql' 'attr(0750,root,root)' \ > %{name}-%{version}-filelist echo "%doc COPYING" >> %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %files -f %{name}-%{version}-filelist %defattr(-,root,root)