aa6ea2
%define kpatch_dnf_ver	0.4
aa6ea2
aa6ea2
Name:		kpatch
aa6ea2
Version:	0.9.4
d7ea71
Release:	3%{?dist}
aa6ea2
Summary:	Dynamic kernel patch manager
aa6ea2
aa6ea2
Group:		System Environment/Kernel
aa6ea2
License:	GPLv2
aa6ea2
URL:		https://github.com/dynup/kpatch
aa6ea2
Source0:	https://github.com/dynup/kpatch/archive/v%{version}.tar.gz
aa6ea2
Source1:	kpatch-dnf-v%{kpatch_dnf_ver}.tar.gz
aa6ea2
aa6ea2
# RHEL-only
aa6ea2
Patch0:		0001-contrib-disable-upstart-kpatch.conf-install.patch
aa6ea2
Patch1:		0002-kpatch-clarify-unload-unsupport.patch
d7ea71
Patch2:		0003-do-not-rm-selinux-rpm-owned-directory.patch
aa6ea2
aa6ea2
# Upstream backports (inactive -- for future reference)
aa6ea2
#Patch100:	0100-xxx.patch
aa6ea2
aa6ea2
# kpatch-dnf backports (inactive -- for future reference)
aa6ea2
#Patch200:	0200-foo-bar-etcetera.patch
aa6ea2
aa6ea2
Requires:	bash kmod binutils
aa6ea2
Recommends:	kpatch-dnf
aa6ea2
aa6ea2
BuildArch:	noarch
aa6ea2
aa6ea2
aa6ea2
%description
aa6ea2
kpatch is a live kernel patch module manager.  It allows the user to manage
aa6ea2
a collection of binary kernel patch modules which can be used to dynamically
aa6ea2
patch the kernel without rebooting.
aa6ea2
aa6ea2
aa6ea2
%package -n kpatch-dnf
aa6ea2
Summary:	kpatch-patch manager plugin for DNF
aa6ea2
Version:	%kpatch_dnf_ver
aa6ea2
BuildRequires:	python3-devel python3-dnf
aa6ea2
Requires:	python3-dnf python3-hawkey
aa6ea2
Provides:	kpatch-dnf
aa6ea2
aa6ea2
%description -n kpatch-dnf
aa6ea2
kpatch-dnf is a DNF plugin that manages subscription to kpatch-patch updates.
aa6ea2
When enabled, kernel packages are automatically subscribed to corresponding
aa6ea2
kpatch-patch packages updates.
aa6ea2
aa6ea2
%prep
aa6ea2
%setup -q
aa6ea2
%patch0 -p1
aa6ea2
%patch1 -p1
d7ea71
%patch2 -p1
aa6ea2
# Use this to apply upstream patches to kpatch
aa6ea2
#%patch100 -p1
aa6ea2
aa6ea2
%setup -D -T -a 1
aa6ea2
aa6ea2
# Use this to apply patches to kpatch-dnf (inactive)
aa6ea2
#cd kpatch-dnf-%{kpatch_dnf_ver}
aa6ea2
#%patch200 -p1
aa6ea2
#cd ..
aa6ea2
aa6ea2
%build
aa6ea2
make -C man
aa6ea2
aa6ea2
make -C kpatch-dnf-%{kpatch_dnf_ver}
aa6ea2
aa6ea2
%install
aa6ea2
make install PREFIX=/usr DESTDIR=%{buildroot} -C kpatch
aa6ea2
make install PREFIX=/usr DESTDIR=%{buildroot} -C man
aa6ea2
make install PREFIX=/usr DESTDIR=%{buildroot} -C contrib
aa6ea2
mkdir -p %{buildroot}/%{_sharedstatedir}/kpatch
aa6ea2
rm -f %{buildroot}/usr/share/man/man1/kpatch-build.1.gz
aa6ea2
aa6ea2
make install PREFIX=/usr DESTDIR=%{buildroot} PYTHONSITES=%{python3_sitelib} -C kpatch-dnf-%{kpatch_dnf_ver}
aa6ea2
aa6ea2
%files
aa6ea2
%{_sbindir}/kpatch
aa6ea2
%{_usr}/lib/systemd/system/kpatch.service
aa6ea2
%{_sharedstatedir}/kpatch
aa6ea2
%doc %{_mandir}/man1/kpatch.1.gz
aa6ea2
aa6ea2
%files -n kpatch-dnf
aa6ea2
%{python3_sitelib}/dnf-plugins/kpatch.py
aa6ea2
%{python3_sitelib}/dnf-plugins/__pycache__
aa6ea2
%config(noreplace) %{_sysconfdir}/dnf/plugins/kpatch.conf
aa6ea2
%doc %{_mandir}/man8/dnf.kpatch.8.gz
aa6ea2
aa6ea2
%post -n kpatch-dnf
aa6ea2
echo "To enable automatic kpatch-patch subscription, run:"
aa6ea2
echo -e "\t$ dnf kpatch auto"
aa6ea2
aa6ea2
%changelog
d7ea71
* Fri Jun 10 2022 Yannick Cote <ycote@redhat.com> 0.9.4-3
d7ea71
- Do not rm selinux rpm owned directory (rhbz#2053413)
d7ea71
aa6ea2
* Thu Jan 27 2022 Yannick Cote <ycote@redhat.com> 0.9.4-2
aa6ea2
- Add /usr/lib/kpatch to install and files list to appease SELinux (rhbz#2030004)
aa6ea2
aa6ea2
* Wed Sep 29 2021 Artem Savkov <asavkov@redhat.com> - 0.9.4-1
aa6ea2
- Rebase to 0.9.4
aa6ea2
aa6ea2
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.3-3
aa6ea2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
aa6ea2
  Related: rhbz#1991688
aa6ea2
aa6ea2
* Thu Jun 10 2021 Joe Lawrence <joe.lawrence@redhat.com> - 0.9.3-2
aa6ea2
- Rebase to latest upstream (via backport patch)
aa6ea2
aa6ea2
* Tue May 18 2021 Joel Savitz <jsavitz@redhat.com> - 0.9.3-1
aa6ea2
- Rebase to latest upstream
aa6ea2
aa6ea2
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.2-5
aa6ea2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
aa6ea2
aa6ea2
* Fri Mar 05 2021 Joe Lawrence <joe.lawrence@redhat.com> 0.9.2-4
aa6ea2
- Fix kpatch-dnf package description typos (rhbz#1934292)
aa6ea2
aa6ea2
* Mon Jan 04 2021 Julien Thierry <jthierry@redhat.com> 0.9.2-2
aa6ea2
- Remove kpatch-dnf dependency on python3 (rhbz#1912457)
aa6ea2
aa6ea2
* Wed Dec 2 2020 Joe Lawrence <joe.lawrence@redhat.com> 0.9.2-1
aa6ea2
- initial kpatch utility build for rhel-9.0.0 (rhbz#1901593)