1 # The following block is used to allow the source RPM to be rebuilt
2 # against arbitrary kernels. It ensure the release name is correct
3 # and the proper build/install requires are set.
4 %if 0%{?require_kver:1}
5 %define kver %{require_kver}
7 %define _kdir %((echo X; ls -1d /usr/src/kernels/* /usr/src/linux-* 2>/dev/null)|sed -e 's/linux-//' | tail -1)
8 %define kver %(basename %{_kdir})
11 # Each distro has its own kernel package naming convention.
13 %define kstr chaos-kernel
14 %define kdev chaos-kernel-devel
15 %define kdir /usr/src/kernels/%{kver}
18 %define kdev kernel-devel
19 %define kdir /usr/src/kernels/%{kver}
22 %define debug_package %{nil}
24 # The kernel version should only be appended to a binary RPM.
25 # When building a source RPM it must be kernel version agnostic.
26 %define name @PACKAGE@
27 %define version @VERSION@
29 %if %{?build_src_rpm:1}0
30 %define release @SPL_META_RELEASE@
32 %define release @SPL_META_RELEASE@_%(echo %{kver} | sed -e 's/-/_/g')
35 %if 0%{?require_kver:1}
36 %define buildrequires %{kdev}=%{kver}
38 %define buildrequires %{kdev}
41 Summary: Solaris Porting Layer
42 Group: Utilities/System
47 URL: git://eris.llnl.gov/spl.git
48 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
49 Source: %{name}-%{version}.tar.gz
50 Requires: %{kstr} = %{kver}
51 BuildRequires: %{buildrequires}
54 The %{name} package contains kernel modules and support utilities for
55 emulating Solaris style primatives in the linux kernel. These include,
56 but are not limited too, atomic, condvar, debug, error, memory, kobject,
57 kstat, mutex, rwlock, taskq, thread, time, and vnode APIs.
60 Summary: Solaris Porting Layer Headers and Symbols
61 Group: Development/Libraries
62 Requires: %{kstr} = %{kver}
63 BuildRequires: %{buildrequires}
66 The %{name}-devel package contains the header files and Module.symvers
67 symbols needed for building additional modules which use %{name}.
72 %configure --with-linux=%{kdir}
76 rm -rf $RPM_BUILD_ROOT
77 make DESTDIR=$RPM_BUILD_ROOT install
80 rm -rf $RPM_BUILD_ROOT
83 %defattr(-, root, root)
84 %doc AUTHORS ChangeLog COPYING DISCLAIMER INSTALL
93 if [ -f /boot/System.map-%{kver} ]; then
94 depmod -ae -F /boot/System.map-%{kver} %{kver} || exit 0
96 depmod -ae %{kver} || exit 0
100 if [ -f /boot/System.map-%{kver} ]; then
101 depmod -ae -F /boot/System.map-%{kver} %{kver} || exit 0
103 depmod -ae %{kver} || exit 0