Fix definitions for the unknown distro/installation

If the distro/installation really is unsupported (i.e. unknown) we should
not make it look like a known distribution (i.e. RHEL) complete with
dependencies on other RPMs and trying to find kenrel source in the RH
standard location.
This commit is contained in:
Brian J. Murrell 2010-03-08 16:20:20 -08:00 committed by Brian Behlendorf
parent 3f30f74414
commit 835a21a54a
1 changed files with 13 additions and 7 deletions

View File

@ -125,14 +125,11 @@
# Unsupported distro:
%if %{undefined kver}
%define kver X
%define kver %(uname -r)
%endif
%define kpkg kernel
%define kdevpkg kernel-devel
%define kverpkg %{kver}
%define koppkg =
%if %{undefined kdir}
%define kdir %{_usrsrc}/kernels/%{kver}
%define kdir /lib/modules/%{kver}/build
%endif
%if %{undefined kobj}
%define kobj %{kdir}
@ -183,7 +180,6 @@
%define version @VERSION@
%define debug_package %{nil}
# The kernel version should only be appended to a binary RPM. When
# building a source RPM it must be kernel version agnostic. This means
# the source RPM must never specify a required kernel version, but the
@ -195,7 +191,9 @@
%else
%define relext %(echo %{kverpkg} | %{__sed} -e 's/-/_/g')
%define release @ZFS_META_RELEASE@_%{relext}
%if %{defined kpkg}
%define krequires %{kpkg} %{koppkg} %{kverpkg}
%endif
%define splrequires %{splpkg} = %{splverpkg}
%endif
@ -208,9 +206,13 @@ License: @LICENSE@
URL: git://eris.llnl.gov/zfs.git
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id} -un)
Source: @PACKAGE@-%{version}.tar.gz
%if %{defined krequires}
Requires: %{krequires}
Requires: %{splrequires}
%endif
%if %{defined kdevpkg}
BuildRequires: %{kdevpkg}
%endif
Requires: %{splrequires}
BuildRequires: %{spldevpkg}
%description
@ -220,9 +222,13 @@ the %{name} file system.
%package devel
Summary: ZFS File System Headers and Symbols
Group: Development/Libraries
%if %{defined krequires}
Requires: %{krequires}
%endif
Requires: %{splrequires}
%if %{defined kdevpkg}
BuildRequires: %{kdevpkg}
%endif
BuildRequires: %{spldevpkg}
%description devel