Blame SPECS/kmod-isci.spec

b1bdcf
%global pkg isci
b1bdcf
Kmods SIG 86b0cb
%global kernel_version 5.14.0-38.el9
b1bdcf
b1bdcf
%global debug_package %{nil}
b1bdcf
b1bdcf
%global __spec_install_post \
b1bdcf
  %{?__debug_package:%{__debug_install_post}} \
b1bdcf
  %{__arch_install_post} \
b1bdcf
  %{__os_install_post} \
b1bdcf
  %{__mod_compress_install_post}
b1bdcf
b1bdcf
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
b1bdcf
b1bdcf
b1bdcf
Name:             kmod-%{pkg}
b1bdcf
Version:          5.14
Kmods SIG 86b0cb
Release:          9%{?dist}
b1bdcf
Summary:          Intel(R) C600 Series Chipset SAS Controller (%{pkg}) driver
b1bdcf
b1bdcf
License:          GPLv2 and (BSD or GPLv2)
b1bdcf
URL:              https://www.kernel.org/
b1bdcf
b1bdcf
Source0:          %{pkg}-%{version}.tar.xz
b1bdcf
b1bdcf
ExclusiveArch:    x86_64
b1bdcf
b1bdcf
BuildRequires:    elfutils-libelf-devel
b1bdcf
BuildRequires:    gcc
d7b5cd
BuildRequires:    kernel-rpm-macros
b1bdcf
BuildRequires:    kmod
b1bdcf
BuildRequires:    make
b1bdcf
BuildRequires:    redhat-rpm-config
b1bdcf
BuildRequires:    xz
b1bdcf
d7b5cd
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
b1bdcf
BuildRequires:    kernel-devel = %{kernel_version}
b1bdcf
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
b1bdcf
d7b5cd
Requires:         kernel >= %{kernel_version}
d7b5cd
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
d7b5cd
Requires:         kernel-modules >= %{kernel_version}
d7b5cd
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
b1bdcf
b1bdcf
Provides:         installonlypkg(kernel-module)
d7b5cd
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
b1bdcf
d7b5cd
Requires(post):   %{_sbindir}/depmod
d7b5cd
Requires(postun): %{_sbindir}/depmod
b1bdcf
d7b5cd
Requires(post):   %{_sbindir}/weak-modules
d7b5cd
Requires(postun): %{_sbindir}/weak-modules
b1bdcf
b1bdcf
b1bdcf
%description
b1bdcf
This driver supports the 6Gb/s SAS capabilities of the storage control unit
b1bdcf
found in the Intel(R) C600 series chipset. Supported devices:
b1bdcf
b1bdcf
- 0x8086:0x1D60
b1bdcf
- 0x8086:0x1D61
b1bdcf
- 0x8086:0x1D62
b1bdcf
- 0x8086:0x1D63
b1bdcf
- 0x8086:0x1D64
b1bdcf
- 0x8086:0x1D65
b1bdcf
- 0x8086:0x1D66
b1bdcf
- 0x8086:0x1D67
b1bdcf
- 0x8086:0x1D68
b1bdcf
- 0x8086:0x1D69
b1bdcf
- 0x8086:0x1D6A
b1bdcf
- 0x8086:0x1D6B
b1bdcf
b1bdcf
b1bdcf
%prep
b1bdcf
%autosetup -p1 -n %{pkg}-%{version}
b1bdcf
b1bdcf
b1bdcf
%build
b1bdcf
pushd src
b1bdcf
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
b1bdcf
popd
b1bdcf
b1bdcf
b1bdcf
%install
b1bdcf
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
b1bdcf
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
b1bdcf
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
b1bdcf
b1bdcf
# Make .ko objects temporarily executable for automatic stripping
b1bdcf
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
b1bdcf
b1bdcf
b1bdcf
%clean
b1bdcf
%{__rm} -rf %{buildroot}
b1bdcf
b1bdcf
b1bdcf
%post
b1bdcf
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
d7b5cd
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b1bdcf
b1bdcf
b1bdcf
%preun
b1bdcf
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
d7b5cd
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
b1bdcf
b1bdcf
b1bdcf
%postun
d7b5cd
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
b1bdcf
then
d7b5cd
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
d7b5cd
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
b1bdcf
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
d7b5cd
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
b1bdcf
fi
b1bdcf
b1bdcf
d7b5cd
%pretrans -p <lua>
d7b5cd
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
d7b5cd
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
d7b5cd
d7b5cd
b1bdcf
%posttrans
d7b5cd
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
b1bdcf
then
d7b5cd
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
d7b5cd
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b1bdcf
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
d7b5cd
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
b1bdcf
fi
b1bdcf
b1bdcf
b1bdcf
%files
b1bdcf
%defattr(644,root,root,755)
b1bdcf
/lib/modules/%{kernel_version}.%{_arch}
b1bdcf
%license COPYING
b1bdcf
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
b1bdcf
b1bdcf
b1bdcf
%changelog
Kmods SIG 86b0cb
* Fri Dec 24 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14-9
Kmods SIG 86b0cb
- Rebuild for 5.14.0-38.el9
Kmods SIG 86b0cb
Kmods SIG 74a12d
* Thu Dec 23 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14-8
Kmods SIG 74a12d
- Rebuild for 5.14.0-37.el9
Kmods SIG 74a12d
Kmods SIG ccf72e
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14-7
Kmods SIG ccf72e
- Rebuild for 5.14.0-36.el9
Kmods SIG ccf72e
d45327
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14-6
d45327
- Rebuild for 5.14.0-34.el9
d45327
- Skip unreleased kernel -32 and -33
Kmods SIG 350e94
178753
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14-5
178753
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)