aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-06-26 09:40:14 -0700
committerBrian Behlendorf <[email protected]>2009-06-26 09:40:14 -0700
commite28bc9160d4dd0706f9c65bf35062bea41f20ebb (patch)
tree89c0c5b66bb947d3c6c9c2c0ee41b3a8d8c48e7a
parent07114bdee9012057c26c17ebe70ab0d9d05c4154 (diff)
SRPM build farm / mock itergration
-rw-r--r--spl.spec.in35
1 files changed, 20 insertions, 15 deletions
diff --git a/spl.spec.in b/spl.spec.in
index e6193ffc8..3922f938b 100644
--- a/spl.spec.in
+++ b/spl.spec.in
@@ -17,8 +17,8 @@
# SLES*:
%if %{defined sles_version}
%if %{undefined kver}
- %define klnk %{_usrsrc}/linux-obj/%{_target_cpu}/%{_target_cpu}
- %define kver %(%{__cat} %{klnk}/.kernelrelease)
+ %define klnk %{_usrsrc}/linux-obj/%{_target_cpu}/%{_target_cpu}
+ %define kver %((echo unknown; %{__cat} %{klnk}/.kernelrelease 2>/dev/null) | tail -1)
%endif
%define kpkg kernel-%{_target_cpu}
%define kdevpkg kernel-source kernel-syms
@@ -30,8 +30,8 @@
%else
%if %{defined ch4}
%if %{undefined kver}
- %define klnk %{_usrsrc}/kernels/*/include/config
- %define kver %((%{__cat} %{klnk}/kernel.release) | tail -1)
+ %define klnk %{_usrsrc}/kernels/*/include/config
+ %define kver %((echo unknown; %{__cat} %{klnk}/kernel.release 2>/dev/null) | tail -1)
%endif
%define kpkg chaos-kernel
%define kdevpkg chaos-kernel-devel
@@ -43,8 +43,8 @@
%else
%if %{defined fedora} || %{defined rhel}
%if %{undefined kver}
- %define klnk %{_usrsrc}/kernels/*/include/config
- %define kver %((%{__cat} %{klnk}/kernel.release) | tail -1)
+ %define klnk %{_usrsrc}/kernels/*/include/config
+ %define kver %((echo unknown; %{__cat} %{klnk}/kernel.release 2>/dev/null) | tail -1)
%endif
%define kpkg kernel
%define kdevpkg kernel-devel
@@ -55,12 +55,12 @@
%else
# Unsupported distro:
-%{!?kver: %define kver unknown}
-%define kpkg kernel
-%define kdevpkg kernel-devel
-%define kverpkg %{kver}
-%{!?kdir: %define kdir %{_usrsrc}/kernels/%{kver}}
-%{!?kobj: %define kobj %{kdir}}
+%{!?kver: %define kver unknown}
+%define kpkg kernel
+%define kdevpkg kernel-devel
+%define kverpkg %{kver}
+%{!?kdir: %define kdir %{_usrsrc}/kernels/%{kver}}
+%{!?kobj: %define kobj %{kdir}}
%endif
%endif
@@ -80,9 +80,14 @@
%define release @SPL_META_RELEASE@_%(echo %{kverpkg} | %{__sed} -e 's/-/_/g')
%endif
+# Required by mock to ensure valid 'Requires' and 'BuildRequires' fields
+# are set even when a specific kernel version was not requested. This is
+# used when mock is attempting to rebuild the srpm for the latest kernel.
%if %{defined require_kver}
-%define buildrequires %{kdevpkg}=%{require_kver}
+%define requires %{kpkg}=%{kverpkg}
+%define buildrequires %{kdevpkg}=%{kverpkg}
%else
+%define requires %{kpkg}
%define buildrequires %{kdevpkg}
%endif
@@ -95,7 +100,7 @@ License: GPL
URL: git://eris.llnl.gov/spl.git
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
Source: %{name}-%{version}.tar.gz
-Requires: %{kpkg} = %{kverpkg}
+Requires: %{requires}
BuildRequires: %{buildrequires}
%description
@@ -107,7 +112,7 @@ kstat, mutex, rwlock, taskq, thread, time, and vnode APIs.
%package devel
Summary: Solaris Porting Layer Headers and Symbols
Group: Development/Libraries
-Requires: %{kpkg} = %{kverpkg}
+Requires: %{requires}
BuildRequires: %{buildrequires}
%description devel