Blame SPECS/kmod-sata_sil24.spec

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