Blame SPECS/kmod-isci.spec

7c8af8
%global pkg isci
7c8af8
187ae5
%global kernel_version 4.18.0-331.el8
7c8af8
7c8af8
%global _use_internal_dependency_generator 0
fff7cc
%global __find_requires %{nil}
534841
%global __find_provides /usr/lib/rpm/find-provides
7c8af8
7c8af8
%global debug_package %{nil}
7c8af8
7c8af8
%global __spec_install_post \
7c8af8
  %{?__debug_package:%{__debug_install_post}} \
7c8af8
  %{__arch_install_post} \
7c8af8
  %{__os_install_post} \
7c8af8
  %{__mod_compress_install_post}
7c8af8
7c8af8
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
7c8af8
7c8af8
7c8af8
Name:             kmod-%{pkg}
7c8af8
Version:          5.0
260abf
Release:          3%{?dist}
7c8af8
Summary:          Intel(R) C600 Series Chipset SAS Controller (%{pkg}) driver
7c8af8
7c8af8
License:          GPLv2 and (BSD or GPLv2)
7c8af8
URL:              https://www.kernel.org/
7c8af8
7c8af8
Source0:          %{pkg}-%{version}.tar.xz
7c8af8
7c8af8
ExclusiveArch:    x86_64
7c8af8
7c8af8
BuildRequires:    elfutils-libelf-devel
7c8af8
BuildRequires:    gcc
7c8af8
BuildRequires:    kmod
7c8af8
BuildRequires:    make
7c8af8
BuildRequires:    redhat-rpm-config
7c8af8
BuildRequires:    xz
7c8af8
fcd78c
BuildRequires:    kernel-devel = %{kernel_version}
16ef23
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
fcd78c
d96637
Requires:         kernel-core = %{kernel_version}
16ef23
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
c544ae
Requires:         kernel-modules = %{kernel_version}
16ef23
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
fcd78c
0ffbc8
Provides:         installonlypkg(kernel-module)
d42af2
Provides:         kernel-modules = %{kernel_version}.%{_arch}
2de535
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
fcd78c
7c8af8
Requires(post):   /usr/sbin/depmod
7c8af8
Requires(postun): /usr/sbin/depmod
7c8af8
732eee
Requires(post):   /usr/bin/dracut
732eee
Requires(postun): /usr/bin/dracut
732eee
7c8af8
7c8af8
%description
7c8af8
This driver supports the 6Gb/s SAS capabilities of the storage control unit
7c8af8
found in the Intel(R) C600 series chipset. Supported devices:
7c8af8
7c8af8
- 0x8086:0x1D60
7c8af8
- 0x8086:0x1D61
7c8af8
- 0x8086:0x1D62
7c8af8
- 0x8086:0x1D63
7c8af8
- 0x8086:0x1D64
7c8af8
- 0x8086:0x1D65
7c8af8
- 0x8086:0x1D66
7c8af8
- 0x8086:0x1D67
7c8af8
- 0x8086:0x1D68
7c8af8
- 0x8086:0x1D69
7c8af8
- 0x8086:0x1D6A
7c8af8
- 0x8086:0x1D6B
7c8af8
7c8af8
7c8af8
%prep
7c8af8
%autosetup -p1 -n %{pkg}-%{version}
7c8af8
7c8af8
7c8af8
%build
7c8af8
pushd src
7c8af8
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
7c8af8
popd
7c8af8
7c8af8
7c8af8
%install
7c8af8
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
7c8af8
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
7c8af8
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
7c8af8
7c8af8
# Make .ko objects temporarily executable for automatic stripping
7c8af8
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
7c8af8
7c8af8
7c8af8
%clean
7c8af8
%{__rm} -rf %{buildroot}
7c8af8
7c8af8
7c8af8
%post
f32a3a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
f32a3a
f32a3a
%preun
f32a3a
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
7c8af8
7c8af8
7c8af8
%postun
f32a3a
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
f32a3a
then
f32a3a
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
f32a3a
    then
f32a3a
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
f32a3a
    fi
f32a3a
732eee
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
732eee
    then
732eee
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
732eee
        then
732eee
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
732eee
            then
732eee
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
732eee
            else
732eee
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
732eee
            fi
732eee
        fi
732eee
    fi
732eee
f32a3a
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
fi
f32a3a
f32a3a
f32a3a
%posttrans
f32a3a
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
f32a3a
then
f32a3a
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
f32a3a
    then
f32a3a
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
f32a3a
    fi
f32a3a
732eee
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
732eee
    then
732eee
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
732eee
        then
732eee
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
732eee
            then
732eee
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
732eee
            else
732eee
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
732eee
            fi
732eee
        fi
732eee
    fi
732eee
f32a3a
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f32a3a
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f32a3a
fi
7c8af8
7c8af8
7c8af8
%files
7c8af8
%defattr(644,root,root,755)
7c8af8
/lib/modules/%{kernel_version}.%{_arch}
7c8af8
%license COPYING
7c8af8
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
7c8af8
7c8af8
7c8af8
%changelog
260abf
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-3
260abf
- Rebuild for 4.18.0-331.el8
260abf
ac2a07
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-2
220fd3
- Rebuild for 4.18.0-326.el8
ac2a07
- Fix provides/requires
ac2a07
- Fix kernel dependencies
ac2a07
- Add convenient provides kmod-aacraid-`uname -r`
ac2a07
- Fix installonlypkg detection
ac2a07
- Recreate source tarballs
ac2a07
- Rebuild for dist = .el8s
220fd3
7c8af8
* Wed Jul 21 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.0-1
7c8af8
- Initial version