Blame SPECS/kmod-iwlegacy.spec

2bda55
%global pkg iwlegacy
2bda55
24634c
%global kernel_version 4.18.0-338.el8
2bda55
2bda55
%global _use_internal_dependency_generator 0
2bda55
%global __find_requires %{nil}
2bda55
%global __find_provides /usr/lib/rpm/find-provides
2bda55
2bda55
%global debug_package %{nil}
2bda55
2bda55
%global __spec_install_post \
2bda55
  %{?__debug_package:%{__debug_install_post}} \
2bda55
  %{__arch_install_post} \
2bda55
  %{__os_install_post} \
2bda55
  %{__mod_compress_install_post}
2bda55
2bda55
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
2bda55
2bda55
2bda55
Name:             kmod-%{pkg}
2bda55
Version:          5.12
24634c
Release:          5%{?dist}
2bda55
Summary:          Intel WiFi 3945ABG/BG (iwl3945) and 4965AGN (iwl4965) driver
2bda55
2bda55
License:          GPLv2
2bda55
URL:              https://www.kernel.org/
2bda55
2bda55
Source0:          %{pkg}-%{version}.tar.xz
2bda55
2bda55
ExclusiveArch:    x86_64
2bda55
2bda55
BuildRequires:    elfutils-libelf-devel
2bda55
BuildRequires:    gcc
2bda55
BuildRequires:    kmod
2bda55
BuildRequires:    make
2bda55
BuildRequires:    redhat-rpm-config
2bda55
BuildRequires:    xz
2bda55
2bda55
BuildRequires:    kernel-devel = %{kernel_version}
2bda55
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
2bda55
2bda55
Requires:         kernel-core = %{kernel_version}
2bda55
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
2bda55
Requires:         kernel-modules = %{kernel_version}
2bda55
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
2bda55
2bda55
Provides:         installonlypkg(kernel-module)
ef9940
Provides:         kernel-modules = %{kernel_version}.%{_arch}
2bda55
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
2bda55
Requires(post):   /usr/sbin/depmod
2bda55
Requires(postun): /usr/sbin/depmod
2bda55
2bda55
Requires(post):   /usr/bin/dracut
2bda55
Requires(postun): /usr/bin/dracut
2bda55
2bda55
Provides:         kmod-iwl3945 = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
Provides:         kmod-iwl3945-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
2bda55
Supplements:      iwl3945-firmware
2bda55
Recommends:       iwl3945-firmware
2bda55
2bda55
Provides:         kmod-iwl4965 = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
Provides:         kmod-iwl4965-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
2bda55
Supplements:      iwl4965-firmware
2bda55
Recommends:       iwl4965-firmware
2bda55
2bda55
%description
2bda55
This package provides drivers for Intel's WiFi adapter 3945ABG/BG (iwl3945) and
2bda55
4965AGN (iwl4965) including the required Intel WiFi legacy driver (iwlegacy).
2bda55
2bda55
2bda55
%prep
2bda55
%autosetup -p1 -n %{pkg}-%{version}
2bda55
2bda55
2bda55
%build
2bda55
pushd src
2bda55
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
2bda55
popd
2bda55
2bda55
2bda55
%install
2bda55
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg} src/%{pkg}.ko src/iwl3945.ko src/iwl4965.ko
2bda55
2bda55
# Make .ko objects temporarily executable for automatic stripping
2bda55
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
2bda55
2bda55
2bda55
%clean
2bda55
%{__rm} -rf %{buildroot}
2bda55
2bda55
2bda55
%post
2bda55
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
2bda55
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2bda55
2bda55
2bda55
%preun
2bda55
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
2bda55
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2bda55
2bda55
2bda55
%postun
2bda55
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
2bda55
then
2bda55
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
2bda55
    then
2bda55
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
2bda55
    fi
2bda55
2bda55
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
2bda55
    then
2bda55
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
2bda55
        then
2bda55
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2bda55
            then
2bda55
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
2bda55
            else
2bda55
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2bda55
            fi
2bda55
        fi
2bda55
    fi
2bda55
2bda55
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2bda55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
2bda55
fi
2bda55
2bda55
2bda55
%posttrans
2bda55
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
2bda55
then
2bda55
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
2bda55
    then
2bda55
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
2bda55
    fi
2bda55
2bda55
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
2bda55
    then
2bda55
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
2bda55
        then
2bda55
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2bda55
            then
2bda55
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
2bda55
            else
2bda55
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
2bda55
            fi
2bda55
        fi
2bda55
    fi
2bda55
2bda55
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
2bda55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
2bda55
fi
2bda55
2bda55
2bda55
%files
2bda55
%defattr(644,root,root,755)
2bda55
/lib/modules/%{kernel_version}.%{_arch}
2bda55
%license COPYING
2bda55
2bda55
2bda55
%changelog
24634c
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-5
24634c
- Set specific kernel version to use
24634c
- Add Provides kernel-modules
24634c
- Add .%{_arch} to kernel-modules provides version
24634c
- Rebuild for 4.18.0-338.el8
24634c
3d2625
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-4
3d2625
- Rebuild for 4.18.0-331.el8
3d2625
d4b99e
* Tue Aug 17 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-3
d4b99e
- Remove dracut conf file
d4b99e
a96122
* Tue Aug 17 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-2
a96122
- Rebuild for 4.18.0-326.el8
a96122
2bda55
* Thu Aug 12 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-1
2bda55
- Initial version