-
Notifications
You must be signed in to change notification settings - Fork 0
/
cgproxy.spec
94 lines (65 loc) · 1.62 KB
/
cgproxy.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
%bcond_without check
%global forgeurl https://github.com/springzfx/cgproxy/
Version: 0.20
%forgemeta
Name: cgproxy
Release: 1%{?dist}
Summary: Transparent Proxy with cgroup v2
License: GPLv2
URL: %{forgeurl}
Source0: %{forgesource}
Patch0: 52.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake >= 3.14
BuildRequires: clang
BuildRequires: json-devel
BuildRequires: libbpf-devel
BuildRequires: systemd-rpm-macros
BuildRequires: bpftool
BuildRequires: git-core
%description
cgproxy will transparent proxy anything running in specific cgroup.
It resembles with proxychains and tsocks in default setting.
%prep
%forgeautosetup -S git
%build
%cmake \
%{?with_check: -Dbuild_test=ON } \
-Dbuild_execsnoop_dl=ON \
-Dbuild_static=OFF
%cmake_build
%install
%cmake_install
%if %{with check}
%check
%ctest
%endif
%files
%license LICENSE
%doc readme.md
%{_mandir}/man1/*.1.*
%{_bindir}/cgnoproxy
%{_bindir}/cgproxy
%{_bindir}/cgproxyd
%dir %{_libdir}/cgproxy
%{_libdir}/cgproxy/libexecsnoop.so
%dir %{_datadir}/cgproxy
%dir %{_datadir}/cgproxy/scripts
%{_datadir}/cgproxy/scripts/cgroup-tproxy.sh
%{_datadir}/cgproxy/scripts/iptables.sh
%{_datadir}/cgproxy/scripts/nftables.sh
%dir %{_sysconfdir}/cgproxy
%config(noreplace) %{_sysconfdir}/cgproxy/config.json
%{_unitdir}/cgproxy.service
# scriptlets >>
%post
%systemd_post cgproxy.service
%preun
%systemd_preun cgproxy.service
%postun
%systemd_postun_with_restart cgproxy.service
# << scriptlets
%changelog
* Sun Nov 26 2023 sixg0000d <[email protected]>
- Initial package