sing-box/sing-box.spec
Your Name 78559e8fb3
All checks were successful
Run CI/CD... / main (push) Successful in 12m0s
1.11.3
2025-02-11 10:07:07 +00:00

57 lines
1.6 KiB
RPMSpec

%define debug %nil
%define debug_package %nil
Name: sing-box
Version: 1.11.3
Release: 1
Summary: The universal proxy platform
URL: https://sing-box.sagernet.org
Source0: https://github.com/SagerNet/sing-box/archive/v%{version}/%{name}-%{version}.tar.gz
License: GPLv3
Group: Security
BuildRequires: go
BuildRequires: git-core
BuildRequires: upx
BuildRequires: pkgconfig(openssl3.3)
BuildRequires: pkgconfig(libevent)
BuildRequires: pkgconfig(systemd)
%description
The universal proxy platform.
see %{_docdir}/%{name} or https://sing-box.sagernet.org
%prep
%setup -q
%build
export GOSUMDB=off
export GOPROXY=https://proxy.golang.org,direct
go build -v -trimpath -ldflags "-s -w -X github.com/sagernet/sing-box/constant.Version=%{version} -buildid=" \
-tags "with_gvisor,with_dhcp,with_wireguard,with_reality_server,with_clash_api,with_quic,with_utls,with_ech,with_v2ray_api" \
-o bin/%{name} \
./cmd/sing-box/
upx bin/%{name}
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
pushd release/config
install -Dm0644 config.json %{buildroot}%{_sysconfdir}/%{name}/config.json
install -Dm0644 sing-box.service %{buildroot}%{_unitdir}/sing-box.service
install -Dm0644 sing-box@.service %{buildroot}%{_userunitdir}/sing-box@.service
popd
pushd release/completions
install -Dm0644 sing-box.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name}
popd
%files
%doc README.md LICENSE docs
%{_bindir}/%{name}
%{_sysconfdir}/%{name}/config.json
%{_unitdir}/sing-box.service
%{_userunitdir}/sing-box@.service
%{_datadir}/bash-completion/completions/%{name}