diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 77d65d2d2c32364d34d6941e51c1aee757a60dc0..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# TSB-agent - -#### Description -The Trusted Software Base Agent (TSB-agent) operates within the OS to build an active immune defense system based on the Root of Trust, enhancing terminal security. It handles element collection, communication, and control execution, serving as a core component of Initiative Trusted Computing. Its goal is to align OS trusted functions with Initiative Trusted Computing requirements, drive community engagement, and evolve with OS and trusted computing technologies. - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 314ecd574c816a3c921b50e37ce635c8a964f0f4..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# TSB-agent - -#### 介绍 -The Trusted Software Base Agent (TSB-agent) operates within the OS to build an active immune defense system based on the Root of Trust, enhancing terminal security. It handles element collection, communication, and control execution, serving as a core component of Initiative Trusted Computing. Its goal is to align OS trusted functions with Initiative Trusted Computing requirements, drive community engagement, and evolve with OS and trusted computing technologies. - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/TSB-agent-0.0.1.tar.gz b/TSB-agent-0.0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8d8d32af0be54ef16994f47d22be833c9b81cba0 Binary files /dev/null and b/TSB-agent-0.0.1.tar.gz differ diff --git a/TSB-agent.spec b/TSB-agent.spec new file mode 100644 index 0000000000000000000000000000000000000000..c2a5511768a3aad7fda9f9c4d66e2aff64be457d --- /dev/null +++ b/TSB-agent.spec @@ -0,0 +1,123 @@ +Name: TSB-agent +Version: 0.0.1 +Release: 1 +Summary: Trusted Software Base Agent for openEuler +Summary(zh_CN): 可信基础软件代理(TSB-agent) +License: MulanPSL-2.0 +URL: https://gitee.com/openeuler/TSB-agent +Source0: %{name}-%{version}.tar.gz +Source1: googletest-v1.15.2.tar.gz +Source2: openssl-3.3.2.tar.gz +Source3: rapidjson-v1.1.0.tar.gz +Source4: spdlog-v1.14.1.tar.gz +Source5: libboundscheck.tar.gz + +BuildRequires: gcc, make, libboundscheck +BuildRequires: gcc-c++ >= 7, cmake >= 3.14, grpc, grpc-devel, grpc-plugins, protobuf-devel, protobuf-compiler + +# Optional devel-time dependencies if using system libraries + +# Runtime Requires +Requires: libvirt-devel, libxml2-devel, openssl-devel, libguestfs-devel + +%global __requires_exclude libinterfac\.so + +%description +TSB-agent (Trusted Software Base Agent) provides trusted computing +capabilities including integrity verification and a daemon/CLI for +virtualization scenarios on openEuler. + +# define sub-package +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} +%description devel +TSB-agent (Trusted Software Base Agent) provides trusted computing +capabilities including integrity verification and a daemon/CLI for +virtualization scenarios on openEuler. + +%prep +%autosetup -n %{name}-%{version} + +# Extract dependency packages to directories expected by CMake: build/deps/src +# Note: Directory names must match ExternalProject names in cmake/deps/*.cmake +# - googletest +# - openssl (BUILD_IN_SOURCE On) +# - rapidjson +# - spdlog +# - libboundscheck-src +DEPS_SRC="%{build_dir}/deps/src" +mkdir -p "$DEPS_SRC" + +mkdir -p "$DEPS_SRC/googletest" +tar -xzf %{SOURCE1} -C "$DEPS_SRC/googletest" --strip-components=1 + +mkdir -p "$DEPS_SRC/openssl" +tar -xzf %{SOURCE2} -C "$DEPS_SRC/openssl" --strip-components=1 + +mkdir -p "$DEPS_SRC/rapidjson" +tar -xzf %{SOURCE3} -C "$DEPS_SRC/rapidjson" --strip-components=1 + +mkdir -p "$DEPS_SRC/spdlog" +tar -xzf %{SOURCE4} -C "$DEPS_SRC/spdlog" --strip-components=1 + +mkdir -p "$DEPS_SRC/libboundscheck-src" +tar -xzf %{SOURCE5} -C "$DEPS_SRC/libboundscheck-src" --strip-components=1 + +%global root_dir %{_builddir}/%{name}-%{version} +%global build_dir %{_builddir}/%{name}-%{version}/build +%global output_dir %{_builddir}/%{name}-%{version}/output + +%build +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags}" + +cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DENABLE_DOWNLOAD_DEPS=Off \ + -DCMAKE_INSTALL_PREFIX=%{output_dir} + +cmake --build build -- -j%{?_smp_build_ncpus} + +cmake --install build + +%install +rm -rf %{buildroot} +install -d -m 750 %{buildroot}%{_libdir} +install -d -m 750 %{buildroot}%{_bindir} +install -d -m 755 %{buildroot}%{_includedir}/virtrust/api +install -d -m 755 %{buildroot}%{_includedir}/virtrust/base +install -d -m 750 %{buildroot}%{_sysconfdir}/virtrust + +# Library files +install -m 550 %{output_dir}/lib64/libvirtrust-shared.so %{buildroot}%{_libdir} + +# Executable files +install -m 550 %{output_dir}/bin/virtrust-sh %{buildroot}%{_bindir} +install -m 550 %{output_dir}/bin/libvirtrustd %{buildroot}%{_bindir} + +# Header files +install -m 644 %{output_dir}/include/virtrust/api/*.h %{buildroot}%{_includedir}/virtrust/api +install -m 644 %{output_dir}/include/virtrust/base/*.h %{buildroot}%{_includedir}/virtrust/base + +# Configuration files +install -pm 644 %{root_dir}/test/data/config.json %{buildroot}%{_sysconfdir}/virtrust/config.json + +%files +%dir %attr(0750, root, root) %{_sysconfdir}/virtrust/ +%config %attr(0640, root, root) %{_sysconfdir}/virtrust/config.json + +%{_libdir}/libvirtrust-shared.so +%{_bindir}/virtrust-sh +%{_bindir}/libvirtrustd +%{_includedir}/virtrust/api/*.h +%{_includedir}/virtrust/base/*.h + +%post +/sbin/ldconfig + +%changelog +* Mon Dec 01 2025 cx - 0.0.1-1 +- fix: ensure char array ends with '\0' \ No newline at end of file diff --git a/googletest-v1.15.2.tar.gz b/googletest-v1.15.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2add8bc9c51449e4f499237e5d5de4cfc0b50d3d Binary files /dev/null and b/googletest-v1.15.2.tar.gz differ diff --git a/libboundscheck.tar.gz b/libboundscheck.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..332d17efe65f0197ae3bb3c9e671f23867f89bf4 Binary files /dev/null and b/libboundscheck.tar.gz differ diff --git a/openssl-3.3.2.tar.gz b/openssl-3.3.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e5e9ae6a14ebb236a0ad7cfc59bcd48c057397cc Binary files /dev/null and b/openssl-3.3.2.tar.gz differ diff --git a/rapidjson-v1.1.0.tar.gz b/rapidjson-v1.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5e39742ca8787b9b27d3a7b9a720ba83e6b888fb Binary files /dev/null and b/rapidjson-v1.1.0.tar.gz differ diff --git a/spdlog-v1.14.1.tar.gz b/spdlog-v1.14.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c2904efb26be8df8a4995b5961999b626942e982 Binary files /dev/null and b/spdlog-v1.14.1.tar.gz differ