2009-07-02 01:37:44 +04:00
|
|
|
# The following block is used to allow the source RPM to be rebuilt
|
|
|
|
# against specific kernels. It is preferable that rpmbuild define the
|
|
|
|
# require_kver, require_kdir, require_obj constants for us, but if it does not
|
|
|
|
# not we attempt to determine the correct values based on your distro.
|
|
|
|
|
2009-08-15 01:09:16 +04:00
|
|
|
# kdir: Full path to the kernel source headers
|
|
|
|
# kobj: Full path to the kernel build objects
|
|
|
|
# kver: Kernel version
|
|
|
|
# kpkg: Kernel package name
|
|
|
|
# kdevpkg: Kernel devel package name
|
|
|
|
# kverpkg: Kernel package version
|
|
|
|
|
2009-08-14 02:02:34 +04:00
|
|
|
%if %{defined require_kver}
|
|
|
|
%define kver %{require_kver}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{defined require_kdir}
|
|
|
|
%define kdir %{require_kdir}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{defined require_kobj}
|
|
|
|
%define kobj %{require_kobj}
|
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
# Set using 'rpmbuild ... --with kernel ...', defaults to enabled.
|
|
|
|
%if %{defined _with_kernel}
|
|
|
|
%define with_kernel 1
|
|
|
|
%else
|
|
|
|
%if %{defined _without_kernel}
|
|
|
|
%define with_kernel 0
|
|
|
|
%else
|
|
|
|
%define with_kernel 1
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Set using 'rpmbuild ... --with kernel-debug ...', defaults to disabled.
|
|
|
|
%if %{defined _with_kernel_debug}
|
|
|
|
%define with_kernel_debug 1
|
|
|
|
%else
|
|
|
|
%if %{defined _without_kernel_debug}
|
|
|
|
%define with_kernel_debug 0
|
|
|
|
%else
|
|
|
|
%define with_kernel_debug 0
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
# Set using 'rpmbuild ... --with kernel-dkms ...', defaults to disabled.
|
|
|
|
%if %{defined _with_kernel_dkms}
|
|
|
|
%define with_kernel_dkms 1
|
|
|
|
%else
|
|
|
|
%if %{defined _without_kernel_dkms}
|
|
|
|
%define with_kernel_dkms 0
|
|
|
|
%else
|
|
|
|
%define with_kernel_dkms 0
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2012-02-27 22:42:07 +04:00
|
|
|
# Set using 'rpmbuild ... --with debug ...', defaults to disabled.
|
|
|
|
%if %{defined _with_debug}
|
|
|
|
%define kdebug --enable-debug
|
|
|
|
%else
|
|
|
|
%if %{defined _without_debug}
|
|
|
|
%define kdebug --disable-debug
|
|
|
|
%else
|
|
|
|
%define kdebug --disable-debug
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Set using 'rpmbuild ... --with debug-log ...', defaults to enabled.
|
|
|
|
%if %{defined _with_debug_log}
|
|
|
|
%define kdebug_log --enable-debug-log
|
|
|
|
%else
|
|
|
|
%if %{defined _without_debug_log}
|
|
|
|
%define kdebug_log --disable-debug-log
|
|
|
|
%else
|
|
|
|
%define kdebug_log --enable-debug-log
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Set using 'rpmbuild ... --with debug-kmem ...', defaults to enabled.
|
|
|
|
%if %{defined _with_debug_kmem}
|
|
|
|
%define kdebug_kmem --enable-debug-kmem
|
|
|
|
%else
|
|
|
|
%if %{defined _without_debug_kmem}
|
|
|
|
%define kdebug_kmem --disable-debug-kmem
|
|
|
|
%else
|
|
|
|
%define kdebug_kmem --enable-debug-kmem
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Set using 'rpmbuild ... --with debug-tracking ...', defaults to disabled.
|
|
|
|
%if %{defined _with_debug_kmem_tracking}
|
|
|
|
%define kdebug_kmem_tracking --enable-debug-kmem-tracking
|
|
|
|
%else
|
|
|
|
%if %{defined _without_debug_kmem_tracking}
|
|
|
|
%define kdebug_kmem_tracking --disable-debug-kmem-tracking
|
|
|
|
%else
|
|
|
|
%define kdebug_kmem_tracking --disable-debug-kmem-tracking
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2010-05-18 20:18:20 +04:00
|
|
|
# SLES:
|
2009-08-15 01:09:16 +04:00
|
|
|
%if %{defined suse_version}
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kver}
|
2009-08-15 01:09:16 +04:00
|
|
|
%ifarch ppc64
|
|
|
|
%define kverextra ppc64
|
|
|
|
%else
|
|
|
|
%define kverextra default
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{suse_version} >= 1100
|
|
|
|
%define klnk %{_usrsrc}/linux-obj/%{_target_cpu}/%{kverextra}
|
|
|
|
%define krelease %{klnk}/include/config/kernel.release
|
|
|
|
%else
|
|
|
|
%define klnk %{_usrsrc}/linux-obj/%{_target_cpu}/%{kverextra}
|
|
|
|
%define krelease %{klnk}/.kernelrelease
|
|
|
|
%endif
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kver_kern %((echo X; %{__cat} %{krelease} 2>/dev/null)|tail -1)
|
|
|
|
%define kver_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kver_kern %{kver}
|
|
|
|
%define kver_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2009-08-15 01:09:16 +04:00
|
|
|
|
|
|
|
%if %{undefined kverextra}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kverextra %(echo %{kver_kern} | cut -f3 -d'-')
|
2009-08-15 01:09:16 +04:00
|
|
|
%endif
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kpkg_kern kernel-%{kverextra}
|
|
|
|
%define kpkg_dbug %{nil}
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kdevpkg_kern kernel-source
|
|
|
|
%define kdevpkg_dbug %{nil}
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kdevpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kverpkg_kern %(echo %{kver_kern} | %{__sed} -e 's/-%{kverextra}//g')
|
|
|
|
%define kverpkg_dbug %{nil}
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kverpkg_dkms 2.2.0.2
|
2009-08-15 01:09:16 +04:00
|
|
|
|
|
|
|
# The kernel and rpm versions do not strictly match under SLES11
|
|
|
|
# e.g. kernel version 2.6.27.19-5 != rpm version 2.6.27.19-5.1
|
|
|
|
%if %{suse_version} >= 1100
|
|
|
|
%define koppkg >=
|
|
|
|
%else
|
|
|
|
%define koppkg =
|
|
|
|
%endif
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kdir}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kdir_kern %{_usrsrc}/linux-%{kverpkg_kern}
|
|
|
|
%define kdir_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kdir_kern %{kdir}
|
|
|
|
%define kdir_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kobj}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kobj_kern %{kdir_kern}-obj/%{_target_cpu}/%{kverextra}
|
|
|
|
%define kobj_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kobj_kern %{kobj}
|
|
|
|
%define kobj_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
|
|
|
%else
|
2009-08-15 01:09:16 +04:00
|
|
|
|
2011-04-01 00:43:49 +04:00
|
|
|
# RHEL 5.x/6.x, CHAOS 5.x:
|
|
|
|
%if %{defined el5} || %{defined el6} || %{defined ch5}
|
2009-08-15 01:09:16 +04:00
|
|
|
%if %{undefined kver}
|
|
|
|
%define klnk %{_usrsrc}/kernels/*/include/config
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kver_kern %((echo X; ((%{__cat} %{klnk}/kernel.release
|
|
|
|
2>/dev/null) | %{__grep} -v debug)) | tail -1)
|
|
|
|
%define kver_dbug %((echo X; ((%{__cat} %{klnk}/kernel.release
|
|
|
|
2>/dev/null) | %{__grep} debug)) | tail -1)
|
|
|
|
%else
|
|
|
|
%define kver_kern %{kver}
|
|
|
|
%define kver_dbug %{kver}.debug
|
2009-08-15 01:09:16 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kpkg_kern kernel
|
|
|
|
%define kpkg_dbug kernel-debug
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kdevpkg_kern kernel-devel
|
|
|
|
%define kdevpkg_dbug kernel-debug-devel
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kdevpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kverpkg_dkms 2.2.0.2
|
2011-04-08 21:20:08 +04:00
|
|
|
%if %{defined el6} || %{defined ch5}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kverpkg_kern %(echo %{kver_kern} | %{__sed} -e 's/.%{_target_cpu}//g')
|
|
|
|
%define kverpkg_dbug %(echo %{kver_dbug} | %{__sed} -e 's/.%{_target_cpu}//g' | %{__sed} -e 's/.debug//g')
|
2010-05-21 22:53:49 +04:00
|
|
|
%else
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kverpkg_kern %{kver_kern}
|
|
|
|
%define kverpkg_dbug %{kver_dbug}
|
2010-05-21 22:53:49 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-08-15 01:09:16 +04:00
|
|
|
%define koppkg =
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-08-15 01:09:16 +04:00
|
|
|
%if %{undefined kdir}
|
2011-04-08 21:20:08 +04:00
|
|
|
%if %{defined el6} || %{defined ch5}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kdir_kern %{_usrsrc}/kernels/%{kver_kern}
|
|
|
|
%define kdir_dbug %{_usrsrc}/kernels/%{kver_dbug}
|
2011-04-08 21:20:08 +04:00
|
|
|
%else
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kdir_kern %{_usrsrc}/kernels/%{kver_kern}-%{_target_cpu}
|
|
|
|
%define kdir_dbug %{_usrsrc}/kernels/%{kver_dbug}-%{_target_cpu}
|
2011-04-08 21:20:08 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%else
|
|
|
|
%define kdir_kern %{kdir}
|
|
|
|
%define kdir_dbug %{kdir}.debug
|
2009-08-15 01:09:16 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-08-15 01:09:16 +04:00
|
|
|
%if %{undefined kobj}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kobj_kern %{kdir_kern}
|
|
|
|
%define kobj_dbug %{kdir_dbug}
|
|
|
|
%else
|
|
|
|
%define kobj_kern %{kobj}
|
|
|
|
%define kobj_dbug %{kobj}.debug
|
2009-08-15 01:09:16 +04:00
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
%else
|
2009-08-15 01:09:16 +04:00
|
|
|
|
2010-05-18 20:18:20 +04:00
|
|
|
# Fedora:
|
2009-08-15 01:09:16 +04:00
|
|
|
%if %{defined fedora}
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kver}
|
|
|
|
%define klnk %{_usrsrc}/kernels/*/include/config
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kver_kern %((echo X; ((%{__cat} %{klnk}/kernel.release
|
|
|
|
2>/dev/null) | %{__grep} -v debug)) | tail -1)
|
|
|
|
%define kver_dbug %((echo X; ((%{__cat} %{klnk}/kernel.release
|
|
|
|
2>/dev/null) | %{__grep} debug)) | tail -1)
|
|
|
|
%else
|
|
|
|
%define kver_kern %{kver}
|
|
|
|
%define kver_dbug %{kver}.debug
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kpkg_kern kernel
|
|
|
|
%define kpkg_dbug kernel-debug
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kdevpkg_kern kernel-devel
|
|
|
|
%define kdevpkg_dbug kernel-debug-devel
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kdevpkg_dkms dkms
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kverpkg_dkms 2.2.0.2
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kverpkg_kern %(echo %{kver_kern} | %{__sed} -e 's/.%{_target_cpu}//g')
|
|
|
|
%define kverpkg_dbug %(echo %{kver_dbug} | %{__sed} -e 's/.%{_target_cpu}//g' | %{__sed} -e 's/.debug//g')
|
|
|
|
|
2009-08-15 01:09:16 +04:00
|
|
|
%define koppkg =
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kdir}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kdir_kern %{_usrsrc}/kernels/%{kver_kern}
|
|
|
|
%define kdir_dbug %{_usrsrc}/kernels/%{kver_dbug}
|
|
|
|
%else
|
|
|
|
%define kdir_kern %{kdir}
|
|
|
|
%define kdir_dbug %{kdir}.debug
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kobj}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kobj_kern %{kdir_kern}
|
|
|
|
%define kobj_dbug %{kdir_dbug}
|
|
|
|
%else
|
|
|
|
%define kobj_kern %{kobj}
|
|
|
|
%define kobj_dbug %{kobj}.debug
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
|
|
|
%else
|
|
|
|
|
|
|
|
# Unsupported distro:
|
|
|
|
%if %{undefined kver}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kver_kern %(uname -r)
|
|
|
|
%define kver_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kver_kern %{kver}
|
|
|
|
%define kver_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%define kverpkg_kern %{kver_kern}
|
|
|
|
%define kverpkg_dbug %{nil}
|
2012-08-08 00:57:03 +04:00
|
|
|
%define kverpkg_dkms %{nil}
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kdir}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kdir_kern /lib/modules/%{kver_kern}/build
|
|
|
|
%define kdir_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kdir_kern %{kdir}
|
|
|
|
%define kdir_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%if %{undefined kobj}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define kobj_kern %{kdir_kern}
|
|
|
|
%define kobj_dbug %{nil}
|
|
|
|
%else
|
|
|
|
%define kobj_kern %{kobj}
|
|
|
|
%define kobj_dbug %{nil}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Distro agnostic:
|
|
|
|
%define name @PACKAGE@-modules
|
|
|
|
%define version @VERSION@
|
|
|
|
|
|
|
|
# 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
|
|
|
|
# final RPM should be keyed to the kernel version it was built against.
|
|
|
|
%if %{defined build_src_rpm}
|
2012-05-07 22:26:05 +04:00
|
|
|
%define rel_kern @SPL_META_RELEASE@
|
|
|
|
%define rel_dbug @SPL_META_RELEASE@
|
2012-08-08 00:57:03 +04:00
|
|
|
%define rel_dkms @SPL_META_RELEASE@
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kpkg_kern}
|
|
|
|
%define req_kern %{kpkg_kern}
|
|
|
|
%endif
|
|
|
|
%if %{defined kpkg_dbug}
|
|
|
|
%define req_dbug %{kpkg_dbug}
|
|
|
|
%endif
|
2012-08-08 00:57:03 +04:00
|
|
|
%if %{defined kpkg_dkms}
|
|
|
|
%define req_dkms %{kpkg_dkms}
|
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kdevpkg_kern}
|
|
|
|
%define devreq_kern %{kdevpkg_kern}
|
|
|
|
%endif
|
|
|
|
%if %{defined kdevpkg_dbug}
|
|
|
|
%define devreq_dbug %{kdevpkg_dbug}
|
2010-05-18 20:18:20 +04:00
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
%else
|
2012-05-07 22:26:05 +04:00
|
|
|
%define relext_kern %(echo %{kverpkg_kern} | %{__sed} -e 's/-/_/g')
|
|
|
|
%define relext_dbug %(echo %{kverpkg_dbug} | %{__sed} -e 's/-/_/g')
|
|
|
|
%define rel_kern @SPL_META_RELEASE@_%{relext_kern}
|
|
|
|
%define rel_dbug @SPL_META_RELEASE@_%{relext_dbug}
|
2012-08-08 00:57:03 +04:00
|
|
|
%define rel_dkms @SPL_META_RELEASE@
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kpkg_kern}
|
|
|
|
%define req_kern %{kpkg_kern} %{koppkg} %{kverpkg_kern}
|
|
|
|
%endif
|
|
|
|
%if %{defined kpkg_dbug}
|
|
|
|
%define req_dbug %{kpkg_dbug} %{koppkg} %{kverpkg_dbug}
|
|
|
|
%endif
|
2012-08-08 00:57:03 +04:00
|
|
|
%if %{defined kpkg_dkms}
|
|
|
|
%define req_dkms %{kpkg_dkms} >= %{kverpkg_dkms}
|
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kdevpkg_kern}
|
|
|
|
%define devreq_kern %{kdevpkg_kern} %{koppkg} %{kverpkg_kern}
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kdevpkg_dbug}
|
|
|
|
%define devreq_dbug %{kdevpkg_dbug} %{koppkg} %{kverpkg_dbug}
|
2009-07-02 01:37:44 +04:00
|
|
|
%endif
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
Summary: Solaris Porting Layer Modules
|
|
|
|
Group: Utilities/System
|
|
|
|
Name: %{name}
|
|
|
|
Version: %{version}
|
2012-05-07 22:26:05 +04:00
|
|
|
Release: %{rel_kern}
|
2009-07-02 01:37:44 +04:00
|
|
|
License: @LICENSE@
|
2011-10-18 03:40:38 +04:00
|
|
|
URL: git://github.com/zfsonlinux/spl.git
|
2009-10-05 23:51:58 +04:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id} -un)
|
2009-07-02 01:37:44 +04:00
|
|
|
Source: @PACKAGE@-%{version}.tar.gz
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%if %{?with_kernel}
|
|
|
|
|
|
|
|
%if %{defined req_kern}
|
|
|
|
Requires: %{req_kern}
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kdevpkg_kern}
|
|
|
|
BuildRequires: %{kdevpkg_kern}
|
|
|
|
%endif
|
|
|
|
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
|
|
|
|
%description
|
|
|
|
The %{name} package contains kernel modules for emulating Solaris style
|
|
|
|
primatives in the linux kernel. These include, but are not limited to:
|
|
|
|
atomic, condvar, debug, error, memory, kobject, kstat, mutex, rwlock,
|
|
|
|
taskq, thread, time, and vnode APIs.
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{?with_kernel}
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%package devel
|
|
|
|
Summary: Solaris Porting Layer Headers and Symbols
|
|
|
|
Group: Development/Libraries
|
2012-05-07 22:26:05 +04:00
|
|
|
Release: %{rel_kern}
|
|
|
|
%if %{defined devreq_kern}
|
|
|
|
Requires: %{devreq_kern}
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{defined kdevpkg_kern}
|
|
|
|
BuildRequires: %{kdevpkg_kern}
|
2010-03-09 02:12:22 +03:00
|
|
|
%endif
|
2009-07-02 01:37:44 +04:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
The %{name}-devel package contains the header files and Module{s}.symvers
|
|
|
|
symbols needed for building additional modules which use %{name}.
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
|
|
|
%if %{?with_kernel_debug}
|
|
|
|
|
|
|
|
%package debug
|
|
|
|
Summary: Solaris Porting Layer Debug Modules
|
|
|
|
Group: Utilities/System
|
|
|
|
Release: %{rel_dbug}
|
|
|
|
%if %{defined req_dbug}
|
|
|
|
Requires: %{req_dbug}
|
|
|
|
%endif
|
|
|
|
%if %{defined kdevpkg_dbug}
|
|
|
|
BuildRequires: %{kdevpkg_dbug}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description debug
|
|
|
|
The %{name}-debug package contains kernel modules for emulating Solaris
|
|
|
|
style primatives in the linux kernel. These include, but are not limited
|
|
|
|
to: atomic, condvar, debug, error, memory, kobject, kstat, mutex,
|
|
|
|
rwlock, taskq, thread, time, and vnode APIs.
|
|
|
|
|
|
|
|
%package debug-devel
|
|
|
|
Summary: Solaris Porting Layer Debug Headers and Symbols
|
|
|
|
Group: Development/Libraries
|
|
|
|
Release: %{rel_dbug}
|
|
|
|
%if %{defined devreq_dbug}
|
|
|
|
Requires: %{devreq_dbug}
|
|
|
|
%endif
|
|
|
|
%if %{defined kdevpkg_dbug}
|
|
|
|
BuildRequires: %{kdevpkg_dbug}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description debug-devel
|
|
|
|
The %{name}-debug-devel package contains the header files and
|
|
|
|
Module{s}.symvers symbols needed for building additional modules which
|
|
|
|
use %{name}-debug.
|
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
%endif
|
|
|
|
%if %{?with_kernel_dkms}
|
|
|
|
|
|
|
|
%package dkms
|
|
|
|
Summary: Solaris Porting Layer Modules (DKMS)
|
|
|
|
Group: Utilities/System
|
|
|
|
Release: %{rel_dkms}
|
|
|
|
Provides: %{name}
|
|
|
|
BuildArch: noarch
|
|
|
|
%if %{defined req_dkms}
|
|
|
|
Requires: %{req_dkms}
|
|
|
|
%endif
|
|
|
|
%if %{defined kdevpkg_dkms}
|
|
|
|
BuildRequires: %{kdevpkg_dkms}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description dkms
|
|
|
|
The %{name}-dkms package contains all the necessary pieces to build and
|
|
|
|
install Solaris Porting Layer (SPL) kernel modules with Dynamic Kernel
|
|
|
|
Modules Support (DKMS). The SPL modules emulate Solaris style primatives
|
|
|
|
in the the linux kernel. They include, but are not limited to: atomic,
|
|
|
|
condvar, debug, error, memory, kobject, kstat, mutex, rwlock, taskq,
|
|
|
|
thread, time, and vnode APIs.
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%prep
|
|
|
|
%setup -n @PACKAGE@-%{version}
|
|
|
|
%build
|
2012-05-07 22:26:05 +04:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%if %{?with_kernel}
|
|
|
|
|
|
|
|
%configure --with-config=kernel \
|
|
|
|
--with-linux=%{kdir_kern} --with-linux-obj=%{kobj_kern} \
|
2012-02-27 22:42:07 +04:00
|
|
|
%{kdebug} %{kdebug_log} %{kdebug_kmem} %{kdebug_kmem_tracking}
|
2009-07-02 01:37:44 +04:00
|
|
|
make
|
2012-05-07 22:26:05 +04:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2009-07-02 01:37:44 +04:00
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
|
|
|
%if %{?with_kernel_debug}
|
|
|
|
|
|
|
|
%configure --with-config=kernel \
|
|
|
|
--with-linux=%{kdir_dbug} --with-linux-obj=%{kobj_dbug} \
|
|
|
|
%{kdebug} %{kdebug_log} %{kdebug_kmem} %{kdebug_kmem_tracking}
|
|
|
|
make
|
2009-07-02 01:37:44 +04:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
%endif
|
|
|
|
%if %{?with_kernel_dkms}
|
|
|
|
|
|
|
|
%configure --with-config=kernel \
|
|
|
|
%{kdebug} %{kdebug_log} %{kdebug_kmem} %{kdebug_kmem_tracking}
|
|
|
|
make dist
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/src
|
|
|
|
tar -xf @PACKAGE@-%{version}.tar.gz -C $RPM_BUILD_ROOT/%{_prefix}/src
|
|
|
|
cp -af dkms.conf $RPM_BUILD_ROOT/%{_prefix}/src/@PACKAGE@-%{version}
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%if %{?with_kernel}
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
2012-05-07 22:26:05 +04:00
|
|
|
/lib/modules/%{kver_kern}/*
|
2009-07-02 01:37:44 +04:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2012-08-14 03:23:45 +04:00
|
|
|
%{_prefix}/src/*/%{kver_kern}
|
2009-07-02 01:37:44 +04:00
|
|
|
|
|
|
|
%post
|
2012-05-07 22:26:05 +04:00
|
|
|
if [ -f /boot/System.map-%{kver_kern} ]; then
|
|
|
|
/sbin/depmod -ae -F /boot/System.map-%{kver_kern} %{kver_kern} || exit 0
|
2009-07-02 01:37:44 +04:00
|
|
|
else
|
2011-11-10 22:36:21 +04:00
|
|
|
/sbin/depmod -a || exit 0
|
2009-07-02 01:37:44 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
2012-05-07 22:26:05 +04:00
|
|
|
if [ -f /boot/System.map-%{kver_kern} ]; then
|
|
|
|
/sbin/depmod -ae -F /boot/System.map-%{kver_kern} %{kver_kern} || exit 0
|
|
|
|
else
|
|
|
|
/sbin/depmod -a || exit 0
|
|
|
|
fi
|
|
|
|
|
2012-08-14 03:23:45 +04:00
|
|
|
%postun devel
|
|
|
|
rmdir %{_prefix}/src/@PACKAGE@-%{version}-@SPL_META_RELEASE@ 2>/dev/null
|
|
|
|
exit 0
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
|
|
|
%if %{?with_kernel_debug}
|
|
|
|
|
|
|
|
%files debug
|
|
|
|
%defattr(-, root, root)
|
|
|
|
/lib/modules/%{kver_dbug}/*
|
|
|
|
|
|
|
|
%files debug-devel
|
|
|
|
%defattr(-,root,root)
|
2012-08-14 03:23:45 +04:00
|
|
|
%{_prefix}/src/*/%{kver_dbug}
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%post debug
|
|
|
|
if [ -f /boot/System.map-%{kver_dbug} ]; then
|
|
|
|
/sbin/depmod -ae -F /boot/System.map-%{kver_dbug} %{kver_dbug} || exit 0
|
2009-07-02 01:37:44 +04:00
|
|
|
else
|
2011-11-10 22:36:21 +04:00
|
|
|
/sbin/depmod -a || exit 0
|
2009-07-02 01:37:44 +04:00
|
|
|
fi
|
2012-05-07 22:26:05 +04:00
|
|
|
|
|
|
|
%postun debug
|
|
|
|
if [ -f /boot/System.map-%{kver_dbug} ]; then
|
|
|
|
/sbin/depmod -ae -F /boot/System.map-%{kver_dbug} %{kver_dbug} || exit 0
|
|
|
|
else
|
|
|
|
/sbin/depmod -a || exit 0
|
|
|
|
fi
|
|
|
|
|
2012-08-14 03:23:45 +04:00
|
|
|
%postun debug-devel
|
|
|
|
rmdir %{_prefix}/src/@PACKAGE@-%{version}-@SPL_META_RELEASE@ 2>/dev/null
|
|
|
|
exit 0
|
|
|
|
|
2012-05-07 22:26:05 +04:00
|
|
|
%endif
|
2012-08-08 00:57:03 +04:00
|
|
|
%if %{?with_kernel_dkms}
|
|
|
|
|
|
|
|
%files dkms
|
|
|
|
%defattr(-,root,root)
|
2012-08-14 03:23:45 +04:00
|
|
|
%{_prefix}/src/@PACKAGE@-%{version}
|
2012-08-08 00:57:03 +04:00
|
|
|
|
|
|
|
%post dkms
|
|
|
|
for POSTINST in %{_prefix}/lib/dkms/common.postinst; do
|
|
|
|
if [ -f $POSTINST ]; then
|
|
|
|
$POSTINST @PACKAGE@ %{version}
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
echo "WARNING: $POSTINST does not exist."
|
|
|
|
done
|
|
|
|
echo -e "ERROR: DKMS version is too old and @PACKAGE@ was not"
|
|
|
|
echo -e "built with legacy DKMS support."
|
|
|
|
echo -e "You must either rebuild @PACKAGE@ with legacy postinst"
|
|
|
|
echo -e "support or upgrade DKMS to a more current version."
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
%preun dkms
|
|
|
|
echo -e
|
|
|
|
echo -e "Uninstall of @PACKAGE@ module (version %{version}) beginning:"
|
|
|
|
dkms remove -m @PACKAGE@ -v %{version} --all --rpm_safe_upgrade
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%endif
|