2 # - package vendored modules
5 %define fzfvimrev 45d96c9
6 %define fzfgitrev 0f1e520
7 %define vendor_version 0.50.0
9 Summary: A command-line fuzzy finder written in Go
14 Group: Applications/Shells
15 #Source0Download: https://github.com/junegunn/fzf/releases
16 Source0: https://github.com/junegunn/fzf/archive/%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: f28cc1f1c2efc11e7bdd04f35f5de140
21 # tar cJf fzf-vendor-%{version}.tar.xz fzf-%{version}/vendor
22 Source1: %{name}-vendor-%{vendor_version}.tar.xz
23 # Source1-md5: 0c83c8f39c87d59b2cfa51d04d4652e0
24 Source2: https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
25 # Source2-md5: 38bb6348e6e458ab774c4801906f2fcf
26 Source3: https://github.com/junegunn/fzf-git.sh/archive/%{fzfgitrev}/fzf-git.sh-%{fzfgitrev}.tar.gz
27 # Source3-md5: d9017fad9fe2b5adeffed27860456c58
29 URL: https://github.com/junegunn/fzf
30 BuildRequires: golang >= 1.20
31 BuildRequires: rpm-build >= 4.6
32 BuildRequires: rpmbuild(macros) >= 2.009
33 BuildRequires: sed >= 4.0
34 BuildRequires: tar >= 1:1.22
36 ExclusiveArch: %go_arches
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define _debugsource_packages 0
42 fzf is a general-purpose command-line fuzzy finder.
44 It's an interactive Unix filter for command-line that can be used with
45 any list; files, command history, processes, hostnames, bookmarks, git
49 Summary: Script for starting fzf in tmux pane
50 Requires: %{name} = %{version}-%{release}
56 Script for starting fzf in tmux pane.
58 %package -n bash-completion-fzf
59 Summary: bash-completion for fzf
60 Group: Applications/Shells
61 Requires: %{name} = %{version}-%{release}
62 Requires: bash-completion >= 1:2.0
65 %description -n bash-completion-fzf
66 bash-completion for fzf.
68 %package -n zsh-completion-fzf
69 Summary: zsh-completion for fzf
70 Group: Applications/Shells
71 Requires: %{name} = %{version}-%{release}
75 %description -n zsh-completion-fzf
76 zsh-completion for fzf.
79 Summary: bash and zsh key bindings for Git objects, powered by fzf
80 Group: Applications/Shells
81 Requires: %{name}-tmux
91 bash and zsh key bindings for Git objects, powered by fzf.
93 %package -n vim-plugin-fzf
94 Summary: fzf integration for Vim
95 Group: Applications/Editors/Vim
96 Requires: %{name} >= 0.23.0
101 Suggests: the_silver_searcher
104 %description -n vim-plugin-fzf
105 fzf integration for Vim.
107 %package -n vim-plugin-fzf-doc
108 Summary: Documentation for fzf Vim plugin
109 Group: Applications/Editors/Vim
110 Requires: vim-plugin-fzf = %{version}-%{release}
114 %description -n vim-plugin-fzf-doc
115 Documentation for fzf Vim plugin.
118 %setup -q -a1 -a2 -a3
119 %{__mv} fzf-%{vendor_version}/vendor .
120 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
121 %{__mv} fzf-git.sh-%{fzfgitrev}* fzf-git
123 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
124 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux install
125 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
127 %{__mkdir_p} .go-cache
130 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
133 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
136 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
138 install -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
139 install -p install $RPM_BUILD_ROOT%{_bindir}/fzf-install
140 install -p bin/fzf-tmux $RPM_BUILD_ROOT%{_bindir}/fzf-tmux
141 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
142 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
143 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
144 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
145 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
146 cp -p fzf-git/fzf-git.sh $RPM_BUILD_ROOT%{_datadir}/fzf
147 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
148 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
149 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
150 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
151 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
154 rm -rf $RPM_BUILD_ROOT
157 %banner -o -e %{name} <<EOF
159 To install useful keybindings and fuzzy completion:
163 %post -n vim-plugin-fzf-doc
166 %postun -n vim-plugin-fzf-doc
170 %defattr(644,root,root,755)
171 %doc BUILD.md CHANGELOG.md README.md
172 %attr(755,root,root) %{_bindir}/fzf
173 %attr(755,root,root) %{_bindir}/fzf-install
175 %{_mandir}/man1/fzf.1*
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_bindir}/fzf-tmux
181 %files -n bash-completion-fzf
182 %defattr(644,root,root,755)
183 %{_datadir}/fzf/completion.bash
184 %{_datadir}/fzf/key-bindings.bash
186 %files -n zsh-completion-fzf
187 %defattr(644,root,root,755)
188 %{_datadir}/fzf/completion.zsh
189 %{_datadir}/fzf/key-bindings.zsh
192 %defattr(644,root,root,755)
193 %doc fzf-git/README.md
194 %{_datadir}/fzf/fzf-git.sh
196 %files -n vim-plugin-fzf
197 %defattr(644,root,root,755)
198 %doc README-VIM.md fzf.vim/README.md
199 %dir %{_datadir}/fzf/vim
200 %dir %{_datadir}/fzf/vim/bin
201 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
202 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
203 %{_datadir}/vim/autoload/fzf
204 %{_datadir}/vim/plugin/fzf.vim
205 %{_datadir}/vim/plugin/fzf
207 %files -n vim-plugin-fzf-doc
208 %defattr(644,root,root,755)
209 %{_datadir}/vim/doc/fzf.txt