-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrusted-network-gateway.spec
103 lines (83 loc) · 2.72 KB
/
trusted-network-gateway.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
%global debug_package %{nil}
Name: trusted-network-gateway
Version: 1.0.5
Release: 1%{?dist}
Summary: Trusted Network Gateway
Group: Applications/System
License: ASL 2.0
URL: www.alibaba.com
Source0: https://github.com/inclavare-containers/tng/archive/refs/tags/%{name}-%{version}.tar.gz
Source1: config
Requires: curl iptables openssl
Recommends: attestation-agent
BuildRequires: make
BuildRequires: git
BuildRequires: gcc
BuildRequires: pkg-config
BuildRequires: protobuf-compiler
BuildRequires: cmake
BuildRequires: wget
BuildRequires: net-tools
BuildRequires: curl
BuildRequires: file
BuildRequires: gnupg
BuildRequires: tree
BuildRequires: libcurl-devel
BuildRequires: libseccomp-devel
BuildRequires: openssl-devel
BuildRequires: binutils-devel
BuildRequires: protobuf-devel
BuildRequires: clang
BuildRequires: jq
BuildRequires: cargo
BuildRequires: rust
BuildRequires: chrpath
ExclusiveArch: x86_64
%description
A tool for establishing secure communication tunnels in confidential computing.
%prep
%setup -q -n %{name}-%{version}
# Add cargo source replacement configs
mkdir -p ~/.cargo/
cp %{SOURCE1} ~/.cargo/config
%build
ln -s `realpath %{_builddir}/%{name}-%{version}/vendor` ~/vendor
# Build rats-rs
pushd src/deps/rats-rs
cmake -Hc-api -Bbuild -DCOCO_ONLY=ON
make -Cbuild install DESTDIR=%{_builddir}/%{name}-%{version}/install/rats-rs/
popd
# Build tng
pushd src/
cargo install --locked --path . --root %{_builddir}/%{name}-%{version}/install/tng/
strip %{_builddir}/%{name}-%{version}/install/tng/bin/tng
popd
# Patch tng-envoy
chrpath --replace '$ORIGIN' %{_builddir}/%{name}-%{version}/overlay/usr/local/bin/envoy-static
# Remove vendor
rm -f ~/vendor
%install
# Install rats-rs
mkdir -p %{buildroot}/usr/lib64/tng/
install -p -m 644 %{_builddir}/%{name}-%{version}/install/rats-rs/usr/local/lib/rats-rs/librats_rs.so %{buildroot}/usr/lib64/tng/
# Install tng
mkdir -p %{buildroot}/usr/bin/
install -p -m 755 %{_builddir}/%{name}-%{version}/install/tng/bin/tng %{buildroot}/usr/bin/tng
# Install tng-envoy
install -p -m 755 %{_builddir}/%{name}-%{version}/overlay/usr/local/bin/envoy-static %{buildroot}/usr/lib64/tng/envoy-static
%define __requires_exclude librats_rs.so
%files
%license src/LICENSE
/usr/bin/tng
/usr/lib64/tng/envoy-static
/usr/lib64/tng/librats_rs.so
%changelog
* Mon Mar 3 2025 Kun Lai <[email protected]> - 1.0.5
- Extend aa timeout to 2 minutes
- Add trusted_certs_paths to verify field in config file
* Mon Feb 24 2025 Kun Lai <[email protected]> - 1.0.4
- Nothing but some adjust on build script
* Wed Jan 22 2025 Kun Lai <[email protected]> - 1.0.3-2
- Rename package name from tng to trusted-network-gateway.
* Tue Dec 17 2024 Kun Lai <[email protected]> - 1.0.3-1
- Initial package release.