commit 3cee0001fc56964d7f991f497059376e62aa6543 Author: Sergey Zhemoytel Date: Sat Dec 14 22:38:01 2024 +0300 Imported from SRPM diff --git a/.abf.yml b/.abf.yml new file mode 100644 index 0000000..4ea9209 --- /dev/null +++ b/.abf.yml @@ -0,0 +1,2 @@ +sources: + sing-box-1.10.3.tar.gz: c91197faf4987ac13c09ef7ff50512ef0ad89e97 diff --git a/sing-box.spec b/sing-box.spec new file mode 100644 index 0000000..9ee649b --- /dev/null +++ b/sing-box.spec @@ -0,0 +1,57 @@ +%define debug %nil +%define debug_package %nil + +Name: sing-box +Version: 1.10.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} +