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: rpm-build >= 4.6
17 BuildRequires: rpmbuild(macros) >= 2.004
19 BuildRequires: tar >= 1:1.22
21 ExclusiveArch: %{rust_arches}
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 zoxide is a blazing fast replacement for your cd command, inspired by
26 z and z.lua. It keeps track of the directories you use most
27 frequently, and uses a ranking algorithm to navigate to the best
30 %package -n bash-completion-zoxide
31 Summary: bash-completion for zoxide
32 Group: Applications/Shells
33 Requires: %{name} = %{version}-%{release}
34 Requires: bash-completion >= 2.0
37 %description -n bash-completion-zoxide
38 This package provides bash-completion for zoxide.
40 %package -n fish-completion-zoxide
41 Summary: Fish completion for zoxide command
42 Group: Applications/Shells
43 Requires: %{name} = %{version}-%{release}
47 %description -n fish-completion-zoxide
48 Fish completion for zoxide command.
50 %package -n zsh-completion-zoxide
51 Summary: Zsh completion for zoxide command
52 Group: Applications/Shells
53 Requires: %{name} = %{version}-%{release}
57 %description -n zsh-completion-zoxide
58 Zsh completion for zoxide command.
63 %{__mv} zoxide-%{crates_ver}/* .
64 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
66 # use our offline registry
67 export CARGO_HOME="$(pwd)/.cargo"
69 mkdir -p "$CARGO_HOME"
70 cat >.cargo/config <<EOF
72 registry = 'https://github.com/rust-lang/crates.io-index'
73 replace-with = 'vendored-sources'
75 [source.vendored-sources]
76 directory = '$PWD/vendor'
80 export CARGO_HOME="$(pwd)/.cargo"
85 rm -rf $RPM_BUILD_ROOT
86 export CARGO_HOME="$(pwd)/.cargo"
88 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
89 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
91 install -Dp contrib/completions/zoxide.bash $RPM_BUILD_ROOT%{bash_compdir}/zoxide
92 install -Dp contrib/completions/zoxide.fish $RPM_BUILD_ROOT%{fish_compdir}/zoxide.fish
93 install -Dp contrib/completions/_zoxide $RPM_BUILD_ROOT%{zsh_compdir}/_zoxide
96 rm -rf $RPM_BUILD_ROOT
99 %defattr(644,root,root,755)
100 %doc CHANGELOG.md README.md
101 %attr(755,root,root) %{_bindir}/zoxide
103 %files -n bash-completion-zoxide
104 %defattr(644,root,root,755)
105 %{bash_compdir}/zoxide
107 %files -n fish-completion-%{name}
108 %defattr(644,root,root,755)
109 %{fish_compdir}/zoxide.fish
111 %files -n zsh-completion-%{name}
112 %defattr(644,root,root,755)
113 %{zsh_compdir}/_zoxide