Blame SPECS/kmod-hpsa.spec

34d075
%global pkg hpsa
34d075
Kmods SIG 9bdda1
%global driver_version 4.18.0-373.el8
34d075
Kmods SIG 9bdda1
%global kernel_version 4.18.0-373.el8
34d075
34d075
%global _use_internal_dependency_generator 0
8efc6b
%global __find_requires /usr/lib/rpm/redhat/find-requires
8efc6b
%global __find_provides /usr/lib/rpm/redhat/find-provides
34d075
34d075
%global debug_package %{nil}
34d075
34d075
%global __spec_install_post \
34d075
  %{?__debug_package:%{__debug_install_post}} \
34d075
  %{__arch_install_post} \
34d075
  %{__os_install_post} \
34d075
  %{__mod_compress_install_post}
34d075
34d075
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
34d075
34d075
34d075
Name:             kmod-%{pkg}
Kmods SIG 9bdda1
Version:          4.18.0.373
Kmods SIG 9bdda1
Release:          1%{?dist}
34d075
Summary:          HP Smart Array Controller (%{pkg}) driver
34d075
34d075
License:          GPLv2
34d075
URL:              https://www.kernel.org/
34d075
834d6b
Source0:          %{pkg}-%{driver_version}.tar.xz
34d075
Patch1:           0001-add-deprecated-ids.patch
34d075
afcc28
ExclusiveArch:    x86_64 aarch64 ppc64le
34d075
34d075
BuildRequires:    elfutils-libelf-devel
34d075
BuildRequires:    gcc
8efc6b
BuildRequires:    kernel-rpm-macros
34d075
BuildRequires:    kmod
34d075
BuildRequires:    make
34d075
BuildRequires:    redhat-rpm-config
34d075
BuildRequires:    xz
34d075
8efc6b
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
34d075
BuildRequires:    kernel-devel = %{kernel_version}
8891ce
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
34d075
8efc6b
Requires:         kernel >= %{kernel_version}
8efc6b
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
8efc6b
Requires:         kernel-modules >= %{kernel_version}
8efc6b
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
34d075
ad4ffb
Provides:         installonlypkg(kernel-module)
8efc6b
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
34d075
8efc6b
Requires(post):   %{_sbindir}/depmod
8efc6b
Requires(postun): %{_sbindir}/depmod
34d075
8efc6b
Requires(post):   %{_sbindir}/weak-modules
8efc6b
Requires(postun): %{_sbindir}/weak-modules
f1ffb3
34d075
a672ca
%if "%{version}" == "4.18.0.305" && "%{release}" == "6%{?dist}"
a672ca
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-5%{?dist}
a672ca
%endif
a672ca
a672ca
%if "%{version}" == "4.18.0.305" && "%{release}" == "7%{?dist}"
a672ca
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-5%{?dist}
a672ca
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-6%{?dist}
a672ca
%endif
a672ca
a672ca
34d075
%description
34d075
This package provides the HP Smart Array Controller (%{pkg}) driver.  Compared
34d075
to the in-kernel driver this driver re-enables support for deprecated adapters
34d075
originally used with the old cciss driver.
34d075
34d075
- 0x0E11:*:*:*:01:04: Compaq
34d075
- 0x103C:*:*:*:01:04: HP
34d075
34d075
34d075
%prep
834d6b
%autosetup -p1 -n %{pkg}-%{driver_version}
34d075
34d075
34d075
%build
34d075
pushd src
34d075
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
34d075
popd
34d075
34d075
34d075
%install
34d075
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi src/%{pkg}.ko
34d075
34d075
# Make .ko objects temporarily executable for automatic stripping
34d075
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
34d075
8efc6b
# Generate depmod.conf
8efc6b
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
8efc6b
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
8efc6b
do
8efc6b
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
8efc6b
done
8efc6b
34d075
34d075
%clean
34d075
%{__rm} -rf %{buildroot}
34d075
34d075
34d075
%post
708e63
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8efc6b
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
708e63
708e63
708e63
%preun
708e63
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8efc6b
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
34d075
34d075
34d075
%postun
8efc6b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
708e63
then
8efc6b
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
8efc6b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
708e63
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8efc6b
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
708e63
fi
708e63
708e63
8efc6b
%pretrans -p <lua>
8efc6b
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
8efc6b
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
8efc6b
8efc6b
708e63
%posttrans
8efc6b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
708e63
then
8efc6b
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
8efc6b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
708e63
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8efc6b
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
708e63
fi
34d075
34d075
34d075
%files
34d075
%defattr(644,root,root,755)
34d075
/lib/modules/%{kernel_version}.%{_arch}
6211a2
%license LICENSES
8efc6b
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
34d075
34d075
34d075
%changelog
Kmods SIG 9bdda1
* Tue Mar 22 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.373-1
Kmods SIG 9bdda1
- Update to 4.18.0-373.el8
Kmods SIG 9bdda1
a672ca
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-7
a672ca
- Add obsoletes for update path
a672ca
afcc28
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-6
afcc28
- Enable ppc64le
afcc28
Kmods SIG 01e1ef
* Mon Jan 10 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.305-5
Kmods SIG 01e1ef
- Rebuild for 4.18.0-358.el8
Kmods SIG 01e1ef
c2f555
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-4
c2f555
- Rebuild for 4.18.0-348.el8
c2f555
128ceb
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-3
128ceb
- Rebuild for 4.18.0-338.el8
128ceb
6f87b8
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-2
6f87b8
- Rebuild for 4.18.0-326.el8
6f87b8
898766
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.305-1
b6bcf7
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
4f047a
- Build 4.18.0-305.el8 for 4.18.0-315.el8
b6bcf7
- Use release number independent of kernel
b6bcf7
- Add driver release number to version