Blame SPECS/kmod-arcmsr.spec

eaa0ab
%global pkg arcmsr
eaa0ab
Kmods SIG 8c3d00
%global driver_version 4.18.0-257.el8
Kmods SIG 8c3d00
Kmods SIG 30cec8
%global kernel_version 4.18.0-358.el8
eaa0ab
eaa0ab
%global _use_internal_dependency_generator 0
496657
%global __find_requires /usr/lib/rpm/redhat/find-requires
496657
%global __find_provides /usr/lib/rpm/redhat/find-provides
eaa0ab
eaa0ab
%global debug_package %{nil}
eaa0ab
eaa0ab
%global __spec_install_post \
eaa0ab
  %{?__debug_package:%{__debug_install_post}} \
eaa0ab
  %{__arch_install_post} \
eaa0ab
  %{__os_install_post} \
eaa0ab
  %{__mod_compress_install_post}
eaa0ab
eaa0ab
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
eaa0ab
eaa0ab
eaa0ab
Name:             kmod-%{pkg}
Kmods SIG 8c3d00
Version:          4.18.0.257
46d9e2
Release:          5%{?dist}
eaa0ab
Summary:          ARECA ARC11xx/12xx/13xx/16xx SATA/SAS RAID Controller (%{pkg}) driver
eaa0ab
eaa0ab
License:          GPLv2
eaa0ab
URL:              https://www.kernel.org/
eaa0ab
Kmods SIG 8c3d00
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG 8c3d00
Patch1:           0001-scsi-arcmsr-Fix-error-of-resuming-from-hibernation-f.patch
Kmods SIG 8c3d00
Patch9999:        9999-enable-arcmsr.patch
eaa0ab
9794ff
ExclusiveArch:    x86_64 aarch64 ppc64le
eaa0ab
eaa0ab
BuildRequires:    elfutils-libelf-devel
eaa0ab
BuildRequires:    gcc
496657
BuildRequires:    kernel-rpm-macros
eaa0ab
BuildRequires:    kmod
eaa0ab
BuildRequires:    make
eaa0ab
BuildRequires:    redhat-rpm-config
eaa0ab
BuildRequires:    xz
eaa0ab
496657
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
eaa0ab
BuildRequires:    kernel-devel = %{kernel_version}
eaa0ab
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
eaa0ab
496657
Requires:         kernel >= %{kernel_version}
496657
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
496657
Requires:         kernel-modules >= %{kernel_version}
496657
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
eaa0ab
eaa0ab
Provides:         installonlypkg(kernel-module)
496657
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
eaa0ab
496657
Requires(post):   %{_sbindir}/depmod
496657
Requires(postun): %{_sbindir}/depmod
eaa0ab
496657
Requires(post):   %{_sbindir}/weak-modules
496657
Requires(postun): %{_sbindir}/weak-modules
eaa0ab
eaa0ab
46d9e2
%if "%{version}" == "4.18.0.257" && "%{release}" == "3%{?dist}"
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
46d9e2
%endif
46d9e2
46d9e2
%if "%{version}" == "4.18.0.257" && "%{release}" == "4%{?dist}"
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
46d9e2
%endif
46d9e2
46d9e2
%if "%{version}" == "4.18.0.257" && "%{release}" == "5%{?dist}"
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
46d9e2
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-4%{?dist}
46d9e2
%endif
46d9e2
46d9e2
eaa0ab
%description
eaa0ab
This driver supports ARECA's SATA/SAS RAID controller cards.
eaa0ab
eaa0ab
eaa0ab
%prep
Kmods SIG 8c3d00
%autosetup -p1 -n %{pkg}-%{driver_version}
eaa0ab
eaa0ab
eaa0ab
%build
eaa0ab
pushd src
eaa0ab
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
eaa0ab
popd
eaa0ab
eaa0ab
eaa0ab
%install
eaa0ab
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
eaa0ab
eaa0ab
# Make .ko objects temporarily executable for automatic stripping
eaa0ab
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
eaa0ab
eaa0ab
eaa0ab
%clean
eaa0ab
%{__rm} -rf %{buildroot}
eaa0ab
eaa0ab
eaa0ab
%post
eaa0ab
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
496657
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
eaa0ab
eaa0ab
eaa0ab
%preun
eaa0ab
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
496657
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
eaa0ab
eaa0ab
eaa0ab
%postun
496657
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
eaa0ab
then
496657
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
496657
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
eaa0ab
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
496657
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
eaa0ab
fi
eaa0ab
eaa0ab
496657
%pretrans -p <lua>
496657
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
496657
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
496657
496657
eaa0ab
%posttrans
496657
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
eaa0ab
then
496657
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
496657
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
eaa0ab
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
496657
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
eaa0ab
fi
eaa0ab
eaa0ab
eaa0ab
%files
eaa0ab
%defattr(644,root,root,755)
eaa0ab
/lib/modules/%{kernel_version}.%{_arch}
76002f
%license LICENSES
eaa0ab
eaa0ab
eaa0ab
%changelog
46d9e2
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.257-5
46d9e2
- Add obsoletes for update path
46d9e2
cdde40
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.257-4
cdde40
- Drop dracut conf
cdde40
9794ff
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.257-3
9794ff
- Enable ppc64le
9794ff
Kmods SIG 30cec8
* Mon Jan 17 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.257-2
Kmods SIG 30cec8
- Rebuild for 4.18.0-358.el8
Kmods SIG 30cec8
Kmods SIG 8c3d00
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.257-1
Kmods SIG 8c3d00
- Switch to EL kernel source and versioning
Kmods SIG 8c3d00
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)