mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
ecd3728b26
Ensure that the _unitdir, _presetdir, _modulesloaddir, and _systemdgeneratordir macros are always defined. If not set them to the expected default values. Pass all of these options to ./configure and package the resulting files in those locations. Additionally, set __brp_mangle_shebangs_exclude_from until the conversion to Python 3 is complete so they may be built cleanly under mock. Reviewed-by: Neal Gompa <ngompa@datto.com> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7567 Closes #8119
91 lines
2.4 KiB
RPMSpec
91 lines
2.4 KiB
RPMSpec
%bcond_with debug
|
|
%bcond_with debuginfo
|
|
|
|
# See comment in zfs.spec.in.
|
|
%global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
|
|
|
|
Name: @PACKAGE@-kmod
|
|
Version: @VERSION@
|
|
Release: @RELEASE@%{?dist}
|
|
|
|
Summary: Kernel module(s)
|
|
Group: System Environment/Kernel
|
|
License: @ZFS_META_LICENSE@
|
|
URL: http://zfsonlinux.org/
|
|
BuildRequires: %kernel_module_package_buildreqs
|
|
Source0: @PACKAGE@-%{version}.tar.gz
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
# Additional dependency information for the kmod sub-package must be specified
|
|
# by generating a preamble text file which kmodtool can append to the spec file.
|
|
%(/bin/echo -e "\
|
|
Requires: @PACKAGE@ = %{version}\n\
|
|
Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble\n\
|
|
Obsoletes: spl-kmod)
|
|
|
|
# LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
|
|
%ifarch ppc ppc64 ppc64le aarch64
|
|
%global __global_ldflags %{nil}
|
|
%endif
|
|
|
|
%description
|
|
This package contains the ZFS kernel modules.
|
|
|
|
%define kmod_name @PACKAGE@
|
|
|
|
%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
|
|
|
|
%define ksrc %{_usrsrc}/kernels/%{kverrel}
|
|
%define kobj %{ksrc}
|
|
|
|
%package -n kmod-%{kmod_name}-devel
|
|
Summary: ZFS kernel module(s) devel common
|
|
Group: System Environment/Kernel
|
|
|
|
%description -n kmod-%{kmod_name}-devel
|
|
This package provides the header files and objects to build kernel modules.
|
|
|
|
%prep
|
|
if ! [ -d "%{ksrc}" ]; then
|
|
echo "Kernel build directory isn't set properly, cannot continue"
|
|
exit 1
|
|
fi
|
|
|
|
%if %{with debug}
|
|
%define debug --enable-debug
|
|
%else
|
|
%define debug --disable-debug
|
|
%endif
|
|
|
|
%if %{with debuginfo}
|
|
%define debuginfo --enable-debuginfo
|
|
%else
|
|
%define debuginfo --disable-debuginfo
|
|
%endif
|
|
|
|
%setup -n %{kmod_name}-%{version}
|
|
%build
|
|
%configure \
|
|
--with-config=kernel \
|
|
--with-linux=%{ksrc} \
|
|
--with-linux-obj=%{kobj} \
|
|
%{debug} \
|
|
%{debuginfo}
|
|
make %{?_smp_mflags}
|
|
|
|
%install
|
|
make install \
|
|
DESTDIR=${RPM_BUILD_ROOT} \
|
|
INSTALL_MOD_DIR=extra/%{kmod_name}
|
|
%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
|
|
|
|
# find-debuginfo.sh only considers executables
|
|
%{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%files -n kmod-%{kmod_name}-devel
|
|
%{_usrsrc}/%{kmod_name}-%{version}
|
|
%{_usrsrc}/spl-%{version}
|