代码拉取完成,页面将自动刷新
%define build_version %{version}-%{release}
############################################
############ Package syscare ###############
############################################
Name: syscare
Version: 1.2.2
Release: 2
Summary: System hot-fix service
License: MulanPSL-2.0 and GPL-2.0-only
URL: https://gitee.com/openeuler/syscare
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake >= 3.14 make
BuildRequires: rust >= 1.51 cargo >= 1.51
BuildRequires: gcc gcc-c++
Requires: coreutils systemd
Requires: kpatch-runtime
Excludearch: loongarch64
Patch0001: 0001-fix-kernel-patch-ACCEPTED-change-to-DEACTIVED-after-.patch
Patch0002: 0002-fix-some-clean-code-problem.patch
Patch0003: 0003-upatch-helper-fix-object-upatch-id-duplicated-issue.patch
############### Description ################
%description
SysCare is a system-level hot-fix service that provides security patches and system error hot-fixes for the operating system.
The host can fix the system problem without rebooting.
############## BuildPreparare ##############
%prep
%autosetup -p1
################## Build ###################
%build
mkdir -p build
cd build
cmake \
-DENABLE_ASAN=0 \
-DENABLE_GCOV=0 \
-DBUILD_VERSION=%{build_version} \
-DCMAKE_INSTALL_PREFIX=/usr \
..
make
################# Install ##################
%install
cd build
%make_install
############### PostInstall ################
%post
mkdir -p /usr/lib/syscare/patches
systemctl daemon-reload
systemctl enable syscare
systemctl start syscare
############### PreUninstall ###############
%preun
if [ "$1" -eq 0 ]; then
systemctl daemon-reload
systemctl stop syscare
systemctl disable syscare
fi
############## PostUninstall ###############
%postun
if [ "$1" -eq 0 ] || { [ -n "$2" ] && [ "$2" -eq 0 ]; }; then
# Remove patch directory
rm -rf /usr/lib/syscare
# Remove log directory
rm -f /var/log/syscare/syscared_r*.log
rm -f /var/log/syscare/syscared_r*.log.gz
if [ -z "$(ls -A /var/log/syscare)" ]; then
rm -rf /var/log/syscare
fi
# Remove run directory
rm -f /var/run/syscare/patch_op.lock
rm -f /var/run/syscare/syscared.*
if [ -z "$(ls -A /var/run/syscare)" ]; then
rm -rf /var/run/syscare
fi
fi
################## Files ###################
%files
%defattr(-,root,root,0555)
%dir /usr/libexec/syscare
%attr(0555,root,root) /usr/bin/syscare
%attr(0550,root,root) /usr/bin/syscared
%attr(0550,root,root) /usr/libexec/syscare/upatch-manage
%attr(0550,root,root) /usr/lib/systemd/system/syscare.service
############################################
########## Package syscare-build ###########
############################################
%package build
Summary: Syscare build tools.
BuildRequires: elfutils-libelf-devel
Requires: coreutils
Requires: patch
Requires: kpatch
Requires: tar gzip
Requires: rpm rpm-build
############### Description ################
%description build
Syscare patch building toolset.
################## Files ###################
%files build
%defattr(-,root,root,0555)
%dir /usr/libexec/syscare
%attr(555,root,root) /usr/libexec/syscare/syscare-build
%attr(555,root,root) /usr/libexec/syscare/upatch-build
%attr(555,root,root) /usr/libexec/syscare/upatch-diff
%attr(555,root,root) /usr/libexec/syscare/upatch-helper
%attr(555,root,root) /usr/libexec/syscare/upatch-cc
%attr(555,root,root) /usr/libexec/syscare/upatch-c++
############################################
################ Change log ################
############################################
%changelog
* Wed Sep 18 2024 renoseven<dev@renoseven.net> - 1.2.2-2
- syscared: fix kernel patch apply failure issue
- upatch-helper: fix object upatch id duplicated issue
* Fri Aug 16 2024 renoseven<dev@renoseven.net> - 1.2.2-1
- Release version 1.2.2-1.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。