diff options
author | Brian Behlendorf <[email protected]> | 2013-07-27 04:42:57 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-08-01 09:48:07 -0700 |
commit | cb79a4e8bb19908235d3cb646506530457341b76 (patch) | |
tree | 88e54ce6c245bedf1af0e81b99a05eeeca663e21 /rpm/generic/zfs-kmod.spec.in | |
parent | 57b650b86f15793195f9bf2185e1161c7c67904d (diff) |
Add kmod repo integration
When the kmod packaging infrastructure was originally added the
dependency on the rpmfusion yum repositories was disabled. This
was done at the time in favour of getting local builds working.
Now the time has come to conditionally re-enable that functionality
so we can properly provide binary kmod packages.
./configure --with-config=srpm
make SRPM_DEFINE_KMOD='--define="repo rpmfusion"' srpm-kmod
mock rebuild zfs-kmod-x.y.z-r.el6.src.rpm
One nice benefit of finishing this work is that the generic and
fedora spl-kmod spec files can be merged again.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'rpm/generic/zfs-kmod.spec.in')
-rw-r--r-- | rpm/generic/zfs-kmod.spec.in | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in index cec3f3f71..2ea4bcb0b 100644 --- a/rpm/generic/zfs-kmod.spec.in +++ b/rpm/generic/zfs-kmod.spec.in @@ -1,4 +1,11 @@ %define module @PACKAGE@ +#define repo rpmfusion +#define repo chaos + +# (un)define the next line to either build for the newest or all current kernels +%define buildforkernels newest +#define buildforkernels current +#define buildforkernels akmod %bcond_with debug %bcond_with debug_dmu_tx @@ -20,18 +27,20 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n) # The developments headers will conflict with the dkms packages. Conflicts: %{module}-dkms -# Source packages minimally require a kernel-devel dependency. +%if %{defined repo} + +# Building for a repository use the proper build-sysbuild package +# to determine which kernel-devel packages should be installed. +BuildRequires: %{_bindir}/kmodtool +%{!?kernels:BuildRequires: buildsys-build-%{repo}-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}} + +%else + +# Building local packages attempt to to use the installed kernel. %{?rhel:BuildRequires: kernel-devel} %{?fedora:BuildRequires: kernel-devel} %{?suse_version:BuildRequires: kernel-source} -%if 0%{?rhel}%{?fedora}%{?suse_version} -BuildRequires: spl-devel-kmod = %{version} -%global KmodsBuildRequires spl-devel-kmod -%global KmodsRequires kmod-spl -%endif - -# Binary packages build against all installed kernels by default. %if !%{defined kernels} && !%{defined build_src_rpm} %if 0%{?rhel}%{?fedora}%{?suse_version} %define kernels %(ls -1 /usr/src/kernels) @@ -39,6 +48,14 @@ BuildRequires: spl-devel-kmod = %{version} %define kernels %(ls -1 /lib/modules) %endif %endif +%endif + +%if 0%{?rhel}%{?fedora}%{?suse_version} +BuildRequires: kmod-spl-devel = %{version} +%global KmodsRequires kmod-spl +%global KmodsDevelRequires kmod-spl-devel +%global KmodsMetaRequires spl-kmod +%endif %if 0%{?fedora} >= 17 %define prefix /usr @@ -47,7 +64,7 @@ BuildRequires: spl-devel-kmod = %{version} # Kmodtool does its magic here. A patched version of kmodtool is shipped # with the source rpm until kmod development packages are supported upstream. # https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714 -%{expand:%(bash %{SOURCE10} --target %{_target_cpu} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } +%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -58,7 +75,7 @@ This package contains the ZFS kernel modules. %{?kmodtool_check} # Print kmodtool output for debugging purposes: -bash %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null +bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug |