Blob Blame History Raw
Summary:         A program for managing links into a DRBD shared partition
Name:            drbdlinks
Version:         1.19
Release:         2%{?dist}
License:         GPLv2
Group:           Applications/System
URL:   {name}/
Source1:         drbdlinksclean
Source2:         drbdlinks.logrotate
Source3:         drbdlinks.tmpfiles
Patch0:          drbdlinks-1.19-selinux.patch
Requires:        python
Requires(post):  /sbin/chkconfig
Requires(preun): /sbin/chkconfig
BuildArch:       noarch
BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

The drbdlinks program manages links into a DRBD partition which is shared
among several machines. A simple configuration file, "/etc/drbdlinks.conf",
specifies the links. This can be used to manage e.g. links for /etc/httpd,
/var/lib/pgsql and other system directories that need to appear as if they
are local to the system when running applications after the drbd shared
partition has been mounted.

When running drbdlinks with "start" as the mode, drbdlinks will rename the
existing files/directories and then make symbolic links into the DRBD
partition, "stop" does the reverse. By default, rename appends ".drbdlinks"
to the name, but this can be overridden.

An init script is included which runs "stop" before heartbeat starts, and
after heartbeat stops. This is done to try to ensure that when the shared
partition isn't mounted, the links are in their normal state.

%setup -q
%patch0 -p1 -b .selinux



# Create the needed directories
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/{ha.d/resource.d,rc.d/init.d},%{_mandir}/man8}
mkdir -p $RPM_BUILD_ROOT{%{_sbindir},%{_localstatedir}/run/%{name}/configs-to-clean}

# Install the files and symlinks
install -p -m 755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
ln -s ../../..%{_sbindir}/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/%{name}
install -p -m 644 %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/drbdlinksclean
install -p -m 644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8

# Install logrotate extension
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}

# Install tmpfiles configuration
%if 0%{?fedora} >= 15
install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf


/sbin/chkconfig --add drbdlinksclean

if [ $1 -eq 0 ]; then
  /sbin/service drbdlinksclean stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del drbdlinksclean

%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%if 0%{?fedora} >= 15
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf

* Sun Jul 17 2011 Robert Scheck <> 1.19-2
- Handle visible SELinux range label if mcstrans is not used
- Added configuration file for tmpfiles handling (#656578)
- Added logrotate configuration to ignore possible *.drbdlinks

* Mon May 16 2011 Robert Scheck <> 1.19-1
- Upgrade to 1.19

* Tue Feb 08 2011 Fedora Release Engineering <> - 1.18-3
- Rebuilt for

* Fri Jul 24 2009 Fedora Release Engineering <> - 1.18-2
- Rebuilt for

* Sun May 24 2009 Robert Scheck <> 1.18-1
- Upgrade to 1.18

* Tue May 18 2009 Robert Scheck <> 1.17-1
- Upgrade to 1.17

* Sun May 17 2009 Robert Scheck <> 1.16-1
- Upgrade to 1.16

* Sat May 16 2009 Robert Scheck <> 1.15-1
- Upgrade to 1.15
- Initial spec file for Fedora and Red Hat Enterprise Linux