Package init
This commit is contained in:
parent
96e1d29c14
commit
8a72ac5a5f
25
fix-version-in-setup.py.patch
Normal file
25
fix-version-in-setup.py.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 7baf2815f515c54bc33f41f495ec7c26988b5c44 Mon Sep 17 00:00:00 2001
|
||||||
|
From: shixuantong <shixuantong1@huawei.com>
|
||||||
|
Date: Tue, 11 Jun 2024 16:47:46 +0800
|
||||||
|
Subject: [PATCH] fix version in setup.py
|
||||||
|
|
||||||
|
---
|
||||||
|
src/python/setup.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/python/setup.py b/src/python/setup.py
|
||||||
|
index 21dbe9f..f96a96e 100644
|
||||||
|
--- a/src/python/setup.py
|
||||||
|
+++ b/src/python/setup.py
|
||||||
|
@@ -17,7 +17,7 @@ from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="syssentry",
|
||||||
|
- version="1.0.1",
|
||||||
|
+ version="1.0.2",
|
||||||
|
description="System inspection framework tool set",
|
||||||
|
packages=find_packages(),
|
||||||
|
include_package_data=True,
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
BIN
sysSentry-1.0.2.tar.gz
Normal file
BIN
sysSentry-1.0.2.tar.gz
Normal file
Binary file not shown.
171
sysSentry.spec
Normal file
171
sysSentry.spec
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
# Copyright (c) Huawei Technologies Co., Ltd. 2014-2023. All rights reserved.
|
||||||
|
# Description: spec file for package syssentry
|
||||||
|
|
||||||
|
Summary: System Inspection Framework
|
||||||
|
Name: sysSentry
|
||||||
|
Version: 1.0.2
|
||||||
|
Release: 1
|
||||||
|
License: Mulan PSL v2
|
||||||
|
Group: System Environment/Daemons
|
||||||
|
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
BuildRoot: %{_builddir}/%{name}-root
|
||||||
|
|
||||||
|
Patch1: fix-version-in-setup.py.patch
|
||||||
|
|
||||||
|
BuildRequires: cmake gcc-c++
|
||||||
|
BuildRequires: python3 python3-setuptools
|
||||||
|
BuildRequires: json-c-devel
|
||||||
|
BuildRequires: chrpath
|
||||||
|
Requires: libxalarm = %{version}
|
||||||
|
|
||||||
|
%description
|
||||||
|
sysSentry provides framework tools for system inspection.
|
||||||
|
|
||||||
|
%package -n libxalarm
|
||||||
|
Summary: The xalarm library for the sysSentry
|
||||||
|
Requires: json-c
|
||||||
|
Provides: libxalarm = %{version}
|
||||||
|
|
||||||
|
%description -n libxalarm
|
||||||
|
This package provides xalarm library for the sysSentry.
|
||||||
|
|
||||||
|
%package -n libxalarm-devel
|
||||||
|
Summary: The development package for the libxalarm
|
||||||
|
Requires: libxalarm = %{version}
|
||||||
|
Requires: json-c-devel
|
||||||
|
Provides: libxalarm-devel = %{version}
|
||||||
|
|
||||||
|
%description -n libxalarm-devel
|
||||||
|
This package provides developer tools for the libxalarm.
|
||||||
|
|
||||||
|
%package -n cpu_sentry
|
||||||
|
Summary: CPU fault inspection program
|
||||||
|
Requires: procps-ng
|
||||||
|
Recommends: sysSentry = %{version}-%{release}
|
||||||
|
|
||||||
|
%description -n cpu_sentry
|
||||||
|
This package provides CPU fault detection
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
# xalarm
|
||||||
|
sh build/build.sh -b %{buildroot}%{_libdir}
|
||||||
|
|
||||||
|
# sysSentry
|
||||||
|
pushd src/python
|
||||||
|
python3 setup.py build
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd src/c/catcli/catlib
|
||||||
|
cmake -B ./build/ -S . -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release
|
||||||
|
pushd build
|
||||||
|
make
|
||||||
|
popd
|
||||||
|
popd
|
||||||
|
|
||||||
|
%install
|
||||||
|
# sysSentry
|
||||||
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
|
mkdir -p %{buildroot}%{_var}/log/sysSentry
|
||||||
|
install src/python/syssentry/sentryctl %{buildroot}%{_bindir}
|
||||||
|
install -d -m 700 %{buildroot}/etc/sysSentry/
|
||||||
|
install -d -m 700 %{buildroot}/etc/sysSentry/tasks/
|
||||||
|
install -d -m 700 %{buildroot}/etc/sysSentry/plugins/
|
||||||
|
install -m 600 config/inspect.conf %{buildroot}%{_sysconfdir}/sysSentry
|
||||||
|
install -m 600 service/sysSentry.service %{buildroot}%{_unitdir}
|
||||||
|
|
||||||
|
# xalarm
|
||||||
|
sh build/build.sh -i %{buildroot}%{_libdir}
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
||||||
|
install -m 600 config/xalarm.conf %{buildroot}%{_sysconfdir}/sysSentry
|
||||||
|
install -d %{buildroot}%{_libdir}
|
||||||
|
install -d %{buildroot}%{_includedir}/xalarm
|
||||||
|
install -m 600 service/xalarmd.service %{buildroot}%{_unitdir}
|
||||||
|
install -m 600 config/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/sysSentry
|
||||||
|
install -m 644 src/libso/xalarm/register_xalarm.h %{buildroot}%{_includedir}/xalarm/register_xalarm.h
|
||||||
|
|
||||||
|
# cpu sentry
|
||||||
|
install config/tasks/cpu_sentry.mod %{buildroot}/etc/sysSentry/tasks/
|
||||||
|
install config/plugins/cpu_sentry.ini %{buildroot}/etc/sysSentry/plugins/cpu_sentry.ini
|
||||||
|
install src/c/catcli/catlib/build/cat-cli %{buildroot}%{_bindir}/cat-cli
|
||||||
|
install src/c/catcli/catlib/build/plugin/cpu_patrol/libcpu_patrol.so %{buildroot}%{_libdir}
|
||||||
|
|
||||||
|
pushd src/python
|
||||||
|
python3 setup.py install -O1 --root=$RPM_BUILD_ROOT --record=SENTRY_FILES
|
||||||
|
popd
|
||||||
|
|
||||||
|
%pre
|
||||||
|
|
||||||
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ "$1" = "0" ]; then
|
||||||
|
systemctl stop xalarmd.service
|
||||||
|
systemctl disable xalarmd.service
|
||||||
|
systemctl stop sysSentry.service
|
||||||
|
systemctl disable sysSentry.service
|
||||||
|
fi
|
||||||
|
rm -rf /var/run/xalarm | :
|
||||||
|
rm -rf /var/run/sysSentry | :
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
|
%files -f src/python/SENTRY_FILES
|
||||||
|
%defattr(0550,root,root)
|
||||||
|
%attr(0550,root,root) %{python3_sitelib}/xalarm
|
||||||
|
%attr(0550,root,root) %{python3_sitelib}/syssentry
|
||||||
|
|
||||||
|
# sysSentry
|
||||||
|
%attr(0500,root,root) %{_bindir}/sentryctl
|
||||||
|
%attr(0550,root,root) %{_bindir}/syssentry
|
||||||
|
%attr(0750,root,root) %config(noreplace) %{_var}/log/sysSentry
|
||||||
|
%attr(0750,root,root) %config(noreplace) %{_sysconfdir}/sysSentry
|
||||||
|
%attr(0750,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/tasks
|
||||||
|
%attr(0750,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/plugins
|
||||||
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/inspect.conf
|
||||||
|
%attr(0600,root,root) %{_unitdir}/sysSentry.service
|
||||||
|
|
||||||
|
# xalarm
|
||||||
|
%attr(0550,root,root) %{_bindir}/xalarmd
|
||||||
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/sysSentry
|
||||||
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/xalarm.conf
|
||||||
|
%attr(0600,root,root) %{_unitdir}/xalarmd.service
|
||||||
|
|
||||||
|
# cpu inspection module
|
||||||
|
%exclude %{_sysconfdir}/sysSentry/tasks/cpu_sentry.mod
|
||||||
|
%exclude %{_sysconfdir}/sysSentry/plugins/cpu_sentry.ini
|
||||||
|
%exclude %{_bindir}/cpu_sentry
|
||||||
|
%exclude %{_bindir}/cat-cli
|
||||||
|
%exclude %{python3_sitelib}/syssentry/cpu_*
|
||||||
|
%exclude %{python3_sitelib}/syssentry/*/cpu_*
|
||||||
|
|
||||||
|
%files -n libxalarm
|
||||||
|
%attr(0550,root,root) %{_libdir}/libxalarm.so
|
||||||
|
|
||||||
|
%files -n libxalarm-devel
|
||||||
|
%dir %{_includedir}/xalarm
|
||||||
|
%attr(0550,root,root) %{_includedir}/xalarm
|
||||||
|
%attr(0550,root,root) %{_includedir}/xalarm/register_xalarm.h
|
||||||
|
|
||||||
|
%files -n cpu_sentry
|
||||||
|
%attr(0500,root,root) %{_bindir}/cat-cli
|
||||||
|
%attr(0500,root,root) %{_bindir}/cpu_sentry
|
||||||
|
%attr(0550,root,root) %{_libdir}/libcpu_patrol.so
|
||||||
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/tasks/cpu_sentry.mod
|
||||||
|
%attr(0600,root,root) %{_sysconfdir}/sysSentry/plugins/cpu_sentry.ini
|
||||||
|
%attr(0550,root,root) %{python3_sitelib}/syssentry/cpu_*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Tue Jun 11 2024 shixuantong <shixuantong1@huawei.com> - 1.0.2-1
|
||||||
|
- Type:enhancement
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:Package init
|
||||||
Loading…
x
Reference in New Issue
Block a user