Blame SPECS/kmod-hpsa.spec

b5727a
%global pkg hpsa
b5727a
b5727a
%global driver_version 5.14.0-1.el9
b5727a
1b9a1e
%global kernel_version 5.14.0-34.el9
b5727a
b5727a
%global debug_package %{nil}
b5727a
b5727a
%global __spec_install_post \
b5727a
  %{?__debug_package:%{__debug_install_post}} \
b5727a
  %{__arch_install_post} \
b5727a
  %{__os_install_post} \
b5727a
  %{__mod_compress_install_post}
b5727a
b5727a
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
b5727a
b5727a
b5727a
Name:             kmod-%{pkg}
9df476
Version:          5.14.0.1
Kmods SIG ff3cc5
Release:          2%{?dist}
b5727a
Summary:          HP Smart Array Controller (%{pkg}) driver
b5727a
b5727a
License:          GPLv2
b5727a
URL:              https://www.kernel.org/
b5727a
b5727a
Source0:          %{pkg}-%{driver_version}.tar.xz
b5727a
Patch1:           0001-add-deprecated-ids.patch
b5727a
b5727a
ExclusiveArch:    x86_64 aarch64
b5727a
b5727a
BuildRequires:    elfutils-libelf-devel
b5727a
BuildRequires:    gcc
9df476
BuildRequires:    kernel-rpm-macros
b5727a
BuildRequires:    kmod
b5727a
BuildRequires:    make
b5727a
BuildRequires:    redhat-rpm-config
b5727a
BuildRequires:    xz
b5727a
9df476
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
b5727a
BuildRequires:    kernel-devel = %{kernel_version}
b5727a
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
b5727a
9df476
Requires:         kernel >= %{kernel_version}
9df476
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
9df476
Requires:         kernel-modules >= %{kernel_version}
9df476
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
b5727a
b5727a
Provides:         installonlypkg(kernel-module)
9df476
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
b5727a
9df476
Requires(post):   %{_sbindir}/depmod
9df476
Requires(postun): %{_sbindir}/depmod
b5727a
9df476
Requires(post):   %{_sbindir}/weak-modules
9df476
Requires(postun): %{_sbindir}/weak-modules
b5727a
b5727a
b5727a
%description
b5727a
This package provides the HP Smart Array Controller (%{pkg}) driver.  Compared
b5727a
to the in-kernel driver this driver re-enables support for deprecated adapters
b5727a
originally used with the old cciss driver.
b5727a
b5727a
- 0x0E11:*:*:*:01:04: Compaq
b5727a
- 0x103C:*:*:*:01:04: HP
b5727a
b5727a
b5727a
%prep
b5727a
%autosetup -p1 -n %{pkg}-%{driver_version}
b5727a
b5727a
b5727a
%build
b5727a
pushd src
b5727a
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
b5727a
popd
b5727a
b5727a
b5727a
%install
b5727a
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi src/%{pkg}.ko
b5727a
b5727a
# Make .ko objects temporarily executable for automatic stripping
b5727a
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
b5727a
9df476
# Generate depmod.conf
9df476
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
9df476
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
9df476
do
9df476
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
9df476
done
9df476
b5727a
b5727a
%clean
b5727a
%{__rm} -rf %{buildroot}
b5727a
b5727a
b5727a
%post
b5727a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
9df476
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b5727a
b5727a
b5727a
%preun
b5727a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
9df476
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
b5727a
b5727a
b5727a
%postun
9df476
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
b5727a
then
9df476
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
9df476
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
b5727a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
9df476
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
b5727a
fi
b5727a
b5727a
9df476
%pretrans -p <lua>
9df476
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
9df476
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
9df476
9df476
b5727a
%posttrans
9df476
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
b5727a
then
9df476
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
9df476
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
b5727a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
9df476
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
b5727a
fi
b5727a
b5727a
b5727a
%files
b5727a
%defattr(644,root,root,755)
b5727a
/lib/modules/%{kernel_version}.%{_arch}
b5727a
%license COPYING
9df476
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
b5727a
b5727a
b5727a
%changelog
1b9a1e
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.1-2
1b9a1e
- Rebuild for 5.14.0-34.el9
1b9a1e
- Skip unreleased kernel -32 and -33
Kmods SIG ff3cc5
9df476
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.1-1
9df476
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)