Artem Savkov 3acf83
%define kpatch_dnf_ver	0.4
2df7e3
2df7e3
Name:		kpatch
54dc0a
Version:	0.9.8
4af34d
Release:	1.4%{?dist}
2df7e3
Summary:	Dynamic kernel patch manager
2df7e3
2df7e3
Group:		System Environment/Kernel
2df7e3
License:	GPLv2
2df7e3
URL:		https://github.com/dynup/kpatch
2df7e3
Source0:	https://github.com/dynup/kpatch/archive/v%{version}.tar.gz
2df7e3
Source1:	kpatch-dnf-v%{kpatch_dnf_ver}.tar.gz
2df7e3
2df7e3
# RHEL-only
2df7e3
Patch0:		0001-contrib-disable-upstart-kpatch.conf-install.patch
2df7e3
Patch1:		0002-kpatch-clarify-unload-unsupport.patch
Yannick Cote 1fb0ce
Patch2:		0003-do-not-rm-selinux-rpm-owned-directory.patch
2df7e3
642cd7
# Upstream backports
54dc0a
Patch100:       0100-support-ubsan-for-kpatch.patch
54dc0a
Patch101:       0101-create-diff-object-handle-__initcall_stub-with-CONFI.patch
54dc0a
Patch102:       0102-kpatch-build-support-CONFIG_LTO_CLANG_THIN.patch
54dc0a
Patch103:       0103-create-diff-object-compare-section-name-with-kpatch_.patch
54dc0a
Patch104:       0104-kpatch-build-add-support-for-clang-pgo.patch
54dc0a
Patch105:       0105-create-diff-object-ignore-section-.rel.llvm.call-gra.patch
54dc0a
Patch106:       0106-kpatch-build-Run-objtool-on-thinlto-files.patch
54dc0a
Patch107:       0107-kpatch-build-skip-more-symbols-in-locals_match.patch
ec3a16
Patch108:       0108-kpatch-build-Fix-setlocalversion-issue-with-6.3-kern.patch
ec3a16
Patch109:       0109-kpatch-build-ignore-changes-in-.comment-section.patch
ec3a16
Patch110:       0110-kpatch-build-handle-init-version-timestamp.o.patch
f6c393
Patch111:       0111-kpatch-build-Ignore-missing-PARA_STRUCT_SIZE-for-6.8.patch
f6c393
Patch112:       0112-kpatch-build-Always-do-LLVM-1-with-CONFIG_CC_IS_CLAN.patch
2df7e3
2df7e3
# kpatch-dnf backports (inactive -- for future reference)
2df7e3
#Patch200:	0200-foo-bar-etcetera.patch
2df7e3
2df7e3
%description
2df7e3
kpatch is a live kernel patch module manager.  It allows the user to manage
2df7e3
a collection of binary kernel patch modules which can be used to dynamically
2df7e3
patch the kernel without rebooting.
2df7e3
d8e287
%package -n kpatch-build
d8e287
Summary:	Build tool for kpatch
d8e287
BuildRequires:	gcc kernel-devel elfutils elfutils-devel
d8e287
ExcludeArch:	aarch64
Joe Lawrence 083416
d8e287
%description -n kpatch-build
d8e287
kpatch-build is a tool to build patches for kpatch.
Joe Lawrence 083416
57275d
%package -n kpatch-runtime
57275d
Summary:	Dynamic kernel patch manager
4af34d
BuildRequires:	make
57275d
Requires:	bash kmod binutils
57275d
Suggests:	kpatch-dnf
57275d
Provides:	kpatch = %{version}-%{release}
57275d
Obsoletes:	kpatch < 0.9.4-1.6
57275d
BuildArch:	noarch
57275d
57275d
%description -n kpatch-runtime
57275d
kpatch is a live kernel patch module manager.  It allows the user to manage
57275d
a collection of binary kernel patch modules which can be used to dynamically
57275d
patch the kernel without rebooting.
2df7e3
2df7e3
%package -n kpatch-dnf
Joe Lawrence 083416
Summary:	kpatch-patch manager plugin for DNF
Yannick Cote 4e7bb1
Version:	%{version}_%{kpatch_dnf_ver}
2df7e3
BuildRequires:	python3-devel python3-dnf
2df7e3
Requires:	python3-dnf python3-hawkey
2df7e3
Provides:	kpatch-dnf
e08ee5
BuildArch:	noarch
2df7e3
2df7e3
%description -n kpatch-dnf
2df7e3
kpatch-dnf is a DNF plugin that manages subscription to kpatch-patch updates.
2df7e3
When enabled, kernel packages are automatically subscribed to corresponding
2df7e3
kpatch-patch packages updates.
2df7e3
2df7e3
%prep
2df7e3
%setup -q
Joe Lawrence c51891
%patch -P 0 -p1
Joe Lawrence c51891
%patch -P 1 -p1
Joe Lawrence c51891
%patch -P 2 -p1
2df7e3
# Use this to apply upstream patches to kpatch
4af34d
%patch -P 100 -p1
4af34d
%patch -P 101 -p1
4af34d
%patch -P 102 -p1
4af34d
%patch -P 103 -p1
4af34d
%patch -P 104 -p1
4af34d
%patch -P 105 -p1
4af34d
%patch -P 106 -p1
4af34d
%patch -P 107 -p1
4af34d
%patch -P 108 -p1
4af34d
%patch -P 109 -p1
4af34d
%patch -P 110 -p1
4af34d
%patch -P 111 -p1
4af34d
%patch -P 112 -p1
2df7e3
2df7e3
%setup -D -T -a 1
2df7e3
2df7e3
# Use this to apply patches to kpatch-dnf (inactive)
2df7e3
#cd kpatch-dnf-%{kpatch_dnf_ver}
2df7e3
#%patch200 -p1
2df7e3
#cd ..
2df7e3
2df7e3
%build
57275d
make
2df7e3
2df7e3
make -C kpatch-dnf-%{kpatch_dnf_ver}
2df7e3
2df7e3
%install
57275d
make install PREFIX=/usr DESTDIR=%{buildroot}
Yannick Cote de63de
mkdir -p %{buildroot}/%{_sharedstatedir}/kpatch
2df7e3
2df7e3
make install PREFIX=/usr DESTDIR=%{buildroot} PYTHONSITES=%{python3_sitelib} -C kpatch-dnf-%{kpatch_dnf_ver}
2df7e3
d8e287
%files -n kpatch-build
d8e287
%{_bindir}/kpatch-build
d8e287
%{_libexecdir}/%{name}
d8e287
%{_datadir}/%{name}
d8e287
%{_mandir}/man1/kpatch-build.1*
d8e287
57275d
%files -n kpatch-runtime
2df7e3
%{_sbindir}/kpatch
2df7e3
%{_usr}/lib/systemd/system/kpatch.service
Yannick Cote de63de
%{_sharedstatedir}/kpatch
2df7e3
%doc %{_mandir}/man1/kpatch.1.gz
2df7e3
2df7e3
%files -n kpatch-dnf
2df7e3
%{python3_sitelib}/dnf-plugins/kpatch.py
2df7e3
%{python3_sitelib}/dnf-plugins/__pycache__
2df7e3
%config(noreplace) %{_sysconfdir}/dnf/plugins/kpatch.conf
2df7e3
%doc %{_mandir}/man8/dnf.kpatch.8.gz
2df7e3
2df7e3
%post -n kpatch-dnf
2df7e3
echo "To enable automatic kpatch-patch subscription, run:"
2df7e3
echo -e "\t$ dnf kpatch auto"
2df7e3
2df7e3
%changelog
4af34d
* Wed Jun 12 2024 Davide Cavalca <dcavalca@centosproject.org> - 0.9.8-1.4
4af34d
- Merge upstream changes for c10s into Hyperscale
4af34d
f6c393
* Fri May 31 2024 Davide Cavalca <dcavalca@centosproject.org> - 0.9.8-1.3
f6c393
- Backport two more fixes and refresh patches
f6c393
Joe Lawrence d106c5
* Fri May 3 2024 Joe Lawrence <joe.lawrence@redhat.com> 0.9.7-3
Joe Lawrence d106c5
- Fix cs10 build error on missing `make` command
Joe Lawrence d106c5
- Fix "warning: %%patchN is deprecated"
Joe Lawrence d106c5
ec3a16
* Fri Oct 27 2023 Davide Cavalca <dcavalca@centosproject.org> - 0.9.8-1.2
ec3a16
- Backport three upstream fixes
ec3a16
54dc0a
* Wed Mar 15 2023 Davide Cavalca <dcavalca@centosproject.org> - 0.9.8-1.1
54dc0a
- Update to 0.9.8
54dc0a
- Refresh clang PGO patches
54dc0a
e6c0d9
* Wed Dec 07 2022 Davide Cavalca <dcavalca@centosproject.org> - 0.9.7-2.1
e6c0d9
- Merge upstream changes into Hyperscale
e6c0d9
Yannick Cote 4e7bb1
* Wed Nov 16 2022 Yannick Cote <ycote@redhat.com> 0.9.7-2
Yannick Cote 4e7bb1
- augment kpatch-dnf package versioning to satisfy build (rhbz#2121212)
Yannick Cote 4e7bb1
Yannick Cote 4387ac
* Wed Nov 09 2022 Yannick Cote <ycote@redhat.com> 0.9.7-1
Yannick Cote 4387ac
- rebase kpatch user utility code to v0.9.7 (rhbz#2121212)
Yannick Cote 4387ac
642cd7
* Tue Oct 25 2022 Davide Cavalca <dcavalca@centosproject.org> - 0.9.7-1.1
642cd7
- Update to 0.9.7
642cd7
- Backport patches for clang PGO
642cd7
Yannick Cote 1fb0ce
* Fri Jun 10 2022 Yannick Cote <ycote@redhat.com> 0.9.4-3
Yannick Cote 1fb0ce
- Do not rm selinux rpm owned directory (rhbz#2053413)
Yannick Cote 1fb0ce
Yannick Cote de63de
* Thu Jan 27 2022 Yannick Cote <ycote@redhat.com> 0.9.4-2
Yannick Cote de63de
- Add /usr/lib/kpatch to install and files list to appease SELinux (rhbz#2030004)
Yannick Cote de63de
Artem Savkov 3acf83
* Wed Sep 29 2021 Artem Savkov <asavkov@redhat.com> - 0.9.4-1
Artem Savkov 3acf83
- Rebase to 0.9.4
Artem Savkov 3acf83
57275d
* Fri Sep 03 2021 Davide Cavalca <dcavalca@centosproject.org> - 0.9.4-1.6
57275d
- Sync with c8s-sig-hyperscale
57275d
- Update to 0.9.4
57275d
- Add kpatch-build arched subpackage
57275d
- Add kpatch-runtime noarch subpackage to provide and obsolete kpatch
57275d
2df7e3
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.3-3
2df7e3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
2df7e3
  Related: rhbz#1991688
2df7e3
2df7e3
* Thu Jun 10 2021 Joe Lawrence <joe.lawrence@redhat.com> - 0.9.3-2
2df7e3
- Rebase to latest upstream (via backport patch)
2df7e3
2df7e3
* Tue May 18 2021 Joel Savitz <jsavitz@redhat.com> - 0.9.3-1
2df7e3
- Rebase to latest upstream
2df7e3
2df7e3
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.2-5
2df7e3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
2df7e3
2df7e3
* Fri Mar 05 2021 Joe Lawrence <joe.lawrence@redhat.com> 0.9.2-4
2df7e3
- Fix kpatch-dnf package description typos (rhbz#1934292)
2df7e3
2df7e3
* Mon Jan 04 2021 Julien Thierry <jthierry@redhat.com> 0.9.2-2
2df7e3
- Remove kpatch-dnf dependency on python3 (rhbz#1912457)
2df7e3
2df7e3
* Wed Dec 2 2020 Joe Lawrence <joe.lawrence@redhat.com> 0.9.2-1
2df7e3
- initial kpatch utility build for rhel-9.0.0 (rhbz#1901593)