1 %define crates_ver 0.8.0
3 Summary: A smarter cd command
9 Source0: https://github.com/ajeetdsouza/zoxide/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 6783966c8e57061bc3f1d0579410f88d
12 Source1: %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5: 2850666699cb60867f03368f608988ee
14 URL: https://github.com/ajeetdsouza/zoxide
16 BuildRequires: rpmbuild(macros) >= 2.004
18 BuildRequires: tar >= 1:1.22
20 ExclusiveArch: %{rust_arches}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 zoxide is a blazing fast replacement for your cd command, inspired by
25 z and z.lua. It keeps track of the directories you use most
26 frequently, and uses a ranking algorithm to navigate to the best
29 %package -n bash-completion-zoxide
30 Summary: bash-completion for zoxide
31 Group: Applications/Shells
32 Requires: %{name} = %{version}-%{release}
33 Requires: bash-completion >= 2.0
36 %description -n bash-completion-zoxide
37 This package provides bash-completion for zoxide.
39 %package -n fish-completion-zoxide
40 Summary: Fish completion for zoxide command
41 Group: Applications/Shells
42 Requires: %{name} = %{version}-%{release}
46 %description -n fish-completion-zoxide
47 Fish completion for zoxide command.
49 %package -n zsh-completion-zoxide
50 Summary: Zsh completion for zoxide command
51 Group: Applications/Shells
52 Requires: %{name} = %{version}-%{release}
56 %description -n zsh-completion-zoxide
57 Zsh completion for zoxide command.
62 %{__mv} zoxide-%{crates_ver}/* .
63 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
65 # use our offline registry
66 export CARGO_HOME="$(pwd)/.cargo"
68 mkdir -p "$CARGO_HOME"
69 cat >.cargo/config <<EOF
71 registry = 'https://github.com/rust-lang/crates.io-index'
72 replace-with = 'vendored-sources'
74 [source.vendored-sources]
75 directory = '$PWD/vendor'
79 export CARGO_HOME="$(pwd)/.cargo"
84 rm -rf $RPM_BUILD_ROOT
85 export CARGO_HOME="$(pwd)/.cargo"
87 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
88 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
90 install -Dp contrib/completions/zoxide.bash $RPM_BUILD_ROOT%{bash_compdir}/zoxide
91 install -Dp contrib/completions/zoxide.fish $RPM_BUILD_ROOT%{fish_compdir}/zoxide.fish
92 install -Dp contrib/completions/_zoxide $RPM_BUILD_ROOT%{zsh_compdir}/_zoxide
95 rm -rf $RPM_BUILD_ROOT
98 %defattr(644,root,root,755)
99 %doc CHANGELOG.md README.md
100 %attr(755,root,root) %{_bindir}/zoxide
102 %files -n bash-completion-zoxide
103 %defattr(644,root,root,755)
104 %{bash_compdir}/zoxide
106 %files -n fish-completion-%{name}
107 %defattr(644,root,root,755)
108 %{fish_compdir}/zoxide.fish
110 %files -n zsh-completion-%{name}
111 %defattr(644,root,root,755)
112 %{zsh_compdir}/_zoxide