dracut.spec: changes for RHEL-6
authorHarald Hoyer <harald@redhat.com>
Wed, 22 Feb 2012 18:51:55 +0000 (19:51 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 22 Feb 2012 18:53:07 +0000 (19:53 +0100)
dracut.spec

index 48c0dbb..460b9fb 100644 (file)
@@ -13,7 +13,7 @@ Version: xxx
 Release: xxx
 
 Summary: Initramfs generator using udev
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 Group: System Environment/Base
 %endif
 %if 0%{?suse_version}
@@ -28,14 +28,14 @@ Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar
 BuildArch: noarch
 BuildRequires: dash bash git
 
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %endif
 %if 0%{?suse_version}
 BuildRoot: %{_tmppath}/%{name}-%{version}-build
 %endif
 
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 BuildRequires: docbook-style-xsl docbook-dtds libxslt
 %endif
 
@@ -43,7 +43,7 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
 BuildRequires: docbook-xsl-stylesheets libxslt
 %endif
 
-%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
+%if 0%{?fedora} > 12 || 0%{?rhel}
 # no "provides", because dracut does not offer
 # all functionality of the obsoleted packages
 Obsoletes: mkinitrd <= 6.0.93
@@ -75,7 +75,11 @@ Requires: gzip
 Requires: module-init-tools >= 3.7-9
 Requires: sed
 Requires: udev
+%if 0%{?fedora} || 0%{?rhel} > 6
 Requires: util-linux >= 2.20
+%else
+Requires: util-linux-ng >= 2.17.2
+%endif
 
 %if 0%{?fedora} || 0%{?rhel} > 6
 Conflicts: initscripts < 8.63-1
@@ -99,7 +103,7 @@ Provides:  dracut-generic = %{version}-%{release}
 This package requires everything which is needed to build a generic
 all purpose initramfs with network support with dracut.
 
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel} >= 6
 %package fips
 Summary: Dracut modules to build a dracut initramfs with an integrity check
 Requires: %{name} = %{version}-%{release}
@@ -123,7 +127,7 @@ Requires: %{name}-fips = %{version}-%{release}
 
 %description fips-aesni
 This package requires everything which is needed to build an
-all purpose initramfs with dracut, which does an integrity check 
+all purpose initramfs with dracut, which does an integrity check
 and adds the aesni-intel kernel module.
 
 %package caps
@@ -160,14 +164,16 @@ git am -p1 %{patches}
 make
 
 %install
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 rm -rf $RPM_BUILD_ROOT
 %endif
 make install DESTDIR=$RPM_BUILD_ROOT \
      libdir=%{_prefix}/lib \
      bindir=%{_bindir} \
-     sysconfdir=/etc mandir=%{_mandir} \
-     systemdsystemunitdir=%{_unitdir}
+%if %{defined _unitdir}
+     systemdsystemunitdir=%{_unitdir} \
+%endif
+     sysconfdir=/etc mandir=%{_mandir}
 
 echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/10rpmversion/dracut-version
 
@@ -185,7 +191,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
 touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
 mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
 
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
 install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf
 %endif
@@ -225,7 +231,7 @@ rm -rf $RPM_BUILD_ROOT
 %{dracutlibdir}/dracut-logger.sh
 %{dracutlibdir}/dracut-initramfs-restore
 %config(noreplace) /etc/dracut.conf
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
 %config /etc/dracut.conf.d/01-dist.conf
 %endif
 %dir /etc/dracut.conf.d
@@ -275,7 +281,7 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) /etc/logrotate.d/dracut_log
 %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
 %dir %{_sharedstatedir}/initramfs
-%if 0%{?fedora} > 16 || 0%{?rhel} > 6
+%if %{defined _unitdir}
 %{_unitdir}/*.service
 %{_unitdir}/*/*.service
 %endif
@@ -292,7 +298,7 @@ rm -rf $RPM_BUILD_ROOT
 %{dracutlibdir}/modules.d/45ifcfg
 %{dracutlibdir}/modules.d/95znet
 
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
 %files fips
 %defattr(-,root,root,0755)
 %{dracutlibdir}/modules.d/01fips