Blob Blame History Raw
# Compatibility macro wrappers for legacy RPM versions that do not
# support conditional builds
%{!?bcond_without: %{expand: %%global bcond_without() %%{expand:%%%%{!?_without_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?bcond_with:    %{expand: %%global bcond_with()    %%{expand:%%%%{?_with_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?with:          %{expand: %%global with()          %%{expand:%%%%{?with_%%{1}:1}%%%%{!?with_%%{1}:0}}}}
%{!?without:       %{expand: %%global without()       %%{expand:%%%%{?with_%%{1}:0}%%%%{!?with_%%{1}:1}}}}

# Conditionals
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
# to disable or enable specific features
%bcond_without udev
%bcond_without pacemaker
%bcond_with rgmanager
# conditionals may not contain "-" nor "_", hence "bashcompletion"
%bcond_without bashcompletion
# --with xen is ignored on any non-x86 architecture
%bcond_without xen
%ifnarch %{ix86} x86_64
%global _without_xen --without-xen
%endif

Name: drbd
Summary: DRBD driver for Linux
Version: 8.9.0
Release: 1%{?dist}
Source0: http://oss.linbit.com/%{name}/%{name}-utils-%{version}.tar.gz
Source1: drbd.service
License: GPLv2+
ExclusiveOS: linux
Group: System Environment/Kernel
URL: http://www.drbd.org/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: flex
Requires: %{name}-utils = %{version}
%if %{with udev}
Requires: %{name}-udev = %{version}
BuildRequires: udev
%endif

%description
DRBD mirrors a block device over the network to another machine.
Think of it as networked raid 1. It is a building block for
setting up high availability (HA) clusters.

This is a virtual package, installing the full DRBD user-land suite.

# Just a few docs go into the "drbd" package. Everything else is part
# of one of the drbd-* packages.
%files
%defattr(-,root,root,-)
%doc COPYING
%doc ChangeLog
%doc README

%package utils
Summary: Management utilities for DRBD
Group: System Environment/Kernel
Requires(post): chkconfig
Requires(preun): chkconfig

%description utils
DRBD mirrors a block device over the network to another machine.
Think of it as networked raid 1. It is a building block for
setting up high availability (HA) clusters.

This packages includes the DRBD administration tools.

%files utils
%defattr(755,root,root,-)
/usr/sbin/drbdsetup
/usr/sbin/drbdadm
/usr/sbin/drbdmeta
/lib/drbd/drbdadm-83
/lib/drbd/drbdsetup-83
/lib/drbd/drbdadm-84
/lib/drbd/drbdsetup-84
%attr(0644,root,root) %{_unitdir}/drbd.service
%{_sbindir}/drbd-overview
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/outdate-peer.sh
%{_prefix}/lib/%{name}/snapshot-resync-target-lvm.sh
%{_prefix}/lib/%{name}/unsnapshot-resync-target-lvm.sh
%{_prefix}/lib/%{name}/notify-out-of-sync.sh
%{_prefix}/lib/%{name}/notify-split-brain.sh
%{_prefix}/lib/%{name}/notify-emergency-reboot.sh
%{_prefix}/lib/%{name}/notify-emergency-shutdown.sh
%{_prefix}/lib/%{name}/notify-io-error.sh
%{_prefix}/lib/%{name}/notify-pri-lost-after-sb.sh
%{_prefix}/lib/%{name}/notify-pri-lost.sh
%{_prefix}/lib/%{name}/notify-pri-on-incon-degr.sh
%{_prefix}/lib/%{name}/notify.sh
%{_prefix}/lib/%{name}/stonith_admin-fence-peer.sh


%defattr(-,root,root,-)
%dir %{_var}/lib/%{name}
%config(noreplace) %{_sysconfdir}/drbd.conf
%dir %{_sysconfdir}/drbd.d
%config(noreplace) %{_sysconfdir}/drbd.d/global_common.conf
%{_mandir}/man5/drbd.conf-8.3.5.gz
%{_mandir}/man5/drbd.conf-8.4.5.gz
%{_mandir}/man5/drbd.conf-9.0.5.gz
%{_mandir}/man5/drbd.conf.5.gz
%{_mandir}/man8/drbd-8.3.8.gz
%{_mandir}/man8/drbd-8.4.8.gz
%{_mandir}/man8/drbd-9.0.8.gz
%{_mandir}/man8/drbd.8.gz
%{_mandir}/man8/drbdadm-8.3.8.gz
%{_mandir}/man8/drbdadm-8.4.8.gz
%{_mandir}/man8/drbdadm-9.0.8.gz
%{_mandir}/man8/drbdadm.8.gz
%{_mandir}/man8/drbdmeta-8.3.8.gz
%{_mandir}/man8/drbdmeta-8.4.8.gz
%{_mandir}/man8/drbdmeta-9.0.8.gz
%{_mandir}/man8/drbdmeta.8.gz
%{_mandir}/man8/drbdsetup-8.3.8.gz
%{_mandir}/man8/drbdsetup-8.4.8.gz
%{_mandir}/man8/drbdsetup-9.0.8.gz
%{_mandir}/man8/drbdsetup.8.gz
%doc scripts/drbd.conf.example
%doc COPYING
%doc ChangeLog
%doc README

%ifarch %{ix86} x86_64
%if %{with xen}
%package xen
Summary: Xen block device management script for DRBD
Group: System Environment/Kernel
Requires: %{name}-utils = %{version}-%{release}
Requires: xen


%description xen
This package contains a Xen block device helper script for DRBD, capable of
promoting and demoting DRBD resources as necessary.

%files xen
%defattr(755,root,root,-)
%{_sysconfdir}/xen/scripts/block-drbd
%endif # with xen
%endif # arch %{ix86} x86_64

%if %{with udev}
%package udev
Summary: udev integration scripts for DRBD
Group: System Environment/Kernel
Requires: %{name}-utils = %{version}-%{release}, udev


%description udev
This package contains udev helper scripts for DRBD, managing symlinks to
DRBD devices in /dev/drbd/by-res and /dev/drbd/by-disk.

%files udev
%defattr(-,root,root,-)
%config %{_sysconfdir}/udev/rules.d/65-drbd.rules*
%endif # with udev

%if %{with pacemaker}
%package pacemaker
Summary: Pacemaker resource agent for DRBD
Group: System Environment/Base
Requires: %{name}-utils = %{version}-%{release}
Requires: pacemaker
License: GPLv2


%description pacemaker
This package contains the master/slave DRBD resource agent for the
Pacemaker High Availability cluster manager.

%files pacemaker
%defattr(755,root,root,-)
%{_prefix}/lib/%{name}/crm-fence-peer.sh
%{_prefix}/lib/%{name}/crm-unfence-peer.sh
%{_prefix}/lib/ocf/resource.d/linbit/drbd
%endif # with pacemaker

%if %{with rgmanager}
%package rgmanager
Summary: Red Hat Cluster Suite agent for DRBD
Group: System Environment/Base
Requires: %{name}-utils = %{version}-%{release}, rgmanager < 3
Conflicts: resource-agents >= 3


%description rgmanager
This package contains the DRBD resource agent for the Red Hat Cluster Suite
resource manager.

As of Red Hat Cluster Suite 3.0.1, the DRBD resource agent is included
in the Cluster distribution.

%files rgmanager
%defattr(755,root,root,-)
%{_datadir}/cluster/drbd.sh

%defattr(-,root,root,-)
%{_datadir}/cluster/drbd.metadata
%endif # with rgmanager

%if %{with bashcompletion}
%package bash-completion
Summary: Programmable bash completion support for drbdadm
Group: System Environment/Base
Requires: %{name}-utils = %{version}-%{release}


%description bash-completion
This package contains programmable bash completion support for the drbdadm
management utility.

%files bash-completion
%defattr(-,root,root,-)
%config %{_sysconfdir}/bash_completion.d/drbdadm*
%endif # with bashcompletion


%prep
%setup -q -n drbd-utils-%{version}

%build
%configure \
    --with-utils \
    --without-km \
    %{?_without_udev} \
    %{?_without_xen} \
    %{?_without_pacemaker} \
    %{?_with_rgmanager} \
    %{?_without_bashcompletion}
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
install -d -m755 $RPM_BUILD_ROOT/%{_unitdir}
install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/drbd.service
rm -f $RPM_BUILD_ROOT/%{_initddir}/drbd

%clean
rm -rf %{buildroot}

%post utils
chkconfig --add drbd
%if %{without udev}
for i in `seq 0 15` ; do
    test -b /dev/drbd$i || mknod -m 0660 /dev/drbd$i b 147 $i;
done
%endif #without udev

%preun utils
if [ $1 -eq 0 ]; then
        %{_initrddir}/drbd stop >/dev/null 2>&1
        /sbin/chkconfig --del drbd
fi


%changelog
* Mon Aug 04 2014 Major Hayden <major@mhtx.net> - 8.9.0-2
- Added systemd unit file for drbd

* Fri Jul 25 2014 Major Hayden <major@mhtx.net> - 8.9.0-1
- New upstream release 8.9.0.  DRBD utilities are now split from the kernel modules.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Mar 31 2014 Major Hayden <major@mhtx.net> - 8.4.4-1
- New upstream release 8.4.4.

* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 8.4.3-2
- Perl 5.18 rebuild

* Wed Jul 31 2013 Major Hayden <major@mhtx.net> - 8.4.3-1
- New upstream release.

* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 8.4.2-4
- Perl 5.18 rebuild

* Thu Jun 20 2013 Major Hayden <major@mhtx.net> - 8.4.2-3
- Removed heartbeat package
- Corrected Source0 URL

* Mon Mar 11 2013 Karsten Hopp <karsten@redhat.com> 8.4.2-2
- work around macro expansion problems on PPC64

* Thu Mar 07 2013 Major Hayden <major@mhtx.net> - 8.4.2-1
- Version bump to match F18 kernel modules

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.3.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Nov 04 2012 Major Hayden <major@mhtx.net> - 8.3.13-1
- Version bump to match F17/F18 kernel modules

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.3.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Apr 01 2012 Major Hayden <major@mhtx.net> - 8.3.11-5
- Removed bash completion dependency (#807633)

* Mon Feb 20 2012 Major Hayden <major@mhtx.net> - 8.3.11-4
- Removed heartbeat, pacemaker, and rgmanager requirements in main drbd package.

* Tue Feb 14 2012 Oliver Falk <oliver@linux-kernel.at> - 8.3.11-3
- Don't require xen in the main package if built with xen

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.3.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Aug 03 2011 Major Hayden <major@mhtx.net> - 8.3.11-1
- New upstream release.

* Mon Mar 14 2011 Major Hayden <major@mhtx.net> - 8.3.9-1
- New upstream release.
- Matches DRBD modules in 2.6.38 for Fedora 15.

* Tue Mar 01 2011 Major Hayden <major@mhtx.net> - 8.3.8.1-1
- New upstream release.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.3.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild