Blame SPECS/kmod-hpsa.spec

34d075
%global pkg hpsa
34d075
834d6b
%global driver_version 4.18.0-305.el8
34d075
6f87b8
%global kernel_version 4.18.0-326.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}
898766
Version:          4.18.0.305
6f87b8
Release:          2%{?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
34d075
ExclusiveArch:    x86_64 aarch64
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
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}
34d075
%license COPYING
8efc6b
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
34d075
34d075
34d075
%changelog
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
b33a56
- Add driver release number to version
b33a56
4f047a
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-350
4f047a
- Use release number independent of kernel
4f047a
- Build 4.18.0-305.el8 for 4.18.0-315.el8
4f047a
8efc6b
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-348
8efc6b
- Convert to kABI tracking kmod package (kernel >= 4.18.0-326.el8)
8efc6b
1da0b0
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-338
1da0b0
- Set specific kernel version to use
1da0b0
- Rename kernel_version_min to driver_version
1da0b0
- Add Provides kernel-modules
1da0b0
- Rebuild for 4.18.0-338.el8
1da0b0
66f8fa
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
66f8fa
- Rebuild for 4.18.0-331.el8
66f8fa
db674d
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
4f95a5
- Rebuild for 4.18.0-326.el8
db674d
- Fix provides/requires
db674d
- Fix kernel dependencies
db674d
- Add convenient provides kmod-aacraid-`uname -r`
db674d
- Fix installonlypkg detection
db674d
- Recreate source tarballs
db674d
- Rebuild for dist = .el8s
db674d
db674d
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-305
34d075
- Initial version