# # spec file for package drbd (Version 8.3.7) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %{!?_initddir: %{expand: %%global _initddir %{_initrddir}}} # 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 " or "rpmbuild --with " # to disable or enable specific features %bcond_without udev %bcond_without pacemaker %bcond_with rgmanager %bcond_without heartbeat %ifarch %ix86 x86_64 %bcond_without xen %else %bcond_with xen %endif # conditionals may not contain "-" nor "_", hence "bashcompletion" %bcond_without bashcompletion Name: drbd Summary: Distributed Replicated Block Device Version: 8.3.7 Release: 0. Source: http://oss.linbit.com/%{name}/8.3/%{name}-%{version}.tar.gz License: GPL v2 or later ExclusiveOS: linux Group: Productivity/Clustering/HA Url: http://www.drbd.org/ Patch100: init-script-suse.diff Patch101: drbd-disable-usage-counter.diff Patch1: 0001-drbd-fix-max_segment_size-initialization.patch Patch2: 0002-drbd-null-dereference-bug.patch Patch3: 0003-drbdadm-fix-potential-access-after-free.patch Patch4: 0004-snapshot-resync-target-handler-fix-endless-loop-in-o.patch Patch5: 0005-drbd-fix-NULL-pointer-dereference-on-4k-hard-sect-si.patch Patch6: 0006-drbd-fix-broken-state-change-after-split-brain-attac.patch Patch7: 0007-fix-segfault-in-drbdadm-parser.patch Patch8: 0008-fix-unit-of-rs_same_csums-accounting.patch Patch9: 0009-drbd_disconnect-grab-meta.socket-mutex-as-well.patch Patch10: 0010-add-missing-drbd-command-names-to-avoid-NULL-in-erro.patch Patch11: 0011-Reduce-the-time-an-empty-resync-takes-usually.patch Patch12: 0012-Make-sure-we-do-not-send-state-updates-during-an-emp.patch Patch13: 0013-Forcing-primary-should-also-work-for-Consistent-disk.patch Patch14: 0014-drbd-fix-al-to-on-disk-bitmap-for-4k-logical_block_s.patch Patch15: 0015-Removed-that-mystical-UTF-character-trailing-white-s.patch Patch16: 0016-drbd-Do-not-upgrade-state-to-Outdated-if-already-Inc.patch Patch17: 0017-fix-regression-attach-while-connected-failed.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: flex gcc glibc-devel make %if %{with udev} BuildRequires: udev %endif Requires: %{name}-utils = %{version} %if %{with xen} Requires: %{name}-xen = %{version} BuildRequires: xen-tools %endif %if %{with pacemaker} Requires: %{name}-pacemaker = %{version} %endif %if %{with rgmanager} Requires: %{name}-rgmanager = %{version} %endif %if %{with heartbeat} Requires: %{name}-heartbeat = %{version} %endif %if %{with bashcompletion} Requires: %{name}-bash-completion = %{version} %endif Requires: drbd-kmp %description Drbd is a distributed replicated block device. It 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 clusters. Authors: -------- Philipp Reisner Lars Ellenberg %files %defattr(-,root,root,-) %doc COPYING %doc ChangeLog %doc README %package utils License: GPL v2 or later Summary: Management utilities for DRBD Group: Productivity/Clustering/HA %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. Authors: -------- Philipp Reisner Lars Ellenberg %files utils %defattr(755,root,root,-) /sbin/drbdsetup /sbin/drbdadm /sbin/drbdmeta %{_initddir}/%{name} %{_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 /sbin/rcdrbd %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}/man8/drbd.8.* %{_mandir}/man8/drbdsetup.8.* %{_mandir}/man8/drbdadm.8.* %{_mandir}/man5/drbd.conf.5.* %{_mandir}/man8/drbdmeta.8.* %doc scripts/drbd.conf %doc COPYING %doc ChangeLog %doc README %if %{with xen} %package xen License: GPL v2 or later Summary: Xen block device management script for DRBD Group: Productivity/Clustering/HA Requires: %{name}-utils = %{version}-%{release}, xen %description xen This package contains a Xen block device helper script for DRBD, capable of promoting and demoting DRBD resources as necessary. Authors: -------- Philipp Reisner Lars Ellenberg %files xen %defattr(755,root,root,-) %dir %{_sysconfdir}/xen %dir %{_sysconfdir}/xen/scripts %{_sysconfdir}/xen/scripts/block-drbd %endif # with xen %if %{with udev} %package udev License: GPL v2 or later Summary: udev integration scripts for DRBD Group: Productivity/Clustering/HA 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. Authors: -------- Philipp Reisner Lars Ellenberg %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: Productivity/Clustering/HA Requires: %{name}-utils = %{version}-%{release}, pacemaker License: GPL v2 or later %description pacemaker This package contains the master/slave DRBD resource agent for the Pacemaker High Availability cluster manager. Authors: -------- Philipp Reisner Lars Ellenberg %files pacemaker %defattr(755,root,root,-) %{_prefix}/lib/%{name}/crm-fence-peer.sh %{_prefix}/lib/%{name}/crm-unfence-peer.sh %dir %{_prefix}/lib/ocf %dir %{_prefix}/lib/ocf/resource.d %dir %{_prefix}/lib/ocf/resource.d/linbit %{_prefix}/lib/ocf/resource.d/linbit/drbd %endif # with pacemaker %if %{with rgmanager} %package rgmanager License: GPL v2 or later Summary: Distributed Replicated Block Device Group: Productivity/Clustering/HA Requires: %{name}-utils = %{version}-%{release}, rgmanager < 3 Conflicts: resource-agents >= 3 %description rgmanager Drbd is a distributed replicated block device. It 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 clusters. Authors: -------- Philipp Reisner Lars Ellenberg %files rgmanager %defattr(755,root,root,-) %{_datadir}/cluster/drbd.sh %defattr(-,root,root,-) %{_datadir}/cluster/drbd.metadata %endif # with rgmanager %if %{with heartbeat} %package heartbeat Summary: Heartbeat resource agent for DRBD Group: Productivity/Clustering/HA Requires: %{name}-utils = %{version}-%{release} License: GPL v2 or later %description heartbeat This package contains the DRBD resource agents for the Heartbeat cluster resource manager (in v1 compatibility mode). Authors: -------- Philipp Reisner Lars Ellenberg %files heartbeat %defattr(755,root,root,-) %dir %{_sysconfdir}/ha.d %dir %{_sysconfdir}/ha.d/resource.d %{_sysconfdir}/ha.d/resource.d/drbddisk %{_sysconfdir}/ha.d/resource.d/drbdupper %defattr(-,root,root,-) %{_mandir}/man8/drbddisk.8.* %endif # with heartbeat %if %{with bashcompletion} %package bash-completion License: GPL v2 or later Summary: Programmable bash completion support for drbdadm Group: Productivity/Clustering/HA Requires: %{name}-utils = %{version}-%{release} %description bash-completion This package contains programmable bash completion support for the drbdadm management utility. Authors: -------- Philipp Reisner Lars Ellenberg %files bash-completion %defattr(-,root,root,-) %config %{_sysconfdir}/bash_completion.d/drbdadm* %endif # with bashcompletion %prep %setup -q %patch100 -p1 %patch101 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %build %configure \ --with-utils \ --without-km \ %{?_without_udev} \ %{?_without_xen} \ %{?_without_pacemaker} \ %{?_without_heartbeat} \ %{?_with_rgmanager} \ %{?_without_bashcompletion} \ --with-initdir=%{_initddir} \ --with-distro=suse make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} # # We only want to install a hint to the example conf # cat <<___ > %{buildroot}%{_sysconfdir}/drbd.conf # # please have a a look at the example configuration file in # %{_docdir}/%{name}-utils/drbd.conf # # Note that you can use the YaST2 drbd module to configure this # service! # ___ %if %{without xen} rm -f %{buildroot}%{_sysconfdir}/xen/scripts/block-drbd | true %endif %clean rm -rf %{buildroot} %post utils %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 fi %changelog