File stardust-xr-solar-sailer.spec of Package stardust-xr-solar-sailer
%define _bin_name solar-sailer
Name: stardust-xr-solar-sailer
Version: 0.50.0~0
Release: 0
Summary: Glide through space! This play space mover allows you to fly by dragging the space with momentum!
License: MIT
Url: https://github.com/StardustXR/solar-sailer
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}
%build
%if 0%{?fedora}
/usr/bin/mkdir -p target/rpm
/usr/bin/ln -s rpm target/release
cat >> .cargo/config.toml <<'EOF'
[build]
rustc = "/usr/bin/rustc"
rustdoc = "/usr/bin/rustdoc"
[profile.rpm]
inherits = "release"
opt-level = 3
codegen-units = 1
debug = 2
strip = "none"
EOF
%endif
export STARDUST_RES_PREFIXES=%_datadir
%{cargo_build} \
%if 0%{?fedora}
--frozen --locked
%endif
%install
mkdir -p %{buildroot}%{_bindir}/
install -Dm755 target/release/%{_bin_name} %{buildroot}%{_bindir}/
install -Dm644 res/solar_sailer/move_icon.glb %{buildroot}%{_datadir}/%{name}/solar_sailer/move_icon.glb
%check
%{cargo_test}
%files
%license LICENSE
%{_bindir}/%{_bin_name}
%dir /usr/share/stardust-xr-solar-sailer
%dir /usr/share/stardust-xr-solar-sailer/solar_sailer
%{_datadir}/%{name}/solar_sailer/move_icon.glb
%changelog