From 397d1d8f401a75c0447266f624e258e317817532 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 18 Sep 2025 08:14:53 +0000 Subject: automatic import of aops-mcp --- aops-mcp.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aops-mcp.spec b/aops-mcp.spec index 6e88197..6e67cb0 100644 --- a/aops-mcp.spec +++ b/aops-mcp.spec @@ -54,15 +54,24 @@ ln -s /opt/%{name}/venv/bin/aops-mcp %{buildroot}%{_bindir}/aops-mcp %post # systemd 配置 -%systemd_post aops-mcp.service +if [ $1 -eq 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then + # Initial installation + /usr/lib/systemd/systemd-update-helper install-system-units aops-mcp.service || : +fi %preun # 卸载前停止服务 -%systemd_preun aops-mcp.service +if [ $1 -eq 0 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then + # Package removal, not upgrade + /usr/lib/systemd/systemd-update-helper remove-system-units aops-mcp.service || : +fi %postun # 清理配置 -%systemd_postun_with_restart aops-mcp.service +if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then + # Package upgrade, not uninstall + /usr/bin/systemctl try-restart aops-mcp.service || : +fi %files %dir /opt/%{name} -- cgit v1.2.3