diff --git a/livepatch-mgr-v0.1.3.tar.gz b/livepatch-mgr-v0.1.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ee1a73beabc05588b61a67ee4f78bc6b9bdd190b Binary files /dev/null and b/livepatch-mgr-v0.1.3.tar.gz differ diff --git a/livepatch-mgr.spec b/livepatch-mgr.spec new file mode 100644 index 0000000000000000000000000000000000000000..35d33b9743dcfb09c0dd5d508ac5da823c9abd71 --- /dev/null +++ b/livepatch-mgr.spec @@ -0,0 +1,60 @@ +%define anolis_release 1 + +Name: livepatch-mgr +Version: 0.1.3 +Release: %{anolis_release}%{?dist} +Summary: Kernel live patch manager for Anolis +License: GPLv2 +Url: https://gitee.com/anolis/livepatch-mgr +Source0: https://gitee.com/anolis/livepatch-mgr/archive/refs/tags/%{name}-v%{version}.tar.gz + +BuildRequires: python3-devel /usr/bin/pathfix.py +Requires: bash kmod binutils kpatch +BuildArch: noarch + +%description +livepatch manager tool allows the user to manage +a collection of binary kernel patch modules which can be used to dynamically +patch the kernel without rebooting. + +%prep +%autosetup -n %{name}-v%{version} -p1 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" . + +%build +make -C man + +%install +mkdir -p %{buildroot}/usr/bin/ +mkdir -p %{buildroot}/etc/livepatch-mgr/ +make install PREFIX=/usr DESTDIR=%{buildroot} -C man +install -m 0755 src/config.ini %{buildroot}/etc/livepatch-mgr/config.ini +install -m 0755 src/livepatch-mgr.py %{buildroot}/etc/livepatch-mgr/livepatch-mgr +install -m 0755 src/livepatch_reminder.sh %{buildroot}/etc/livepatch-mgr/livepatch_reminder.sh + +%post +ln -s /etc/livepatch-mgr/livepatch-mgr /usr/bin/livepatch-mgr +echo "****Install finished, try \"livepatch-mgr remind --enable\" to enable reminder!" + +%preun +set +e +if [ $1 -eq 0 ]; then +rm -rf /etc/profile.d/livepatch_reminder.sh +rm -rf /etc/livepatch-mgr/hotfix_cache.db +rm -rf /usr/bin/livepatch-mgr +fi + +%files +%license license.txt +%doc README.md +%{_sysconfdir}/livepatch-mgr/livepatch-mgr +%{_sysconfdir}/livepatch-mgr/config.ini +%{_sysconfdir}/livepatch-mgr/livepatch_reminder.sh +%{_mandir}/man1/livepatch-mgr.1.zst + +%changelog +* Fri Sep 15 2023 zhangyongde - 0.1.3-1 +- Bump to Version 0.1.3 + +* Thu Jun 8 2023 zhangyongde - 0.1.2-1 +- init package