%global debug_package %{nil} Name: mdcat Version: 2.7.0 Release: 1%{?dist} Summary: cat for markdown License: MIT URL: https://github.com/swsnr/mdcat Source0: %{url}/archive/refs/tags/mdcat-%{version}.tar.gz Requires: openssl Requires: libcurl BuildRequires: openssl-devel BuildRequires: libcurl-devel BuildRequires: git BuildRequires: make BuildRequires: gcc %if 0%{?el8} %else BuildRequires: cargo >= 1.39 BuildRequires: rust >= 1.39 %endif %description cat for markdown: Show markdown documents in terminals %prep %autosetup -n mdcat-mdcat-%{version} %if 0%{?el8} curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y %endif %install export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_OPT_LEVEL=3 %if 0%{?el8} $HOME/.cargo/bin/cargo build --release --locked %else cargo build --release --locked %endif mkdir -p %{buildroot}%{_bindir} mv ./target/release/mdcat %{buildroot}%{_bindir}/mdcat mkdir -p %{buildroot}%{_datadir}/licenses/mdcat mv ./LICENSE %{buildroot}%{_datadir}/licenses/mdcat/LICENSE mkdir -p %{buildroot}%{_docdir}/mdcat mv README.md %{buildroot}%{_docdir}/mdcat/README.md rm -f %{buildroot}%{_prefix}/.crates.toml \ %{buildroot}%{_prefix}/.crates2.json strip --strip-all %{buildroot}%{_bindir}/* %files %license LICENSE %doc README.md %{_bindir}/mdcat