Blame SPECS/kmod-xt_time.spec

c9360b
%global pkg xt_time
c9360b
5badae
%global kernel_version 4.18.0-305.19.1.el8_4
c9360b
c9360b
%global _use_internal_dependency_generator 0
c9360b
%global __find_requires %{nil}
c9360b
%global __find_provides /usr/lib/rpm/find-provides
c9360b
c9360b
%global debug_package %{nil}
c9360b
c9360b
%global __spec_install_post \
c9360b
  %{?__debug_package:%{__debug_install_post}} \
c9360b
  %{__arch_install_post} \
c9360b
  %{__os_install_post} \
c9360b
  %{__mod_compress_install_post}
c9360b
c9360b
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
c9360b
c9360b
c9360b
Name:             kmod-%{pkg}
c9360b
Version:          5.9
5badae
Release:          4%{?dist}
c9360b
Summary:          Time match support for Netfilter (xt_time)
c9360b
c9360b
License:          GPLv2
c9360b
URL:              https://www.kernel.org/
c9360b
c9360b
Source0:          %{pkg}-%{version}.tar.xz
c9360b
c9360b
ExclusiveArch:    x86_64 aarch64
c9360b
c9360b
BuildRequires:    elfutils-libelf-devel
c9360b
BuildRequires:    gcc
c9360b
BuildRequires:    kmod
c9360b
BuildRequires:    make
c9360b
BuildRequires:    redhat-rpm-config
c9360b
BuildRequires:    xz
c9360b
c9360b
BuildRequires:    kernel-devel = %{kernel_version}
c9360b
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
c9360b
c9360b
Requires:         kernel-core = %{kernel_version}
c9360b
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
c9360b
Requires:         kernel-modules = %{kernel_version}
c9360b
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
c9360b
c9360b
Provides:         installonlypkg(kernel-module)
f65728
Provides:         kernel-modules = %{kernel_version}.%{_arch}
c9360b
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
c9360b
c9360b
Requires(post):   /usr/sbin/depmod
c9360b
Requires(postun): /usr/sbin/depmod
c9360b
c9360b
Requires(post):   /usr/bin/dracut
c9360b
Requires(postun): /usr/bin/dracut
c9360b
c9360b
c9360b
%description
c9360b
This package provides the "time" match module for the Network packet filtering
c9360b
framework (Netfilter). It allows you to match based on the packet arrival or
c9360b
departure time.
c9360b
c9360b
c9360b
%prep
c9360b
%autosetup -p1 -n %{pkg}-%{version}
c9360b
c9360b
c9360b
%build
c9360b
pushd src
c9360b
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
c9360b
popd
c9360b
c9360b
c9360b
%install
c9360b
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/net/netfilter src/%{pkg}.ko
c9360b
c9360b
# Make .ko objects temporarily executable for automatic stripping
c9360b
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
c9360b
c9360b
c9360b
%clean
c9360b
%{__rm} -rf %{buildroot}
c9360b
c9360b
c9360b
%post
c9360b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
c9360b
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c9360b
c9360b
c9360b
%preun
c9360b
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
c9360b
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c9360b
c9360b
c9360b
%postun
c9360b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
c9360b
then
c9360b
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
c9360b
    then
c9360b
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
c9360b
    fi
c9360b
c9360b
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
c9360b
    then
c9360b
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
c9360b
        then
c9360b
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c9360b
            then
c9360b
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
c9360b
            else
c9360b
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c9360b
            fi
c9360b
        fi
c9360b
    fi
c9360b
c9360b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c9360b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
c9360b
fi
c9360b
c9360b
c9360b
%posttrans
c9360b
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
c9360b
then
c9360b
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
c9360b
    then
c9360b
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
c9360b
    fi
c9360b
c9360b
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
c9360b
    then
c9360b
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
c9360b
        then
c9360b
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c9360b
            then
c9360b
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
c9360b
            else
c9360b
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
c9360b
            fi
c9360b
        fi
c9360b
    fi
c9360b
c9360b
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
c9360b
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
c9360b
fi
c9360b
c9360b
c9360b
%files
c9360b
%defattr(644,root,root,755)
c9360b
/lib/modules/%{kernel_version}.%{_arch}
c9360b
%license COPYING
c9360b
c9360b
c9360b
%changelog
5badae
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.9-4
5badae
- Rebuild for 4.18.0-305.19.1.el8_4
5badae
f23190
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.9-3
f23190
- Set specific kernel version to use
f23190
- Add Provides kernel-modules
f23190
- Add .%{_arch} to kernel-modules provides version
f23190
- Rebuild for 4.18.0-305.17.1.el8_4
f23190
a259d2
* Tue Aug 17 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.9-2
a259d2
- Rebuild for 4.18.0-305.12.1.el8_4
a259d2
c9360b
* Fri Aug 13 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.9-1
c9360b
- Initial version