9595304
Summary:         A program for managing links into a DRBD shared partition
9595304
Name:            drbdlinks
9595304
Version:         1.17
9595304
Release:         1%{?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
9595304
Patch0:          drbdlinks-1.17-cron.patch
9595304
Requires:        python, heartbeat
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
9595304
%patch0 -p1 -b .cron
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
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
9595304
%{_sbindir}/%{name}
9595304
%{_sysconfdir}/ha.d/resource.d/%{name}
9595304
%{_mandir}/man8/%{name}.8*
9595304
%{_localstatedir}/run/%{name}/
9595304
9595304
%changelog
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