g3/g3proxy/g3proxy.spec
2026-01-10 21:48:51 +08:00

60 lines
1.8 KiB
RPMSpec

%undefine _debugsource_packages
%define build_profile release-lto
Name: g3proxy
Version: 1.12.0
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, pkgconf, cmake
BuildRequires: lua-devel, openssl-devel
Requires: ca-certificates
%description
Generic proxy for G3 Project
%prep
%autosetup
%build
G3_PACKAGE_VERSION="%{version}-%{release}"
export G3_PACKAGE_VERSION
LUA_FEATURE=$(lua -v | sed 's/Lua \([0-9]\+\)[.]\([0-9]\+\)[.].*/lua\1\2/')
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,rustls-ring,quic,$CARES_FEATURE --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/g3proxy@.service %{buildroot}/lib/systemd/system/g3proxy@.service
%files
%{_bindir}/g3proxy
%{_bindir}/g3proxy-ctl
%{_bindir}/g3proxy-ftp
%{_bindir}/g3proxy-lua
/lib/systemd/system/g3proxy@.service
%license LICENSE
%license LICENSE-BUNDLED
%license LICENSE-FOREIGN
%doc sphinx/%{name}/_build/html
%changelog
* Sat Aug 09 2025 G3proxy Maintainers <g3proxy-maintainers@devel.machine> - 1.12.0-1
- New upstream release