Blame SPECS/kmod-xt_time.spec

ba0f8e
%global pkg xt_time
ba0f8e
Kmods SIG 8d16be
%global driver_version 4.18.0-211.el8
Kmods SIG 8d16be
Kmods SIG 8d16be
%global kernel_version 4.18.0-348.el8
ba0f8e
ba0f8e
%global _use_internal_dependency_generator 0
45c810
%global __find_requires /usr/lib/rpm/redhat/find-requires
45c810
%global __find_provides /usr/lib/rpm/redhat/find-provides
ba0f8e
ba0f8e
%global debug_package %{nil}
ba0f8e
ba0f8e
%global __spec_install_post \
ba0f8e
  %{?__debug_package:%{__debug_install_post}} \
ba0f8e
  %{__arch_install_post} \
ba0f8e
  %{__os_install_post} \
ba0f8e
  %{__mod_compress_install_post}
ba0f8e
ba0f8e
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
ba0f8e
ba0f8e
ba0f8e
Name:             kmod-%{pkg}
Kmods SIG 8d16be
Version:          4.18.0.211
1404fa
Release:          3%{?dist}
ba0f8e
Summary:          Time match support for Netfilter (xt_time)
ba0f8e
ba0f8e
License:          GPLv2
ba0f8e
URL:              https://www.kernel.org/
ba0f8e
Kmods SIG 8d16be
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG 8d16be
Patch1:           0001-netfilter-xt_time-use-time64_t.patch
ba0f8e
eb0f01
ExclusiveArch:    x86_64 aarch64 ppc64le
ba0f8e
ba0f8e
BuildRequires:    elfutils-libelf-devel
ba0f8e
BuildRequires:    gcc
45c810
BuildRequires:    kernel-rpm-macros
ba0f8e
BuildRequires:    kmod
ba0f8e
BuildRequires:    make
ba0f8e
BuildRequires:    redhat-rpm-config
ba0f8e
BuildRequires:    xz
ba0f8e
45c810
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
ba0f8e
BuildRequires:    kernel-devel = %{kernel_version}
ba0f8e
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
ba0f8e
45c810
Requires:         kernel >= %{kernel_version}
45c810
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
45c810
Requires:         kernel-modules >= %{kernel_version}
45c810
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
ba0f8e
ba0f8e
Provides:         installonlypkg(kernel-module)
45c810
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
ba0f8e
45c810
Requires(post):   %{_sbindir}/depmod
45c810
Requires(postun): %{_sbindir}/depmod
ba0f8e
45c810
Requires(post):   %{_sbindir}/weak-modules
45c810
Requires(postun): %{_sbindir}/weak-modules
ba0f8e
ba0f8e
1404fa
%if "%{version}" == "4.18.0.221" && "%{release}" == "2%{?dist}"
1404fa
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
1404fa
%endif
1404fa
1404fa
%if "%{version}" == "4.18.0.221" && "%{release}" == "3%{?dist}"
1404fa
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-1%{?dist}
1404fa
Obsoletes:        kmod-%{pkg} = %{?epoch:%{epoch}:}%{version}-2%{?dist}
1404fa
%endif
1404fa
1404fa
ba0f8e
%description
ba0f8e
This package provides the "time" match module for the Network packet filtering
ba0f8e
framework (Netfilter). It allows you to match based on the packet arrival or
ba0f8e
departure time.
ba0f8e
ba0f8e
ba0f8e
%prep
Kmods SIG 8d16be
%autosetup -p1 -n %{pkg}-%{driver_version}
ba0f8e
ba0f8e
ba0f8e
%build
ba0f8e
pushd src
ba0f8e
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
ba0f8e
popd
ba0f8e
ba0f8e
ba0f8e
%install
ba0f8e
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/net/netfilter src/%{pkg}.ko
ba0f8e
ba0f8e
# Make .ko objects temporarily executable for automatic stripping
ba0f8e
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
ba0f8e
ba0f8e
ba0f8e
%clean
ba0f8e
%{__rm} -rf %{buildroot}
ba0f8e
ba0f8e
ba0f8e
%post
ba0f8e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
45c810
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/net/netfilter/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ba0f8e
ba0f8e
ba0f8e
%preun
ba0f8e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
45c810
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
ba0f8e
ba0f8e
ba0f8e
%postun
45c810
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
ba0f8e
then
45c810
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
45c810
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
ba0f8e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
45c810
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
ba0f8e
fi
ba0f8e
ba0f8e
45c810
%pretrans -p <lua>
45c810
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
45c810
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
45c810
45c810
ba0f8e
%posttrans
45c810
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
ba0f8e
then
45c810
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
45c810
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ba0f8e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
45c810
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
ba0f8e
fi
ba0f8e
ba0f8e
ba0f8e
%files
ba0f8e
%defattr(644,root,root,755)
ba0f8e
/lib/modules/%{kernel_version}.%{_arch}
bc597c
%license LICENSES
ba0f8e
ba0f8e
ba0f8e
%changelog
1404fa
* Thu Jan 27 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.211-3
1404fa
- Add obsoletes for update path
1404fa
eb0f01
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.211-2
eb0f01
- Enable ppc64le
eb0f01
Kmods SIG 8d16be
* Wed Jan 12 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.211-1
Kmods SIG 8d16be
- Switch to EL kernel source and versioning
Kmods SIG 8d16be
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)