# Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/sagernet/sing-box %global goipath github.com/sagernet/sing-box Version: 1.14.4 %global tag 1.14.4 %gometa -L -f Name: sing-box Release: %autorelease Summary: The universal proxy platform # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND CC0-1.0 AND GPL-3.0-only AND ISC AND LGPL-3.0-only AND MIT AND MPL-2.0 AND Unlicense URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: https://github.com/sagernet/sing-geoip/releases/latest/download/geoip.db Source4: https://github.com/sagernet/sing-geosite/releases/latest/download/geosite.db Source5: sing-box.sysusers Patch0: 0001-Systemd-unit-file-optimization.patch BuildRequires: go-vendor-tools BuildRequires: systemd-units BuildRequires: systemd-rpm-macros %{?sysusers_requires_compat} Requires: systemd-units Requires: sing-box-geo %description The universal proxy platform. %package geo Summary: The geoip data file. BuildArch: noarch %description geo The geo database file. %prep %goprep -p1 tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on export DEFAULT_LDFLAGS="-X runtime.godebugDefault=multipathtcp=0,tlssha1=1 -checklinkname=0" export GOTAGS="with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale,with_ccm,with_ocm,with_cloudflared,with_naive_outbound,with_usbip,with_openvpn,with_openconnect,badlinkname,tfogo_checklinkname0" export GO_LDFLAGS="-X 'github.com/sagernet/sing-box/constant.Version=%{version}' ${DEFAULT_LDFLAGS}" %gobuild -o %{gobuilddir}/bin/%{name} %{goipath}/cmd/%{name} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m 0755 -vd %{buildroot}%{_datadir}/%{name} install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name} install -m 0755 -vd %{buildroot}%{_localstatedir}/log/%{name} install -m 0755 -vd %{buildroot}%{_sysusersdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sharedstatedir}/%{name} install -m 0644 -vp release/config/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -m 0644 -vp release/config/%{name}@.service %{buildroot}%{_unitdir}/%{name}@.service install -m 0644 -vp release/config/config.json %{buildroot}%{_sysconfdir}/%{name}/config.json install -m 0644 -vp %{SOURCE5} %{buildroot}%{_sysusersdir}/%{name}.conf install -m 0644 -vp %{SOURCE3} %{buildroot}%{_datadir}/%{name}/geoip.db install -m 0644 -vp %{SOURCE4} %{buildroot}%{_datadir}/%{name}/geosite.db %pre %sysusers_create_compat %{SOURCE5} %post if [ -d %{_sharedstatedir}/%{name} ]; then chown -R sagernet:sagernet %{_sharedstatedir}/%{name} fi %check %go_vendor_license_check -c %{S:2} %files -f %{go_vendor_license_filelist} %defattr(-,root,root,-) %doc docs README.md common/ja3/README.md common/tlsspoof/README.md %doc transport/simple-obfs/README.md %license LICENSE %{_bindir}/sing-box %attr(-, root, root) %{_unitdir}/%{name}.service %attr(-, root, root) %{_unitdir}/%{name}@.service %{_sysusersdir}/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}/config.json %{_sharedstatedir}/%{name} %files geo %{_datadir}/%{name}/geoip.db %{_datadir}/%{name}/geosite.db %changelog %autochangelog