]>
Commit | Line | Data |
---|---|---|
d037b48c | 1 | %define crates_ver 0.7.1 |
4a2626ba | 2 | |
92a8f118 JP |
3 | Summary: A viewer for git and diff output |
4 | Name: delta | |
d037b48c | 5 | Version: 0.7.1 |
92a8f118 JP |
6 | Release: 1 |
7 | License: MIT | |
8 | Group: Applications | |
9 | Source0: https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz | |
d037b48c | 10 | # Source0-md5: a606fdeaf7c689aba27da79b13362f89 |
f2b5808f | 11 | # ./create-crates.sh |
4a2626ba | 12 | Source1: %{name}-crates-%{crates_ver}.tar.xz |
d037b48c | 13 | # Source1-md5: 88f9be8b3bf03d2651690a010cc27766 |
92a8f118 JP |
14 | URL: https://github.com/dandavison/delta |
15 | BuildRequires: cargo | |
16 | BuildRequires: rust | |
c42db62c JP |
17 | BuildRequires: tar >= 1:1.22 |
18 | BuildRequires: xz | |
92a8f118 JP |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
20 | ||
21 | %description | |
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 | |
26 | change. | |
27 | ||
28 | Delta's main features are: | |
29 | ||
30 | - Language syntax highlighting with color themes | |
31 | - Within-line highlights based on a Levenshtein edit inference | |
32 | algorithm | |
33 | - Style (foreground color, background color, font attributes) can be | |
34 | configured independently for more than 20 different sections of the | |
35 | diff | |
36 | - Stylable box/line decorations to draw attention to commit, file and | |
37 | hunk header sections. | |
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 | |
41 | by default). | |
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 | |
44 | diff output. | |
45 | ||
46 | %prep | |
4a2626ba JP |
47 | %setup -q -a1 |
48 | ||
49 | %{__mv} delta-%{crates_ver}/* . | |
50 | sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock | |
92a8f118 JP |
51 | |
52 | # use our offline registry | |
53 | export CARGO_HOME="$(pwd)/.cargo" | |
54 | ||
55 | mkdir -p "$CARGO_HOME" | |
56 | cat >.cargo/config <<EOF | |
57 | [source.crates-io] | |
58 | registry = 'https://github.com/rust-lang/crates.io-index' | |
59 | replace-with = 'vendored-sources' | |
60 | ||
61 | [source.vendored-sources] | |
62 | directory = '$PWD/vendor' | |
63 | EOF | |
64 | ||
65 | %build | |
66 | export CARGO_HOME="$(pwd)/.cargo" | |
67 | ||
68 | cargo -v build --release --frozen | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | export CARGO_HOME="$(pwd)/.cargo" | |
73 | ||
74 | cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD | |
75 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates* | |
76 | ||
77 | %clean | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc README.md | |
83 | %attr(755,root,root) %{_bindir}/delta |