Blame SPECS/kmod-sata_sil24.spec

951e55
%global pkg sata_sil24
951e55
Kmods SIG 4072f3
%global driver_version 4.18.0-372.9.1.el8
Kmods SIG d9b04e
Kmods SIG 4072f3
%global kernel_version 4.18.0-372.9.1.el8
951e55
951e55
%global _use_internal_dependency_generator 0
a07eb0
%global __find_requires /usr/lib/rpm/redhat/find-requires
a07eb0
%global __find_provides /usr/lib/rpm/redhat/find-provides
951e55
951e55
%global debug_package %{nil}
951e55
951e55
%global __spec_install_post \
951e55
  %{?__debug_package:%{__debug_install_post}} \
951e55
  %{__arch_install_post} \
951e55
  %{__os_install_post} \
951e55
  %{__mod_compress_install_post}
951e55
951e55
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
951e55
951e55
951e55
Name:             kmod-%{pkg}
Kmods SIG 4072f3
Version:          4.18.0.372.9.1
Kmods SIG 4072f3
Release:          1%{?dist}
951e55
Summary:          Silicon Image 3124/3132 SATA Controller (%{pkg}) driver
951e55
62ffbc
License:          GPLv2 and GPLv2+
951e55
URL:              https://www.kernel.org/
951e55
Kmods SIG d9b04e
Source0:          %{pkg}-%{driver_version}.tar.xz
951e55
da3fd4
ExclusiveArch:    x86_64 aarch64 ppc64le
951e55
951e55
BuildRequires:    elfutils-libelf-devel
951e55
BuildRequires:    gcc
a07eb0
BuildRequires:    kernel-rpm-macros
951e55
BuildRequires:    kmod
951e55
BuildRequires:    make
951e55
BuildRequires:    redhat-rpm-config
951e55
BuildRequires:    xz
951e55
a07eb0
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
951e55
BuildRequires:    kernel-devel = %{kernel_version}
951e55
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
951e55
a07eb0
Requires:         kernel >= %{kernel_version}
a07eb0
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
a07eb0
Requires:         kernel-modules >= %{kernel_version}
a07eb0
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
951e55
951e55
Provides:         installonlypkg(kernel-module)
a07eb0
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
951e55
a07eb0
Requires(post):   %{_sbindir}/depmod
a07eb0
Requires(postun): %{_sbindir}/depmod
951e55
a07eb0
Requires(post):   %{_sbindir}/weak-modules
a07eb0
Requires(postun): %{_sbindir}/weak-modules
951e55
951e55
a5439e
%if "%{version}" == "4.18.0.80" && "%{release}" == "2%{?dist}"
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
a5439e
%endif
a5439e
a5439e
%if "%{version}" == "4.18.0.80" && "%{release}" == "3%{?dist}"
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
a5439e
%endif
a5439e
a5439e
%if "%{version}" == "4.18.0.80" && "%{release}" == "4%{?dist}"
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
a5439e
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-3%{?dist}
a5439e
%endif
a5439e
a5439e
951e55
%description
951e55
This driver supports Silicon Image 3124/3132 SATA controllers.
951e55
951e55
951e55
%prep
Kmods SIG d9b04e
%autosetup -p1 -n %{pkg}-%{driver_version}
951e55
951e55
951e55
%build
951e55
pushd src
951e55
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
951e55
popd
951e55
951e55
951e55
%install
951e55
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata src/%{pkg}.ko
951e55
951e55
# Make .ko objects temporarily executable for automatic stripping
951e55
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
951e55
951e55
951e55
%clean
951e55
%{__rm} -rf %{buildroot}
951e55
951e55
951e55
%post
951e55
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a07eb0
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/ata/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
951e55
951e55
951e55
%preun
951e55
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
a07eb0
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
951e55
951e55
951e55
%postun
a07eb0
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
951e55
then
a07eb0
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
a07eb0
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
951e55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a07eb0
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
951e55
fi
951e55
951e55
a07eb0
%pretrans -p <lua>
a07eb0
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
a07eb0
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
a07eb0
a07eb0
951e55
%posttrans
a07eb0
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
951e55
then
a07eb0
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
a07eb0
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
951e55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
a07eb0
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
951e55
fi
951e55
951e55
951e55
%files
951e55
%defattr(644,root,root,755)
951e55
/lib/modules/%{kernel_version}.%{_arch}
66e187
%license LICENSES
951e55
951e55
951e55
%changelog
Kmods SIG 4072f3
* Tue May 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.372.9.1-1
Kmods SIG 4072f3
- Update to 4.18.0-372.9.1.el8
Kmods SIG 4072f3
a5439e
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-4
a5439e
- Add obsoletes for update path
a5439e
a9d9ee
* Wed Jan 26 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-3
a9d9ee
- Drop dracut conf
a9d9ee
da3fd4
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.80-2
da3fd4
- Enable aarch64 and ppc64le
da3fd4
Kmods SIG d9b04e
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.80-1
Kmods SIG d9b04e
- Switch to EL kernel source and versioning
Kmods SIG d9b04e
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)