diff --git a/disable_drbd_checkin.patch b/disable_drbd_checkin.patch new file mode 100644 index 0000000..316151e --- /dev/null +++ b/disable_drbd_checkin.patch @@ -0,0 +1,11 @@ +--- scripts/global_common.conf 2014-08-06 22:04:15.365264619 -0500 ++++ scripts/global_common.conf 2014-08-06 22:04:34.821218803 -0500 +@@ -3,7 +3,7 @@ + # feature requests visit http://www.linbit.com + + global { +- usage-count yes; ++ usage-count no; + # minor-count dialog-refresh disable-ip-verification + } + diff --git a/drbd.spec b/drbd.spec index cb97f77..e45870b 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,30 +1,10 @@ -# 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 -# 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 +Summary: DRBD user-land tools and scripts Version: 8.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Source0: http://oss.linbit.com/%{name}/%{name}-utils-%{version}.tar.gz Source1: drbd.service +Patch0: disable_drbd_checkin.patch License: GPLv2+ ExclusiveOS: linux Group: System Environment/Kernel @@ -32,31 +12,62 @@ 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. +DRBD refers to block devices designed as a building block to form high +availability (HA) clusters. This is done by mirroring a whole block device +via an assigned network. DRBD can be understood as network based raid-1. -This is a virtual package, installing the full DRBD user-land suite. +This is a virtual package, installing the full 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 + +%prep +%setup -q -n drbd-utils-%{version} + +# Disable the automatic checkin with drbd starts +%patch0 -p0 + +%build +%configure \ + --with-utils \ + --without-km \ + --with-udev \ + --with-xen \ + --with-pacemaker \ + --with-rgmanager \ + --with-distro=generic \ + --with-initdir=%{_initddir} +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +# Remove old init script, replace with systemd unit file +rm -f $RPM_BUILD_ROOT/%{_initddir}/drbd +install -d -m755 $RPM_BUILD_ROOT/%{_unitdir} +install -m644 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/drbd.service + +# Relocate udev rules to the location systemd expects to find them +install -d -m755 $RPM_BUILD_ROOT/%{_udevrulesdir} +mv $RPM_BUILD_ROOT/etc/udev/rules.d/* $RPM_BUILD_ROOT/%{_udevrulesdir}/ + +%clean +rm -rf $RPM_BUILD_ROOT + + + %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. @@ -67,70 +78,41 @@ 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}/drbdsetup +%{_sbindir}/drbdadm +%{_sbindir}/drbdmeta %{_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 +%attr(0644,root,root) %{_unitdir}/drbd.service + +# Yes, these paths are peculiar. Upstream is peculiar. +# Be forewarned: rpmlint hates this stuff. +%defattr(755,root,root,-) +/lib/drbd/drbdadm-* +/lib/drbd/drbdsetup-* +/usr/lib/drbd/*.sh +/usr/lib/drbd/rhcs_fence %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 +%{_mandir}/man8/drbd*gz +%{_mandir}/man5/drbd*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. @@ -138,26 +120,24 @@ 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 +%config %{_udevrulesdir}/65-drbd.rules* + + -%if %{with pacemaker} %package pacemaker Summary: Pacemaker resource agent for DRBD Group: System Environment/Base @@ -165,26 +145,22 @@ 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. @@ -198,15 +174,14 @@ in the Cluster distribution. %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. @@ -214,49 +189,19 @@ 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 +%systemd_post drbd.service %preun utils -if [ $1 -eq 0 ]; then - %{_initrddir}/drbd stop >/dev/null 2>&1 - /sbin/chkconfig --del drbd -fi - +%systemd_preun sshd.service %changelog +* Wed Aug 06 2014 Major Hayden - 8.9.0-4 +- Big cleanup and update for F21 + * Mon Aug 04 2014 Major Hayden - 8.9.0-3 - Fixing path to drbdadm in systemd unit file