%global _build_id_links none %global debug_package %{nil} %undefine source_date_epoch_from_changelog %global upstream_version 0.3.0 %global software_name sbtui Name: %{software_name} Version: %{upstream_version} Release: 1%{?dist} Summary: Terminal UI for the sing-box API service License: MIT URL: https://git.sudolife.dev:8443/eos/sbtui # Source0 unpacks to sbtui-%%{upstream_version}/ (archive prefix set by the # vendoring workflow). Same filename/layout as the Debian orig tarball. Source0: %{software_name}_%{upstream_version}.orig.tar.gz # Vendored crates (Debian orig-vendor component: contents of vendor/ only). Source1: %{software_name}_%{upstream_version}.orig-vendor.tar.gz BuildRequires: tar, rust >= 1.88.0, cargo >= 1.88.0, gcc %description sbtui is a terminal UI for a running sing-box instance, using the sing-box API service. It provides instance switching, proxy groups, connections, logs, Tailscale controls and network tools. %prep %autosetup -p1 -n %{software_name}-%{upstream_version} # Source1 is a Debian-style orig-vendor component (contents of vendor/ only). mkdir -p vendor tar -xf %{SOURCE1} -C vendor if [ ! -d vendor ]; then echo "ERROR: vendor/ directory not found. Provide a vendored crates tarball via Source1." >&2 exit 1 fi %build export CARGO_HOME="$PWD/.cargo-home" export RUSTFLAGS="-C link-arg=-Wl,--as-needed" cargo build --release --frozen --offline %install install -Dsm755 target/release/%{software_name} %{buildroot}%{_bindir}/%{software_name} %check %files %license LICENSE %doc README.md %{_bindir}/%{software_name} %changelog