difftastic/difftastic.spec
Your Name d568ae3b40
Some checks failed
Run CI/CD... / main (push) Failing after 16m57s
0.63.0
2025-02-11 19:25:32 +00:00

79 lines
1.3 KiB
RPMSpec

%define debug %nil
%define debug_package %nil
%define rustver 1.83.0
Name: difftastic
Version: 0.63.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
BuildRequires: pkgconfig(openssl3.3)
%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