Blame SPECS/kmod-sata_sis.spec

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