1 %define crates_ver 0.6.0
3 Summary: A viewer for git and diff output
9 Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 34aa67d3a8caee4772c99d7752d21171
12 Source1: %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5: c4793b562c3e5d49ec09744274baab3e
14 URL: https://github.com/dandavison/delta
17 BuildRequires: tar >= 1:1.22
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 Delta aims to make studying diffs both efficient and enjoyable: it
23 allows you to make extensive changes to the layout and styling of
24 diffs, as well as allowing you to stay arbitrarily close to the
25 default git/diff output, changing just the aspects that you want to
28 Delta's main features are:
30 - Language syntax highlighting with color themes
31 - Within-line highlights based on a Levenshtein edit inference
33 - Style (foreground color, background color, font attributes) can be
34 configured independently for more than 20 different sections of the
36 - Stylable box/line decorations to draw attention to commit, file and
38 - Line numbering (`-n`)
39 - `--diff-highlight` and `--diff-so-fancy` emulation modes
40 - Code can be copied directly from the diff (`-/+` markers are removed
42 - `n` and `N` keybindings to move between files in large diffs, and
43 between diffs in `log -p` views (`--navigate`) A viewer for git and
49 %{__mv} delta-%{crates_ver}/* .
50 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
52 # use our offline registry
53 export CARGO_HOME="$(pwd)/.cargo"
55 mkdir -p "$CARGO_HOME"
56 cat >.cargo/config <<EOF
58 registry = 'https://github.com/rust-lang/crates.io-index'
59 replace-with = 'vendored-sources'
61 [source.vendored-sources]
62 directory = '$PWD/vendor'
66 export CARGO_HOME="$(pwd)/.cargo"
68 cargo -v build --release --frozen
71 rm -rf $RPM_BUILD_ROOT
72 export CARGO_HOME="$(pwd)/.cargo"
74 cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
75 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
78 rm -rf $RPM_BUILD_ROOT
81 %defattr(644,root,root,755)
83 %attr(755,root,root) %{_bindir}/delta