# Generated by rust2rpm 28 %bcond check 1 %global crate brtr Name: rust-brtr Version: 0.1.3 Release: 3%{?dist} Summary: Lightweight, regex-based browser router for Linux License: MIT URL: https://crates.io/crates/brtr Source: %{crates_source} BuildRequires: cargo-rpm-macros >= 24 # Added for desktop-file validation BuildRequires: desktop-file-utils %global _description %{expand: A lightweight, regex-based browser router for Linux.} %description %{_description} %package -n %{crate} Summary: %{summary} License: MIT # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # 1. Standard binary installation %cargo_install # 2. Install .desktop file install -Dpm 0644 brtr.desktop %{buildroot}%{_datadir}/applications/brtr.desktop # 3. Install Examples (preserving directory structure) mkdir -p %{buildroot}%{_docdir}/%{crate}/examples cp -rp examples/* %{buildroot}%{_docdir}/%{crate}/examples/ %check %if %{with check} %cargo_test %endif desktop-file-validate %{buildroot}%{_datadir}/applications/brtr.desktop %files -n %{crate} %license LICENSE %license LICENSE.dependencies %doc README.md # This includes the nested examples directory we created in %install %doc %{_docdir}/%{crate}/examples/ %{_bindir}/brtr %{_datadir}/applications/brtr.desktop %changelog %autochangelog