Blame SPECS/kmod-megaraid_sas.spec

f3328c
%global pkg megaraid_sas
f3328c
Kmods SIG c7abea
%global driver_version 4.18.0-373.el8
f3328c
Kmods SIG c7abea
%global kernel_version 4.18.0-373.el8
f3328c
f3328c
%global _use_internal_dependency_generator 0
56fa8f
%global __find_requires /usr/lib/rpm/redhat/find-requires
56fa8f
%global __find_provides /usr/lib/rpm/redhat/find-provides
f3328c
f3328c
%global debug_package %{nil}
f3328c
f3328c
%global __spec_install_post \
f3328c
  %{?__debug_package:%{__debug_install_post}} \
f3328c
  %{__arch_install_post} \
f3328c
  %{__os_install_post} \
f3328c
  %{__mod_compress_install_post}
f3328c
f3328c
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
f3328c
f3328c
f3328c
Name:             kmod-%{pkg}
Kmods SIG c7abea
Version:          4.18.0.373
Kmods SIG 801843
Release:          1%{?dist}
f3328c
Summary:          Broadcom MegaRAID SAS (%{pkg}) driver
f3328c
d833b2
License:          GPLv2 and GPLv2+
f3328c
URL:              https://www.kernel.org/
f3328c
8b966e
Source0:          %{pkg}-%{driver_version}.tar.xz
f3328c
Patch1:           0001-add-deprecated-ids.patch
f3328c
0b89e0
ExclusiveArch:    x86_64 aarch64 ppc64le
f3328c
f3328c
BuildRequires:    elfutils-libelf-devel
f3328c
BuildRequires:    gcc
56fa8f
BuildRequires:    kernel-rpm-macros
f3328c
BuildRequires:    kmod
f3328c
BuildRequires:    make
f3328c
BuildRequires:    redhat-rpm-config
f3328c
BuildRequires:    xz
f3328c
56fa8f
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
f3328c
BuildRequires:    kernel-devel = %{kernel_version}
d4c797
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
f3328c
56fa8f
Requires:         kernel >= %{kernel_version}
56fa8f
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
56fa8f
Requires:         kernel-modules >= %{kernel_version}
56fa8f
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
f3328c
8015bc
Provides:         installonlypkg(kernel-module)
56fa8f
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
f3328c
56fa8f
Requires(post):   %{_sbindir}/depmod
56fa8f
Requires(postun): %{_sbindir}/depmod
f3328c
56fa8f
Requires(post):   %{_sbindir}/weak-modules
56fa8f
Requires(postun): %{_sbindir}/weak-modules
53e9b1
f3328c
cfddf4
%if "%{version}" == "4.18.0.358" && "%{release}" == "2%{?dist}"
cfddf4
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
cfddf4
%endif
cfddf4
cfddf4
%if "%{version}" == "4.18.0.358" && "%{release}" == "3%{?dist}"
cfddf4
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
cfddf4
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
cfddf4
%endif
cfddf4
cfddf4
f3328c
%description
f3328c
This package provides the Broadcom MegaRAID SAS (%{pkg}) driver. Compared to
f3328c
the in-kernel driver this driver re-enables support for deprecated adapters:
f3328c
f3328c
- 0x1000:0x0060: LSI MegaRAID SAS1078R
f3328c
- 0x1000:0x0078: LSI MegaRAID SAS1078 Gen2
f3328c
- 0x1000:0x007C: LSI MegaRAID SAS1078DE
f3328c
- 0x1000:0x0411: LSI MegaRAID SAS1064R
f3328c
- 0x1000:0x0413: LSI MegaRAID SAS1068 Verde ZCR
f3328c
- 0x1028:0x0015: Dell PERC5
f3328c
f3328c
The removal of the following adapters has been reverted in 4.18.0-290 [1761485]:
f3328c
- 0x1000:0x0071: LSI MegaRAID SAS0071 Skinny
f3328c
- 0x1000:0x0073: LSI MegaRAID SAS0073 Skinny
f3328c
- 0x1000:0x0079: LSI MegaRAID SAS0079 Gen2
f3328c
f3328c
f3328c
%prep
8b966e
%autosetup -p1 -n %{pkg}-%{driver_version}
f3328c
f3328c
f3328c
%build
f3328c
pushd src
f3328c
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
f3328c
popd
f3328c
f3328c
f3328c
%install
f3328c
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid src/%{pkg}.ko
f3328c
f3328c
# Make .ko objects temporarily executable for automatic stripping
f3328c
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
f3328c
56fa8f
# Generate depmod.conf
56fa8f
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
56fa8f
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
56fa8f
do
56fa8f
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
56fa8f
done
56fa8f
f3328c
f3328c
%clean
f3328c
%{__rm} -rf %{buildroot}
f3328c
f3328c
f3328c
%post
eccca9
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
56fa8f
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
eccca9
eccca9
eccca9
%preun
eccca9
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
56fa8f
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
f3328c
f3328c
f3328c
%postun
56fa8f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
eccca9
then
56fa8f
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
56fa8f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
eccca9
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
56fa8f
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
eccca9
fi
eccca9
eccca9
56fa8f
%pretrans -p <lua>
56fa8f
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
56fa8f
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
56fa8f
56fa8f
eccca9
%posttrans
56fa8f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
eccca9
then
56fa8f
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
56fa8f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
eccca9
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
56fa8f
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
eccca9
fi
f3328c
f3328c
f3328c
%files
f3328c
%defattr(644,root,root,755)
f3328c
/lib/modules/%{kernel_version}.%{_arch}
155e3b
%license LICENSES
56fa8f
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
f3328c
f3328c
f3328c
%changelog
Kmods SIG c7abea
* Tue Mar 22 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.373-1
Kmods SIG c7abea
- Update to 4.18.0-373.el8
Kmods SIG c7abea
Kmods SIG 801843
* Thu Feb 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.365-1
Kmods SIG 801843
- Update to 4.18.0-365.el8
Kmods SIG 801843
cfddf4
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-3
cfddf4
- Add obsoletes for update path
cfddf4
0b89e0
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.358-2
0b89e0
- Enable ppc64le
0b89e0
Kmods SIG 62fce8
* Fri Jan 07 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.358-1
Kmods SIG 62fce8
- Update to 4.18.0-358.el8
Kmods SIG 62fce8
fac263
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.348-1
fac263
- Update to 4.18.0-348.el8
fac263
23f7ee
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-2
23f7ee
- Rebuild for 4.18.0-338.el8
23f7ee
e6a0d7
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-1
e6a0d7
- Update to 4.18.0-326.el8
e6a0d7
798316
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.310-1
40ccd8
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
08b470
- Build 4.18.0-310.el8 for 4.18.0-315.el8
40ccd8
- Use release number independent of kernel
40ccd8
- Add driver release number to version