Blame SPECS/kmod-isci.spec

c530b6
%global pkg isci
c530b6
Kmods SIG aaa8dc
%global driver_version 4.18.0-305.el8
Kmods SIG aaa8dc
Kmods SIG ccabaa
%global kernel_version 4.18.0-372.9.1.el8
c530b6
c530b6
%global _use_internal_dependency_generator 0
f89e7b
%global __find_requires /usr/lib/rpm/redhat/find-requires
f89e7b
%global __find_provides /usr/lib/rpm/redhat/find-provides
c530b6
c530b6
%global debug_package %{nil}
c530b6
c530b6
%global __spec_install_post \
c530b6
  %{?__debug_package:%{__debug_install_post}} \
c530b6
  %{__arch_install_post} \
c530b6
  %{__os_install_post} \
c530b6
  %{__mod_compress_install_post}
c530b6
c530b6
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
c530b6
c530b6
c530b6
Name:             kmod-%{pkg}
Kmods SIG aaa8dc
Version:          4.18.0.305
Kmods SIG ccabaa
Release:          4%{?dist}
c530b6
Summary:          Intel(R) C600 Series Chipset SAS Controller (%{pkg}) driver
c530b6
c530b6
License:          GPLv2 and (BSD or GPLv2)
c530b6
URL:              https://www.kernel.org/
c530b6
Kmods SIG aaa8dc
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG aaa8dc
Patch9999:        9999-enable-isci.patch
c530b6
c530b6
ExclusiveArch:    x86_64
c530b6
c530b6
BuildRequires:    elfutils-libelf-devel
c530b6
BuildRequires:    gcc
f89e7b
BuildRequires:    kernel-rpm-macros
c530b6
BuildRequires:    kmod
c530b6
BuildRequires:    make
c530b6
BuildRequires:    redhat-rpm-config
c530b6
BuildRequires:    xz
c530b6
f89e7b
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
c530b6
BuildRequires:    kernel-devel = %{kernel_version}
c530b6
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
c530b6
f89e7b
Requires:         kernel >= %{kernel_version}
f89e7b
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
f89e7b
Requires:         kernel-modules >= %{kernel_version}
f89e7b
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
c530b6
c530b6
Provides:         installonlypkg(kernel-module)
f89e7b
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
c530b6
f89e7b
Requires(post):   %{_sbindir}/depmod
f89e7b
Requires(postun): %{_sbindir}/depmod
c530b6
f89e7b
Requires(post):   %{_sbindir}/weak-modules
f89e7b
Requires(postun): %{_sbindir}/weak-modules
c530b6
c530b6
ac471e
%if "%{version}" == "4.18.0.305" && "%{release}" == "2%{?dist}"
ac471e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
ac471e
%endif
ac471e
ac471e
%if "%{version}" == "4.18.0.305" && "%{release}" == "3%{?dist}"
ac471e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
ac471e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
ac471e
%endif
ac471e
ac471e
c530b6
%description
c530b6
This driver supports the 6Gb/s SAS capabilities of the storage control unit
c530b6
found in the Intel(R) C600 series chipset. Supported devices:
c530b6
c530b6
- 0x8086:0x1D60
c530b6
- 0x8086:0x1D61
c530b6
- 0x8086:0x1D62
c530b6
- 0x8086:0x1D63
c530b6
- 0x8086:0x1D64
c530b6
- 0x8086:0x1D65
c530b6
- 0x8086:0x1D66
c530b6
- 0x8086:0x1D67
c530b6
- 0x8086:0x1D68
c530b6
- 0x8086:0x1D69
c530b6
- 0x8086:0x1D6A
c530b6
- 0x8086:0x1D6B
c530b6
c530b6
c530b6
%prep
Kmods SIG aaa8dc
%autosetup -p1 -n %{pkg}-%{driver_version}
c530b6
c530b6
c530b6
%build
c530b6
pushd src
c530b6
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
c530b6
popd
c530b6
c530b6
c530b6
%install
c530b6
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
c530b6
c530b6
# Make .ko objects temporarily executable for automatic stripping
c530b6
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
c530b6
c530b6
c530b6
%clean
c530b6
%{__rm} -rf %{buildroot}
c530b6
c530b6
c530b6
%post
c530b6
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f89e7b
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
c530b6
c530b6
c530b6
%preun
c530b6
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f89e7b
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
c530b6
c530b6
c530b6
%postun
f89e7b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
c530b6
then
f89e7b
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
f89e7b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
c530b6
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f89e7b
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
c530b6
fi
c530b6
c530b6
f89e7b
%pretrans -p <lua>
f89e7b
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
f89e7b
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
f89e7b
f89e7b
c530b6
%posttrans
f89e7b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
c530b6
then
f89e7b
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
f89e7b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
c530b6
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f89e7b
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
c530b6
fi
c530b6
c530b6
c530b6
%files
c530b6
%defattr(644,root,root,755)
c530b6
/lib/modules/%{kernel_version}.%{_arch}
092d48
%license LICENSES
c530b6
c530b6
c530b6
%changelog
Kmods SIG ccabaa
* Tue May 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.305-4
Kmods SIG ccabaa
- Rebuild for 4.18.0-372.9.1.el8
Kmods SIG ccabaa
ac471e
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-3
ac471e
- Add obsoletes for update path
ac471e
6b5a6c
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-2
6b5a6c
- Drop dracut conf
6b5a6c
Kmods SIG aaa8dc
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.305-1
Kmods SIG aaa8dc
- Switch to EL kernel source and versioning
Kmods SIG aaa8dc
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)