Artem Savkov 3acf83
%define kpatch_dnf_ver	0.4
2df7e3
2df7e3
Name:		kpatch
57275d
Version:	0.9.4
Yannick Cote 1fb0ce
Release:	3%{?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
2df7e3
# Upstream backports (inactive -- for future reference)
Artem Savkov 3acf83
#Patch100:	0100-xxx.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
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
d8e287
Summary:	patch-patch manager plugin for DNF
2df7e3
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
2df7e3
%patch0 -p1
2df7e3
%patch1 -p1
Yannick Cote 1fb0ce
%patch2 -p1
2df7e3
# Use this to apply upstream patches to kpatch
57275d
#%patch100 -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
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)