-
Notifications
You must be signed in to change notification settings - Fork 37
/
g3proxy.spec
74 lines (58 loc) · 2.17 KB
/
g3proxy.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
%if 0%{?rhel} > 7
%undefine _debugsource_packages
%define pkgconfig_real pkgconf
%define cmake_real cmake
%endif
%if 0%{?rhel} == 7
%global debug_package %{nil}
%define pkgconfig_real pkgconfig
%define cmake_real cmake3
%endif
%define build_profile release-lto
Name: g3proxy
Version: 1.11.2
Release: 1%{?dist}
Summary: Generic proxy for G3 Project
License: Apache-2.0
URL: https://github.com/bytedance/g3
Source0: %{name}-%{version}.tar.xz
BuildRequires: gcc, make, %{pkgconfig_real}, %{cmake_real}, capnproto
BuildRequires: lua-devel, openssl-devel
BuildRequires: perl-IPC-Cmd
Requires: systemd
Requires: ca-certificates
%description
Generic proxy for G3 Project
%prep
%autosetup
%build
G3_PACKAGE_VERSION="%{version}-%{release}"
export G3_PACKAGE_VERSION
LUA_VERSION=$(pkg-config --variable=V lua | tr -d '.')
LUA_FEATURE=lua$LUA_VERSION
SSL_FEATURE=$(sh scripts/package/detect_openssl_feature.sh)
CARES_FEATURE=$(sh scripts/package/detect_c-ares_feature.sh)
export CMAKE="%{cmake_real}"
cargo build --frozen --profile %{build_profile} --no-default-features --features $LUA_FEATURE,$SSL_FEATURE,rustls-ring,quic,$CARES_FEATURE,hickory --package g3proxy --package g3proxy-ctl --package g3proxy-lua
cargo build --frozen --profile %{build_profile} --package g3proxy-ftp
sh %{name}/service/generate_systemd.sh
%install
rm -rf $RPM_BUILD_ROOT
install -m 755 -D target/%{build_profile}/g3proxy %{buildroot}%{_bindir}/g3proxy
install -m 755 -D target/%{build_profile}/g3proxy-ctl %{buildroot}%{_bindir}/g3proxy-ctl
install -m 755 -D target/%{build_profile}/g3proxy-ftp %{buildroot}%{_bindir}/g3proxy-ftp
install -m 755 -D target/%{build_profile}/g3proxy-lua %{buildroot}%{_bindir}/g3proxy-lua
install -m 644 -D %{name}/service/[email protected] %{buildroot}/lib/systemd/system/[email protected]
%files
%{_bindir}/g3proxy
%{_bindir}/g3proxy-ctl
%{_bindir}/g3proxy-ftp
%{_bindir}/g3proxy-lua
/lib/systemd/system/[email protected]
%license LICENSE
%license LICENSE-BUNDLED
%license LICENSE-FOREIGN
%doc sphinx/%{name}/_build/html
%changelog
* Fri Jan 03 2025 G3proxy Maintainers <[email protected]> - 1.11.2-1
- New upstream release