Blame SPECS/kmod-isci.spec

7c8af8
%global pkg isci
7c8af8
43fd81
%global kernel_version 4.18.0-315.el8
7c8af8
7c8af8
%global _use_internal_dependency_generator 0
43fd81
%global __find_requires /usr/lib/rpm/redhat/find-requires
43fd81
%global __find_provides /usr/lib/rpm/redhat/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
43fd81
Release:          5%{?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
43fd81
BuildRequires:    kernel-rpm-macros
7c8af8
BuildRequires:    kmod
7c8af8
BuildRequires:    make
7c8af8
BuildRequires:    redhat-rpm-config
7c8af8
BuildRequires:    xz
7c8af8
43fd81
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
fcd78c
BuildRequires:    kernel-devel = %{kernel_version}
16ef23
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
fcd78c
43fd81
Requires:         kernel >= %{kernel_version}
43fd81
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
43fd81
Requires:         kernel-modules >= %{kernel_version}
43fd81
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
fcd78c
0ffbc8
Provides:         installonlypkg(kernel-module)
43fd81
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
fcd78c
43fd81
Requires(post):   %{_sbindir}/depmod
43fd81
Requires(postun): %{_sbindir}/depmod
7c8af8
43fd81
Requires(post):   %{_sbindir}/weak-modules
43fd81
Requires(postun): %{_sbindir}/weak-modules
732eee
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
43fd81
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
f32a3a
f32a3a
f32a3a
%preun
f32a3a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
43fd81
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
7c8af8
7c8af8
7c8af8
%postun
43fd81
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
f32a3a
then
43fd81
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
43fd81
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
43fd81
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
f32a3a
fi
f32a3a
f32a3a
43fd81
%pretrans -p <lua>
43fd81
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
43fd81
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
43fd81
43fd81
f32a3a
%posttrans
43fd81
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
f32a3a
then
43fd81
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
43fd81
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
43fd81
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
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
43fd81
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-5
43fd81
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)