From: Brian J. Murrell Date: Mon, 8 Mar 2010 23:12:22 +0000 (-0800) Subject: Fix definitions for the unknown distro/installation X-Git-Tag: spl-0.4.8~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cce0f13652dd3476cb6939df2656631b2dee4b8;p=spl 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. Additionally add 'k' prefix for kernel requires for consistency. --- diff --git a/spl-modules.spec.in b/spl-modules.spec.in index 4f8d47a..92b12ab 100644 --- a/spl-modules.spec.in +++ b/spl-modules.spec.in @@ -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} @@ -159,9 +156,13 @@ %else %define relext %(echo %{kverpkg} | %{__sed} -e 's/-/_/g') %define release @SPL_META_RELEASE@_%{relext} -%define requires %{kpkg} %{koppkg} %{kverpkg} +%if %{defined kpkg} +%define krequires %{kpkg} %{koppkg} %{kverpkg} +%endif +%if %{defined kdevpkg} %define devel_requires %{kdevpkg} %{koppkg} %{kverpkg} %endif +%endif Summary: Solaris Porting Layer Modules Group: Utilities/System @@ -172,8 +173,12 @@ License: @LICENSE@ URL: git://eris.llnl.gov/spl.git BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id} -un) Source: @PACKAGE@-%{version}.tar.gz -Requires: %{requires} +%if %{defined krequires} +Requires: %{krequires} +%endif +%if %{defined kdevpkg} BuildRequires: %{kdevpkg} +%endif %description The %{name} package contains kernel modules for emulating Solaris style @@ -184,8 +189,12 @@ taskq, thread, time, and vnode APIs. %package devel Summary: Solaris Porting Layer Headers and Symbols Group: Development/Libraries +%if %{defined devel_requires} Requires: %{devel_requires} +%endif +%if %{defined kdevpkg} BuildRequires: %{kdevpkg} +%endif %description devel The %{name}-devel package contains the header files and Module{s}.symvers