File stardust-xr-black-hole.spec of Package stardust-xr-black-hole

%define _bin_name black-hole
Name:           stardust-xr-black-hole
#               This will be set by osc services, that will run after this.
Version:        0.50.0~0
Release:        0
Summary:        Annotate things in Stardust XR
#               If you know the license, put it's SPDX string here.
#               Alternately, you can use cargo lock2rpmprovides to help generate this.
License:        MIT
Url:            https://github.com/StardustXR/armillary
Source0:        %{_bin_name}-%{version}.tar.zst
Source1:        vendor.tar.zst
# Pull in the latest rust/cargo toolchain
%if 0%{?suse_version}
BuildRequires:  cargo
BuildRequires:  cargo-packaging
%else
BuildRequires: rust-srpm-macros
BuildRequires: cargo-rpm-macros
%endif

%description
%summary.

%prep
%autosetup -p1 -a1 -n %{_bin_name}-%{version}
%if 0%{?fedora}
%cargo_prep -v vendor
%endif

%build
export STARDUST_RES_PREFIXES=%_datadir
%{cargo_build}

%install
%{cargo_install}
mkdir -p %buildroot%_datadir
cp -r res/* %buildroot%_datadir/


%check
%{cargo_test}

%files
%license LICENSE
%{_bindir}/%{_bin_name}
%_datadir/black_hole/

%changelog
openSUSE Build Service is sponsored by