2 # - package vendored modules
5 %define fzfvimrev 9ceac71
6 %define fzfgitrev a48b941
7 %define vendor_version 0.34.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: c944fc51ba24f73ecc44bf240f374001
21 # tar cJf fzf-vendor-%{version}.tar.xz fzf-%{version}/vendor
22 Source1: %{name}-vendor-%{vendor_version}.tar.xz
23 # Source1-md5: cd1672b3da7985ddc0709862274a007f
24 Source2: https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
25 # Source2-md5: cf33165a5e500c85838fa994683b2e5d
26 Source3: https://github.com/junegunn/fzf-git.sh/archive/%{fzfgitrev}/fzf-git.sh-%{fzfgitrev}.tar.gz
27 # Source3-md5: 672c3efba11c015c5d282562553eac07
28 Patch0: fzf-git-awk.patch
30 URL: https://github.com/junegunn/fzf
31 BuildRequires: golang >= 1.13
32 BuildRequires: rpm-build >= 4.6
33 BuildRequires: rpmbuild(macros) >= 2.009
34 BuildRequires: sed >= 4.0
35 BuildRequires: tar >= 1:1.22
37 ExclusiveArch: %go_arches
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define _debugsource_packages 0
43 fzf is a general-purpose command-line fuzzy finder.
45 It's an interactive Unix filter for command-line that can be used with
46 any list; files, command history, processes, hostnames, bookmarks, git
50 Summary: Script for starting fzf in tmux pane
51 Requires: %{name} = %{version}-%{release}
57 Script for starting fzf in tmux pane.
59 %package -n bash-completion-fzf
60 Summary: bash-completion for fzf
61 Group: Applications/Shells
62 Requires: %{name} = %{version}-%{release}
63 Requires: bash-completion >= 1:2.0
66 %description -n bash-completion-fzf
67 bash-completion for fzf.
69 %package -n zsh-completion-fzf
70 Summary: zsh-completion for fzf
71 Group: Applications/Shells
72 Requires: %{name} = %{version}-%{release}
76 %description -n zsh-completion-fzf
77 zsh-completion for fzf.
80 Summary: bash and zsh key bindings for Git objects, powered by fzf
81 Group: Applications/Shells
82 Requires: %{name}-tmux
92 bash and zsh key bindings for Git objects, powered by fzf.
94 %package -n vim-plugin-fzf
95 Summary: fzf integration for Vim
96 Group: Applications/Editors/Vim
97 Requires: %{name} >= 0.23.0
102 Suggests: the_silver_searcher
105 %description -n vim-plugin-fzf
106 fzf integration for Vim.
108 %package -n vim-plugin-fzf-doc
109 Summary: Documentation for fzf Vim plugin
110 Group: Applications/Editors/Vim
111 Requires: vim-plugin-fzf = %{version}-%{release}
115 %description -n vim-plugin-fzf-doc
116 Documentation for fzf Vim plugin.
119 %setup -q -a1 -a2 -a3
120 %{__mv} fzf-%{vendor_version}/vendor .
121 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
122 %{__mv} fzf-git.sh-%{fzfgitrev}* fzf-git
127 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
128 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux install
129 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
131 %{__mkdir_p} .go-cache
134 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
137 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
140 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
142 install -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
143 install -p install $RPM_BUILD_ROOT%{_bindir}/fzf-install
144 install -p bin/fzf-tmux $RPM_BUILD_ROOT%{_bindir}/fzf-tmux
145 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
146 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
147 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
148 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
149 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
150 cp -p fzf-git/fzf-git.sh $RPM_BUILD_ROOT%{_datadir}/fzf
151 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
152 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
153 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
154 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
155 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
158 rm -rf $RPM_BUILD_ROOT
161 %banner -o -e %{name} <<EOF
163 To install useful keybindings and fuzzy completion:
167 %post -n vim-plugin-fzf-doc
170 %postun -n vim-plugin-fzf-doc
174 %defattr(644,root,root,755)
175 %doc BUILD.md CHANGELOG.md README.md
176 %attr(755,root,root) %{_bindir}/fzf
177 %attr(755,root,root) %{_bindir}/fzf-install
179 %{_mandir}/man1/fzf.1*
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{_bindir}/fzf-tmux
185 %files -n bash-completion-fzf
186 %defattr(644,root,root,755)
187 %{_datadir}/fzf/completion.bash
188 %{_datadir}/fzf/key-bindings.bash
190 %files -n zsh-completion-fzf
191 %defattr(644,root,root,755)
192 %{_datadir}/fzf/completion.zsh
193 %{_datadir}/fzf/key-bindings.zsh
196 %defattr(644,root,root,755)
197 %doc fzf-git/README.md
198 %{_datadir}/fzf/fzf-git.sh
200 %files -n vim-plugin-fzf
201 %defattr(644,root,root,755)
202 %doc README-VIM.md fzf.vim/README.md
203 %dir %{_datadir}/fzf/vim
204 %dir %{_datadir}/fzf/vim/bin
205 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
206 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
207 %{_datadir}/vim/autoload/fzf
208 %{_datadir}/vim/plugin/fzf.vim
209 %{_datadir}/vim/plugin/fzf
211 %files -n vim-plugin-fzf-doc
212 %defattr(644,root,root,755)
213 %{_datadir}/vim/doc/fzf.txt