%define debug %nil %define debug_package %nil %define rustver 1.83.0 Name: difftastic Version: 0.62.0 Release: 1 Summary: A diff that understands syntax URL: https://difftastic.wilfred.me.uk Source0: https://github.com/Wilfred/difftastic/archive/%{version}/%{name}-%{version}.tar.gz Source1000: %{name}.rpmlintrc License: MIT Group: Development/Other Provides: difft %if %{mdvver} > 201610 BuildRequires: rust BuildRequires: cargo %endif BuildRequires: git-core BuildRequires: upx BuildRequires: curl %description Difftastic is an experimental diff tool that compares files based on their syntax. Difftastic supports the following languages: Bash C C++ C# Clojure Common Lisp CSS Dart Elixir Emacs Lisp Go Haskell Janet Java JavaScript (and JSX) JSON Lua Nix OCaml PHP Python Ruby Rust Scala TypeScript (and TSX) %prep %setup -q %if %{mdvver} <= 201610 curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs |\ sh -s -- -y --profile default --default-toolchain %{rustver} %endif %build %if %{mdvver} <= 201610 source "$HOME/.cargo/env" %endif cargo build --release upx ./target/release/difft %install install -Dm0755 ./target/release/difft %{buildroot}%{_bindir}/difft %files %doc README.md LICENSE %{_bindir}/difft