mirror of
https://github.com/bytedance/g3.git
synced 2026-05-02 13:40:42 +00:00
73 lines
2.1 KiB
RPMSpec
73 lines
2.1 KiB
RPMSpec
%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.9.3
|
|
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 --offline --profile %{build_profile} --no-default-features --features $LUA_FEATURE,$SSL_FEATURE,quic,$CARES_FEATURE,hickory --package g3proxy --package g3proxy-ctl --package g3proxy-ftp --package g3proxy-lua
|
|
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 %{name}/doc/_build/html
|
|
|
|
|
|
%changelog
|
|
* Wed Jun 19 2024 G3proxy Maintainers <g3proxy-maintainers@devel.machine> - 1.9.3-1
|
|
- New upstream release
|