]> git.pld-linux.org Git - packages/zoxide.git/blame - zoxide.spec
rpm version for noarch subpackage
[packages/zoxide.git] / zoxide.spec
CommitLineData
42412a30 1%define crates_ver 0.8.0
0dc3cd0e
JP
2
3Summary: A smarter cd command
4Name: zoxide
42412a30 5Version: 0.8.0
0dc3cd0e
JP
6Release: 1
7License: MIT
8Group: Applications
9Source0: https://github.com/ajeetdsouza/zoxide/archive/v%{version}/%{name}-%{version}.tar.gz
42412a30 10# Source0-md5: 6783966c8e57061bc3f1d0579410f88d
0dc3cd0e
JP
11# ./create-crates.sh
12Source1: %{name}-crates-%{crates_ver}.tar.xz
42412a30 13# Source1-md5: 2850666699cb60867f03368f608988ee
0dc3cd0e
JP
14URL: https://github.com/ajeetdsouza/zoxide
15BuildRequires: cargo
457b22e0 16BuildRequires: rpm-build >= 4.6
0dc3cd0e
JP
17BuildRequires: rpmbuild(macros) >= 2.004
18BuildRequires: rust
19BuildRequires: tar >= 1:1.22
20BuildRequires: xz
21ExclusiveArch: %{rust_arches}
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%description
25zoxide is a blazing fast replacement for your cd command, inspired by
26z and z.lua. It keeps track of the directories you use most
27frequently, and uses a ranking algorithm to navigate to the best
28match.
29
30%package -n bash-completion-zoxide
31Summary: bash-completion for zoxide
32Group: Applications/Shells
33Requires: %{name} = %{version}-%{release}
34Requires: bash-completion >= 2.0
35BuildArch: noarch
36
37%description -n bash-completion-zoxide
38This package provides bash-completion for zoxide.
39
40%package -n fish-completion-zoxide
41Summary: Fish completion for zoxide command
42Group: Applications/Shells
43Requires: %{name} = %{version}-%{release}
44Requires: fish
45BuildArch: noarch
46
47%description -n fish-completion-zoxide
48Fish completion for zoxide command.
49
50%package -n zsh-completion-zoxide
51Summary: Zsh completion for zoxide command
52Group: Applications/Shells
53Requires: %{name} = %{version}-%{release}
54Requires: zsh
55BuildArch: noarch
56
57%description -n zsh-completion-zoxide
58Zsh completion for zoxide command.
59
60%prep
61%setup -q -a1
62
63%{__mv} zoxide-%{crates_ver}/* .
64sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
65
66# use our offline registry
67export CARGO_HOME="$(pwd)/.cargo"
68
69mkdir -p "$CARGO_HOME"
70cat >.cargo/config <<EOF
71[source.crates-io]
72registry = 'https://github.com/rust-lang/crates.io-index'
73replace-with = 'vendored-sources'
74
75[source.vendored-sources]
76directory = '$PWD/vendor'
77EOF
78
79%build
80export CARGO_HOME="$(pwd)/.cargo"
81
82%cargo_build --frozen
83
84%install
85rm -rf $RPM_BUILD_ROOT
86export CARGO_HOME="$(pwd)/.cargo"
87
88%cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
89%{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
90
91install -Dp contrib/completions/zoxide.bash $RPM_BUILD_ROOT%{bash_compdir}/zoxide
92install -Dp contrib/completions/zoxide.fish $RPM_BUILD_ROOT%{fish_compdir}/zoxide.fish
93install -Dp contrib/completions/_zoxide $RPM_BUILD_ROOT%{zsh_compdir}/_zoxide
94
95%clean
96rm -rf $RPM_BUILD_ROOT
97
98%files
99%defattr(644,root,root,755)
100%doc CHANGELOG.md README.md
101%attr(755,root,root) %{_bindir}/zoxide
102
103%files -n bash-completion-zoxide
104%defattr(644,root,root,755)
105%{bash_compdir}/zoxide
106
107%files -n fish-completion-%{name}
108%defattr(644,root,root,755)
109%{fish_compdir}/zoxide.fish
110
111%files -n zsh-completion-%{name}
112%defattr(644,root,root,755)
113%{zsh_compdir}/_zoxide
This page took 0.146273 seconds and 4 git commands to generate.