File zfs-kmod.spec of Package zfs
#
# spec file for package zfs-kmod
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define pkg_name zfs
%bcond_with debug
%bcond_with debug_dmu_tx
Name: %{pkg_name}-kmod
Version: 0.6.5.3
Release: 0
Summary: Kernel module(s)
License: CDDL-1.0
Group: System/Filesystems
Url: http://zfsonlinux.org/
Source0: https://github.com/zfsonlinux/zfs/archive/%{pkg_name}-%{version}.tar.gz
BuildRequires: %{kernel_module_package_buildreqs}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: spl-kmod-devel = %{version}
%if 0%{?suse_version} > 1310
BuildRequires: kmod-compat
%endif
%if 0%{?sles_version} == 11
#!BuildIgnore: post-build-checks
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%suse_kernel_module_package -n %{pkg_name} -p %{name}.preamble um xen
%description
This package contains the ZFS kernel modules.
%package devel
Summary: Headers and Symbols
Group: Development/Libraries/C and C++
# The developments headers will conflict with the dkms packages.
Conflicts: %{pkg_name}-dkms
%description devel
This package contains the header files and Module{s}.symvers
symbols needed for building additional modules.
%prep
%if %{with debug}
%define debug --enable-debug
%else
%define debug --disable-debug
%endif
%if %{with debug_dmu_tx}
%define debug_dmu_tx --enable-debug-dmu-tx
%else
%define debug_dmu_tx --disable-debug-dmu-tx
%endif
%setup -q -n %{pkg_name}-%{pkg_name}-%{version}
%build
./autogen.sh
mkdir -p ../obj
for flavor in %{flavors_to_build}; do
krel=$(make -s -C %{_usrsrc}/linux-obj/%{_target_cpu}/$flavor kernelrelease)
rm -rf ../obj/$flavor
cp -r ../%{pkg_name}-%{pkg_name}-%{version} ../obj/$flavor
pushd ../obj/$flavor
%configure \
--with-config=kernel \
--with-linux=%{_usrsrc}/linux \
--with-linux-obj=%{_usrsrc}/linux-obj/%{_target_cpu}/$flavor \
--with-spl=%{_usrsrc}/spl-%{version} \
--with-spl-obj=%{_usrsrc}/spl-%{version}/$krel \
%{debug} \
%{debug_dmu_tx}
# SLES 11 hack
%if 0%{?sles_version} == 11
sed -e "s|/\* #undef HAVE_BDI_SETUP_AND_REGISTER \*/|#define HAVE_BDI_SETUP_AND_REGISTER 1|" -i zfs_config.h
%endif
make %{?_smp_mflags}
popd
done
%install
for flavor in %{flavors_to_build}; do
pushd ../obj/$flavor
make DESTDIR=%{buildroot} install
popd
done
%files devel
%defattr(-,root,root)
%{_usrsrc}/%{pkg_name}-*
%changelog