[postgresql-pgpool-II] spec: create /var/run/pgpool immediately

Pavel Raiskup praiskup at fedoraproject.org
Thu Jun 12 13:55:36 UTC 2014


commit 3aac5cda4d120c4186c6302ca411ac22aaf42345
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Thu Jun 12 15:38:04 2014 +0200

    spec: create /var/run/pgpool immediately
    
    Version: 3.3.3-2
    Related: #1094713

 postgresql-pgpool-II.spec       |   19 +++++++++++++------
 postgresql-pgpool-II.tmpfiles.d |    1 -
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/postgresql-pgpool-II.spec b/postgresql-pgpool-II.spec
index 08c2a85..365789a 100644
--- a/postgresql-pgpool-II.spec
+++ b/postgresql-pgpool-II.spec
@@ -5,10 +5,12 @@
 %define 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.3.3
-Release:		1%{?dist}
+Release:		2%{?dist}
 License:		BSD
 Group:			Applications/Databases
 URL:			http://pgpool.net
@@ -16,13 +18,12 @@ Source0:		http://www.pgpool.net/download.php?f=%{short_name}-%{version}.tar.gz
 Source1:        	pgpool.service
 Source2:        	pgpool.sysconfig
 Source3:		pgpool.init
-Source4:		postgresql-pgpool-II.tmpfiles.d
 Patch1:			pgpool-3.1-conf.sample.patch
 BuildRequires:		postgresql-devel pam-devel
 %if %{systemd_enabled}
 BuildRequires:		systemd
 # We require this to be present for %%{_prefix}/lib/tmpfiles.d
-Requires: systemd-units
+Requires:		systemd
 Requires(post):		systemd-sysv
 Requires(post):		systemd
 Requires(preun):	systemd
@@ -98,7 +99,9 @@ install -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/pgpool.service
 
 # ... and make a tmpfiles script to recreate it at reboot.
 mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
-install -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql-pgpool-II.conf
+cat > $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf <<EOF
+d %{_varrundir} 0755 root root -
+EOF
 
 %else
 install -d %{buildroot}%{_sysconfdir}/init.d
@@ -119,6 +122,7 @@ rm -f %{buildroot}%{_libdir}/libpcp.{a,la}
 # This adds the proper /etc/rc*.d links for the script
 /sbin/chkconfig --add pgpool
 %endif
+%tmpfiles_create
 
 %preun
 %if %{systemd_enabled}
@@ -178,8 +182,8 @@ fi
 %{_libdir}/libpcp.so.*
 %{_datadir}/%{short_name}/pgpool.pam
 %if %{systemd_enabled}
-
-%{_tmpfilesdir}/postgresql-pgpool-II.conf
+%ghost %{_varrundir}
+%{_tmpfilesdir}/%{name}.conf
 %{_unitdir}/pgpool.service
 %else
 %{_sysconfdir}/init.d/pgpool
@@ -204,6 +208,9 @@ fi
 %doc sample/pgpool_recovery*
 
 %changelog
+* Thu Jun 12 2014 Pavel Raiskup <praiskup at redhat.com> - 3.3.3-2
+- create %%_varrundir after installation, specify it on one place,
+
 * Thu Jun 12 2014 Jozef Mlich <jmlich at redhat.com> - 3.3.3-1
 - adding tmpfiles.d (allow pid file to be created in /var/run/pgpool - dir
   created after reboot)


More information about the scm-commits mailing list