9595304
Summary:         A program for managing links into a DRBD shared partition
9595304
Name:            drbdlinks
cbc2f6c
Version:         1.19
1c3013d
Release:         2%{?dist}
9595304
License:         GPLv2
9595304
Group:           Applications/System
9595304
URL:             http://www.tummy.com/Community/software/%{name}/
9595304
Source0:         ftp://ftp.tummy.com/pub/tummy/%{name}/%{name}-%{version}.tar.gz
9595304
Source1:         drbdlinksclean
1c3013d
Source2:         drbdlinks.logrotate
1c3013d
Source3:         drbdlinks.tmpfiles
1c3013d
Patch0:          drbdlinks-1.19-selinux.patch
cbc2f6c
Requires:        python
9595304
Requires(post):  /sbin/chkconfig
9595304
Requires(preun): /sbin/chkconfig
9595304
BuildArch:       noarch
9595304
BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9595304
9595304
%description
9595304
The drbdlinks program manages links into a DRBD partition which is shared
9595304
among several machines. A simple configuration file, "/etc/drbdlinks.conf",
9595304
specifies the links. This can be used to manage e.g. links for /etc/httpd,
9595304
/var/lib/pgsql and other system directories that need to appear as if they
9595304
are local to the system when running applications after the drbd shared
9595304
partition has been mounted.
9595304
9595304
When running drbdlinks with "start" as the mode, drbdlinks will rename the
9595304
existing files/directories and then make symbolic links into the DRBD
9595304
partition, "stop" does the reverse. By default, rename appends ".drbdlinks"
9595304
to the name, but this can be overridden.
9595304
9595304
An init script is included which runs "stop" before heartbeat starts, and
9595304
after heartbeat stops. This is done to try to ensure that when the shared
9595304
partition isn't mounted, the links are in their normal state.
9595304
9595304
%prep
9595304
%setup -q
1c3013d
%patch0 -p1 -b .selinux
9595304
9595304
%build
9595304
9595304
%install
9595304
rm -rf $RPM_BUILD_ROOT
9595304
9595304
# Create the needed directories
f0d024d
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/{ha.d/resource.d,rc.d/init.d},%{_mandir}/man8}
9595304
mkdir -p $RPM_BUILD_ROOT{%{_sbindir},%{_localstatedir}/run/%{name}/configs-to-clean}
9595304
9595304
# Install the files and symlinks
9595304
install -p -m 755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
9595304
ln -s ../../..%{_sbindir}/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/%{name}
9595304
install -p -m 644 %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
f0d024d
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/drbdlinksclean
9595304
install -p -m 644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
9595304
1c3013d
# Install logrotate extension
1c3013d
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
1c3013d
1c3013d
# Install tmpfiles configuration
1c3013d
%if 0%{?fedora} >= 15
1c3013d
install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
1c3013d
%endif
1c3013d
9595304
%clean
9595304
rm -rf $RPM_BUILD_ROOT
9595304
9595304
%post
9595304
/sbin/chkconfig --add drbdlinksclean
9595304
9595304
%preun
9595304
if [ $1 -eq 0 ]; then
9595304
  /sbin/service drbdlinksclean stop > /dev/null 2>&1 || :
9595304
  /sbin/chkconfig --del drbdlinksclean
9595304
fi
9595304
9595304
%files
9595304
%defattr(-,root,root,-)
9595304
%doc LICENSE README WHATSNEW
f0d024d
%{_sysconfdir}/rc.d/init.d/drbdlinksclean
9595304
%config(noreplace) %{_sysconfdir}/%{name}.conf
1c3013d
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
1c3013d
%if 0%{?fedora} >= 15
1c3013d
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
1c3013d
%endif
9595304
%{_sbindir}/%{name}
cbc2f6c
%{_sysconfdir}/ha.d/
9595304
%{_mandir}/man8/%{name}.8*
9595304
%{_localstatedir}/run/%{name}/
9595304
9595304
%changelog
1c3013d
* Sun Jul 17 2011 Robert Scheck <robert@fedoraproject.org> 1.19-2
1c3013d
- Handle visible SELinux range label if mcstrans is not used
1c3013d
- Added configuration file for tmpfiles handling (#656578)
1c3013d
- Added logrotate configuration to ignore possible *.drbdlinks
1c3013d
cbc2f6c
* Mon May 16 2011 Robert Scheck <robert@fedoraproject.org> 1.19-1
cbc2f6c
- Upgrade to 1.19
cbc2f6c
55e8dd9
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18-3
55e8dd9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
55e8dd9
d231e61
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.18-2
d231e61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
d231e61
e3395ad
* Sun May 24 2009 Robert Scheck <robert@fedoraproject.org> 1.18-1
e3395ad
- Upgrade to 1.18
e3395ad
9595304
* Tue May 18 2009 Robert Scheck <robert@fedoraproject.org> 1.17-1
9595304
- Upgrade to 1.17
9595304
9595304
* Sun May 17 2009 Robert Scheck <robert@fedoraproject.org> 1.16-1
9595304
- Upgrade to 1.16
9595304
9595304
* Sat May 16 2009 Robert Scheck <robert@fedoraproject.org> 1.15-1
9595304
- Upgrade to 1.15
9595304
- Initial spec file for Fedora and Red Hat Enterprise Linux