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
29 URL: https://github.com/junegunn/fzf
30 BuildRequires: golang >= 1.13
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
125 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
126 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux
127 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
129 %{__mkdir_p} .go-cache
132 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
135 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
138 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
140 cp -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
141 cp -p bin/fzf-tmux $RPM_BUILD_ROOT%{_bindir}/fzf-tmux
142 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
143 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
144 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
145 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
146 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
147 cp -p fzf-git/fzf-git.sh $RPM_BUILD_ROOT%{_datadir}/fzf
148 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
149 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
150 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
151 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
152 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
155 rm -rf $RPM_BUILD_ROOT
157 %post -n vim-plugin-fzf-doc
160 %postun -n vim-plugin-fzf-doc
164 %defattr(644,root,root,755)
165 %doc BUILD.md CHANGELOG.md README.md
166 %attr(755,root,root) %{_bindir}/fzf
168 %{_mandir}/man1/fzf.1*
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_bindir}/fzf-tmux
174 %files -n bash-completion-fzf
175 %defattr(644,root,root,755)
176 %{_datadir}/fzf/completion.bash
177 %{_datadir}/fzf/key-bindings.bash
179 %files -n zsh-completion-fzf
180 %defattr(644,root,root,755)
181 %{_datadir}/fzf/completion.zsh
182 %{_datadir}/fzf/key-bindings.zsh
185 %defattr(644,root,root,755)
186 %doc fzf-git/README.md
187 %{_datadir}/fzf/fzf-git.sh
189 %files -n vim-plugin-fzf
190 %defattr(644,root,root,755)
191 %doc README-VIM.md fzf.vim/README.md
192 %dir %{_datadir}/fzf/vim
193 %dir %{_datadir}/fzf/vim/bin
194 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
195 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
196 %{_datadir}/vim/autoload/fzf
197 %{_datadir}/vim/plugin/fzf.vim
198 %{_datadir}/vim/plugin/fzf
200 %files -n vim-plugin-fzf-doc
201 %defattr(644,root,root,755)
202 %{_datadir}/vim/doc/fzf.txt