diff options
author | Nathaniel Clark <[email protected]> | 2013-04-18 16:57:29 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-06-21 16:00:45 -0700 |
commit | 389cf730cedd42dd1ef653e9358635c114e458d5 (patch) | |
tree | 0199f863cb95a140c5678f6f1f5ea0d9407d2809 /rpm | |
parent | 81eaf151071eadbb3fba74d74324a0921c5fdb5f (diff) |
Make spl directory setable when building rpms and add --buildroot
This adds ability to set the location of spl via defines when
building from the spec files. This is useful for build systems
that build spl and zfs together without installing the actual rpms.
Signed-off-by: Nathaniel Clark <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1486
Diffstat (limited to 'rpm')
-rw-r--r-- | rpm/fedora/zfs-kmod.spec.in | 30 | ||||
-rw-r--r-- | rpm/generic/zfs-kmod.spec.in | 30 |
2 files changed, 52 insertions, 8 deletions
diff --git a/rpm/fedora/zfs-kmod.spec.in b/rpm/fedora/zfs-kmod.spec.in index 6a8e570a6..88ab3b24b 100644 --- a/rpm/fedora/zfs-kmod.spec.in +++ b/rpm/fedora/zfs-kmod.spec.in @@ -44,7 +44,7 @@ BuildRequires: spl-devel-kmod = %{version}-%{release} # 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:%(sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } +%{expand:%(sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -55,7 +55,7 @@ This package contains the ZFS kernel modules. %{?kmodtool_check} # Print kmodtool output for debugging purposes: -sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null +sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug @@ -69,6 +69,28 @@ sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --dev %define debug_dmu_tx --disable-debug-dmu-tx %endif +# +# Allow the overriding of spl locations +# +%if %{defined require_splver} +%define splver %{require_splver} +%else +%define splver %{version} +%endif + +%if %{defined require_spldir} +%define spldir %{require_spldir} +%else +%define spldir %{_usrsrc}/spl-%{splver} +%endif + +%if %{defined require_splobj} +%define splobj %{require_splobj} +%else +%define splobj %{spldir}/${kernel_version%%___*} +%endif + + # Leverage VPATH from configure to avoid making multiple copies. %define _configure ../%{module}-%{version}/configure @@ -85,8 +107,8 @@ for kernel_version in %{?kernel_versions}; do --with-config=kernel \ --with-linux="${kernel_version##*___}" \ --with-linux-obj="${kernel_version##*___}" \ - --with-spl="/usr/src/spl-%{version}" \ - --with-spl-obj="/usr/src/spl-%{version}/${kernel_version%%___*}" \ + --with-spl="%{spldir}" \ + --with-spl-obj="%{splobj}" \ %{debug} \ %{debug_dmu_tx} make %{?_smp_mflags} diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in index 9c427f76f..cec3f3f71 100644 --- a/rpm/generic/zfs-kmod.spec.in +++ b/rpm/generic/zfs-kmod.spec.in @@ -47,7 +47,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}"} 2>/dev/null) } +%{expand:%(bash %{SOURCE10} --target %{_target_cpu} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -58,7 +58,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}"} 2>/dev/null +bash %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug @@ -72,6 +72,28 @@ bash %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --d %define debug_dmu_tx --disable-debug-dmu-tx %endif +# +# Allow the overriding of spl locations +# +%if %{defined require_splver} +%define splver %{require_splver} +%else +%define splver %{version} +%endif + +%if %{defined require_spldir} +%define spldir %{require_spldir} +%else +%define spldir %{_usrsrc}/spl-%{splver} +%endif + +%if %{defined require_splobj} +%define splobj %{require_splobj} +%else +%define splobj %{spldir}/${kernel_version%%___*} +%endif + + # Leverage VPATH from configure to avoid making multiple copies. %define _configure ../%{module}-%{version}/configure @@ -98,8 +120,8 @@ for kernel_version in %{?kernel_versions}; do fi)" \ --with-linux-obj="/lib/modules/${kernel_version%%___*}/build" \ %endif - --with-spl="/usr/src/spl-%{version}" \ - --with-spl-obj="/usr/src/spl-%{version}/${kernel_version%%___*}" \ + --with-spl="%{spldir}" \ + --with-spl-obj="%{splobj}" \ %{debug} \ %{debug_dmu_tx} make %{?_smp_mflags} |