Blame SPECS/kmod-ecryptfs.spec

e54940
%global pkg ecryptfs
e54940
e54940
%global kernel_version 5.14.0-31.el9
e54940
e54940
%global debug_package %{nil}
e54940
e54940
%global __spec_install_post \
e54940
  %{?__debug_package:%{__debug_install_post}} \
e54940
  %{__arch_install_post} \
e54940
  %{__os_install_post} \
e54940
  %{__mod_compress_install_post}
e54940
e54940
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
e54940
e54940
e54940
Name:             kmod-%{pkg}
e54940
Version:          5.14
e54940
Release:          1%{?dist}
e54940
Summary:          Encrypted filesystem that operates on the VFS layer
e54940
e54940
License:          GPLv2
e54940
URL:              https://www.kernel.org/
e54940
e54940
Source0:          %{pkg}-%{version}.tar.xz
e54940
e54940
ExclusiveArch:    x86_64 aarch64
e54940
e54940
BuildRequires:    elfutils-libelf-devel
e54940
BuildRequires:    gcc
e54940
BuildRequires:    kernel-rpm-macros
e54940
BuildRequires:    kmod
e54940
BuildRequires:    make
e54940
BuildRequires:    redhat-rpm-config
e54940
BuildRequires:    xz
e54940
e54940
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
e54940
BuildRequires:    kernel-devel = %{kernel_version}
e54940
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
e54940
e54940
Requires:         kernel >= %{kernel_version}
e54940
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
e54940
Requires:         kernel-modules >= %{kernel_version}
e54940
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
e54940
e54940
Provides:         installonlypkg(kernel-module)
e54940
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
e54940
e54940
Requires(post):   %{_sbindir}/depmod
e54940
Requires(postun): %{_sbindir}/depmod
e54940
e54940
Requires(post):   %{_sbindir}/weak-modules
e54940
Requires(postun): %{_sbindir}/weak-modules
e54940
e54940
Supplements:      ecryptfs-utils
e54940
Recommends:       ecryptfs-utils
e54940
e54940
e54940
%description
e54940
This package provides the required kernel module (ecryptfs) to mount devices
e54940
formatted with the Encrypted filesystem that operates on the VFS layer.
e54940
e54940
e54940
%prep
e54940
%autosetup -p1 -n %{pkg}-%{version}
e54940
e54940
e54940
%build
e54940
pushd src
e54940
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
e54940
popd
e54940
e54940
e54940
%install
e54940
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/fs src/%{pkg}.ko
e54940
e54940
# Make .ko objects temporarily executable for automatic stripping
e54940
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
e54940
e54940
e54940
%clean
e54940
%{__rm} -rf %{buildroot}
e54940
e54940
e54940
%post
e54940
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
e54940
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/fs/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
e54940
e54940
e54940
%preun
e54940
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
e54940
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
e54940
e54940
e54940
%postun
e54940
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
e54940
then
e54940
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
e54940
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
e54940
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
e54940
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
e54940
fi
e54940
e54940
e54940
%pretrans -p <lua>
e54940
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
e54940
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
e54940
e54940
e54940
%posttrans
e54940
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
e54940
then
e54940
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
e54940
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
e54940
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
e54940
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
e54940
fi
e54940
e54940
e54940
%files
e54940
%defattr(644,root,root,755)
e54940
/lib/modules/%{kernel_version}.%{_arch}
e54940
%license COPYING
e54940
e54940
e54940
%changelog
0b8c56
* Thu Jan 06 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14-1
e54940
- Initial kABI tracking kmod package (kernel >= 5.14.0-31.el8)