Blame SPECS/kmod-isci.spec

7c8af8
%global pkg isci
7c8af8
fcd78c
%global kernel_version_min 4.18.0-80.el8
fcd78c
fcd78c
# To pick a specific kernel use `--define "kernel_version 4.18.0-315.el8"`
fcd78c
# Otherwise the latest installed kernel-devel version later than
fcd78c
# %%{kernel_version_min} will be used.
fcd78c
fcd78c
%global kernel_version_latest %({ echo %{kernel_version_min}; rpm --query kernel-devel --queryformat '%%{VERSION}-%%{RELEASE}\\\n' | grep -v "package kernel-devel is not installed"; } | sort -V | sed -e '0,/^%{kernel_version_min}$/d' | tail -n 1)
fcd78c
fcd78c
%if "%{kernel_version_latest}" != ""
fcd78c
%{!?kernel_version:%{expand:%%global kernel_version %{kernel_version_latest}}}
fcd78c
%endif
7c8af8
7c8af8
%global _use_internal_dependency_generator 0
fff7cc
%global __find_requires %{nil}
534841
%global __find_provides /usr/lib/rpm/find-provides
7c8af8
7c8af8
%global debug_package %{nil}
7c8af8
7c8af8
%global __spec_install_post \
7c8af8
  %{?__debug_package:%{__debug_install_post}} \
7c8af8
  %{__arch_install_post} \
7c8af8
  %{__os_install_post} \
7c8af8
  %{__mod_compress_install_post}
7c8af8
7c8af8
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
7c8af8
7c8af8
7c8af8
Name:             kmod-%{pkg}
7c8af8
Version:          5.0
220fd3
Release:          2%{?dist}
7c8af8
Summary:          Intel(R) C600 Series Chipset SAS Controller (%{pkg}) driver
7c8af8
7c8af8
License:          GPLv2 and (BSD or GPLv2)
7c8af8
URL:              https://www.kernel.org/
7c8af8
7c8af8
Source0:          %{pkg}-%{version}.tar.xz
7c8af8
7c8af8
ExclusiveArch:    x86_64
7c8af8
7c8af8
BuildRequires:    elfutils-libelf-devel
7c8af8
BuildRequires:    gcc
7c8af8
BuildRequires:    kmod
7c8af8
BuildRequires:    make
7c8af8
BuildRequires:    redhat-rpm-config
7c8af8
BuildRequires:    xz
7c8af8
fcd78c
%{!?kernel_version:
fcd78c
BuildRequires:    kernel-devel >= %{kernel_version_min}
fcd78c
}
fcd78c
fcd78c
%{?kernel_version:
fcd78c
BuildRequires:    kernel-devel = %{kernel_version}
16ef23
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
fcd78c
d96637
Requires:         kernel-core = %{kernel_version}
16ef23
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
c544ae
Requires:         kernel-modules = %{kernel_version}
16ef23
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
fcd78c
0ffbc8
Provides:         installonlypkg(kernel-module)
2de535
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
fcd78c
}
fcd78c
7c8af8
Requires(post):   /usr/sbin/depmod
7c8af8
Requires(postun): /usr/sbin/depmod
7c8af8
7c8af8
7c8af8
%description
7c8af8
This driver supports the 6Gb/s SAS capabilities of the storage control unit
7c8af8
found in the Intel(R) C600 series chipset. Supported devices:
7c8af8
7c8af8
- 0x8086:0x1D60
7c8af8
- 0x8086:0x1D61
7c8af8
- 0x8086:0x1D62
7c8af8
- 0x8086:0x1D63
7c8af8
- 0x8086:0x1D64
7c8af8
- 0x8086:0x1D65
7c8af8
- 0x8086:0x1D66
7c8af8
- 0x8086:0x1D67
7c8af8
- 0x8086:0x1D68
7c8af8
- 0x8086:0x1D69
7c8af8
- 0x8086:0x1D6A
7c8af8
- 0x8086:0x1D6B
7c8af8
7c8af8
7c8af8
%prep
7c8af8
%autosetup -p1 -n %{pkg}-%{version}
7c8af8
7c8af8
7c8af8
%build
7c8af8
pushd src
7c8af8
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
7c8af8
popd
7c8af8
7c8af8
7c8af8
%install
7c8af8
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
7c8af8
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
7c8af8
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
7c8af8
7c8af8
# Make .ko objects temporarily executable for automatic stripping
7c8af8
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
7c8af8
7c8af8
7c8af8
%clean
7c8af8
%{__rm} -rf %{buildroot}
7c8af8
7c8af8
7c8af8
%post
f32a3a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
f32a3a
f32a3a
%preun
f32a3a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
7c8af8
7c8af8
7c8af8
%postun
f32a3a
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
f32a3a
then
f32a3a
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
f32a3a
    then
f32a3a
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
f32a3a
    fi
f32a3a
f32a3a
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
fi
f32a3a
f32a3a
f32a3a
%posttrans
f32a3a
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
f32a3a
then
f32a3a
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
f32a3a
    then
f32a3a
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
f32a3a
    fi
f32a3a
f32a3a
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
fi
7c8af8
7c8af8
7c8af8
%files
7c8af8
%defattr(644,root,root,755)
7c8af8
/lib/modules/%{kernel_version}.%{_arch}
7c8af8
%license COPYING
7c8af8
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
7c8af8
7c8af8
7c8af8
%changelog
220fd3
* Thu Jul 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-2
220fd3
- Rebuild for 4.18.0-326.el8
220fd3
7c8af8
* Wed Jul 21 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-1
7c8af8
- Initial version