spec: create /var/run/pgpool immediately

Version: 3.3.3-2
Related: #1094713
This commit is contained in:
Pavel Raiskup 2014-06-12 15:38:04 +02:00
commit ebf52bc5e1
2 changed files with 13 additions and 7 deletions

View file

@ -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@redhat.com> - 3.3.3-2
- create %%_varrundir after installation, specify it on one place,
* Thu Jun 05 2014 Jozef Mlich <jmlich@redhat.com> - 3.3.3-1
- adding tmpfiles.d (allow pid file to be created in /var/run/pgpool - dir
created after reboot)

View file

@ -1 +0,0 @@
d /var/run/pgpool 0755 root root -