Blame SPECS/kmod-iwlegacy.spec

2bda55
%global pkg iwlegacy
2bda55
e9e8fe
%global kernel_version 4.18.0-331.el8
2bda55
2bda55
%global _use_internal_dependency_generator 0
ce0a8f
%global __find_requires /usr/lib/rpm/redhat/find-requires
ce0a8f
%global __find_provides /usr/lib/rpm/redhat/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
e9e8fe
Release:          8%{?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
ce0a8f
BuildRequires:    kernel-rpm-macros
2bda55
BuildRequires:    kmod
2bda55
BuildRequires:    make
2bda55
BuildRequires:    redhat-rpm-config
2bda55
BuildRequires:    xz
2bda55
ce0a8f
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
2bda55
BuildRequires:    kernel-devel = %{kernel_version}
2bda55
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
2bda55
ce0a8f
Requires:         kernel >= %{kernel_version}
ce0a8f
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
ce0a8f
Requires:         kernel-modules >= %{kernel_version}
ce0a8f
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
2bda55
2bda55
Provides:         installonlypkg(kernel-module)
ce0a8f
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
2bda55
ce0a8f
Requires(post):   %{_sbindir}/depmod
ce0a8f
Requires(postun): %{_sbindir}/depmod
2bda55
ce0a8f
Requires(post):   %{_sbindir}/weak-modules
ce0a8f
Requires(postun): %{_sbindir}/weak-modules
2bda55
2bda55
Provides:         kmod-iwl3945 = %{?epoch:%{epoch}:}%{version}-%{release}
2bda55
2bda55
Supplements:      iwl3945-firmware
2bda55
Recommends:       iwl3945-firmware
2bda55
2bda55
Provides:         kmod-iwl4965 = %{?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
ce0a8f
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ce0a8f
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg}/iwl3945.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ce0a8f
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg}/iwl4965.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
2bda55
2bda55
2bda55
%preun
2bda55
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
ce0a8f
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
2bda55
2bda55
2bda55
%postun
ce0a8f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
2bda55
then
ce0a8f
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
ce0a8f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
2bda55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
ce0a8f
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
2bda55
fi
2bda55
2bda55
ce0a8f
%pretrans -p <lua>
ce0a8f
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
ce0a8f
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
ce0a8f
ce0a8f
2bda55
%posttrans
ce0a8f
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
2bda55
then
ce0a8f
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
ce0a8f
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
2bda55
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
ce0a8f
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
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
e9e8fe
* Wed Sep 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-8
e9e8fe
- Rebuild for 4.18.0-331.el8
e9e8fe
faf212
* Wed Sep 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-7
faf212
- Rebuild for 4.18.0-326.el8
faf212
ce0a8f
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.12-6
ce0a8f
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
ce0a8f
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