From 7da68c88d7f77576394f831edd9941aaa839e987 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Thu, 7 Mar 2013 15:49:34 +0100 Subject: [PATCH] Cleanup .spec file handling of different Fedora versions Resolves bz914629 Signed-off-by: Jes Sorensen --- mdadm.spec | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/mdadm.spec b/mdadm.spec index ff23d8a..73f778b 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,7 +1,7 @@ Summary: The mdadm program controls Linux md devices (software RAID arrays) Name: mdadm Version: 3.2.6 -Release: 14%{?dist} +Release: 15%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -20,28 +20,31 @@ Patch96: mdadm-3.2.6-mdmon-add-foreground-option.patch # Fedora customization patches Patch97: mdadm-3.2.6-udev.patch Patch98: mdadm-2.5.2-static.patch -# Fedora 16, 17 - only +# Fedora 17 - only Patch99: mdadm-3.2.4-map-dir.patch URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ License: GPLv2+ Group: System Environment/Base BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: mdctl,raidtools -%if "%{fedora}" >= "18" +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +%define fedora17 0 +%else +%define fedora17 1 +%endif +%if %{fedora17} +Requires(post): systemd-units systemd-sysv chkconfig coreutils +Requires: udev initscripts +Conflicts: dracut < 009-14 +%else Obsoletes: mdadm-sysvinit Conflicts: dracut < 024-25 Requires(post): systemd-units chkconfig coreutils -%else -Requires(post): systemd-units systemd-sysv chkconfig coreutils -Requires: udev initscripts %endif BuildRequires: systemd-units binutils-devel Requires(preun): systemd-units Requires(postun): systemd-units coreutils -%if "%{fedora}" >= "17" Requires: libreport-filesystem -Conflicts: dracut < 009-14 -%endif %description The mdadm program is used to create, manage, and monitor Linux MD (software @@ -50,7 +53,7 @@ package. However, mdadm is a single program, and it can perform almost all functions without a configuration file, though a configuration file can be used to help with some common tasks. -%if "%{fedora}" <= "17" +%if %{fedora17} %package sysvinit Group: System Environment/Base Summary: SysV init script for mdadm @@ -67,7 +70,7 @@ is not used as the system init process. %prep %setup -q # Use systemctl to launch mdmon on F18 and higher -%if "%{fedora}" >= "18" +%if !%{fedora17} %patch93 -p1 -b .nooffroot %patch94 -p1 -b .sysctl %patch95 -p1 -b .mdmonfail @@ -81,7 +84,7 @@ is not used as the system init process. %patch97 -p1 -b .udev %patch98 -p1 -b .static # Fedora 16, 17 - only -%if "%{fedora}" <= "17" +%if %{fedora17} %patch99 -p1 -b .map-dir %endif @@ -91,7 +94,7 @@ make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm %install rm -rf %{buildroot} make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=/sbin SYSTEMD_DIR=%{_unitdir} install install-systemd -%if "%{fedora}" <= "17" +%if %{fedora17} install -Dp -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/mdmonitor %endif install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/raid-check @@ -111,10 +114,8 @@ mkdir -p %{buildroot}%{_localstatedir}/run/ install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/ # abrt -%if "%{fedora}" >= "17" mkdir -p %{buildroot}/etc/libreport/events.d install -m644 %{SOURCE8} %{buildroot}/etc/libreport/events.d -%endif %clean rm -rf %{buildroot} @@ -135,7 +136,7 @@ rm -rf %{buildroot} /sbin/chkconfig --del mdmonitor >/dev/null 2>&1 || : /bin/systemctl try-restart mdmonitor.service >/dev/null 2>&1 || : -%if "%{fedora}" <= "17" +%if %{fedora17} %triggerpostun -n %{name}-sysvinit -- %{name} < 3.2.2-3 /sbin/chkconfig --add mdmonitor >/dev/null 2>&1 || : %endif @@ -152,16 +153,18 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/sysconfig/* %dir %{_localstatedir}/run/%{name}/ %config(noreplace) %{_prefix}/lib/tmpfiles.d/%{name}.conf -%if "%{fedora}" >= "17" /etc/libreport/events.d/* -%endif -%if "%{fedora}" <= "17" +%if %{fedora17} %files sysvinit %{_initrddir}/* %endif %changelog +* Thu Mar 7 2013 Jes Sorensen - 3.2.6-15 +- Cleanup .spec file handling of different Fedora versions +- Resolves bz914629 + * Tue Feb 5 2013 Jes Sorensen - 3.2.6-14 - Resync with final version of upstream patches for launching mdmon via systemctl. Require dracut 024-025 or later to match.