]> git.pld-linux.org Git - packages/fzf.git/blob - fzf.spec
f65f6cf45a9f710a6c46e11b531eb8d2e623c10c
[packages/fzf.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3
4 %define         fzfrev          04d0b02
5 %define         fzfvimrev       9ceac71
6 %define         fzfgitrev       a48b941
7 %define         vendor_version  0.34.0
8
9 Summary:        A command-line fuzzy finder written in Go
10 Name:           fzf
11 Version:        0.34.0
12 Release:        1
13 License:        MIT
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
18 # cd fzf-%{version}
19 # go mod vendor
20 # cd ..
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 Patch1:         install.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
36 BuildRequires:  xz
37 ExclusiveArch:  %go_arches
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %define         _debugsource_packages   0
41
42 %description
43 fzf is a general-purpose command-line fuzzy finder.
44
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
47 commits, etc.
48
49 %package tmux
50 Summary:        Script for starting fzf in tmux pane
51 Requires:       %{name} = %{version}-%{release}
52 Requires:       coreutils
53 Requires:       tmux
54 BuildArch:      noarch
55
56 %description tmux
57 Script for starting fzf in tmux pane.
58
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
64 BuildArch:      noarch
65
66 %description -n bash-completion-fzf
67 bash-completion for fzf.
68
69 %package -n zsh-completion-fzf
70 Summary:        zsh-completion for fzf
71 Group:          Applications/Shells
72 Requires:       %{name} = %{version}-%{release}
73 Requires:       zsh
74 BuildArch:      noarch
75
76 %description -n zsh-completion-fzf
77 zsh-completion for fzf.
78
79 %package git-sh
80 Summary:        bash and zsh key bindings for Git objects, powered by fzf
81 Group:          Applications/Shells
82 Requires:       %{name}-tmux
83 Requires:       awk
84 Requires:       coreutils
85 Requires:       git-core
86 Requires:       grep
87 Requires:       sed
88 Suggests:       xdg-utils
89 BuildArch:      noarch
90
91 %description git-sh
92 bash and zsh key bindings for Git objects, powered by fzf.
93
94 %package -n vim-plugin-fzf
95 Summary:        fzf integration for Vim
96 Group:          Applications/Editors/Vim
97 Requires:       %{name} >= 0.23.0
98 Requires:       file
99 Requires:       vim-rt
100 Suggests:       highlight
101 Suggests:       ripgrep
102 Suggests:       the_silver_searcher
103 BuildArch:      noarch
104
105 %description -n vim-plugin-fzf
106 fzf integration for Vim.
107
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}
112 Requires:       vim-rt
113 BuildArch:      noarch
114
115 %description -n vim-plugin-fzf-doc
116 Documentation for fzf Vim plugin.
117
118 %prep
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
123 cd fzf-git
124 %patch0
125 cd ..
126 %patch1 -p1
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
130
131 %{__mkdir_p} .go-cache
132
133 %build
134 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
135
136 %install
137 rm -rf $RPM_BUILD_ROOT
138
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}
141
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
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post
161 %banner -o -e %{name} <<EOF
162 ==> Caveats
163 To install useful keybindings and fuzzy completion:
164   fzf-install
165 EOF
166
167 %post -n vim-plugin-fzf-doc
168 %vim_doc_helptags
169
170 %postun -n vim-plugin-fzf-doc
171 %vim_doc_helptags
172
173 %files
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
178 %dir %{_datadir}/fzf
179 %{_mandir}/man1/fzf.1*
180
181 %files tmux
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{_bindir}/fzf-tmux
184
185 %files -n bash-completion-fzf
186 %defattr(644,root,root,755)
187 %{_datadir}/fzf/completion.bash
188 %{_datadir}/fzf/key-bindings.bash
189
190 %files -n zsh-completion-fzf
191 %defattr(644,root,root,755)
192 %{_datadir}/fzf/completion.zsh
193 %{_datadir}/fzf/key-bindings.zsh
194
195 %files git-sh
196 %defattr(644,root,root,755)
197 %doc fzf-git/README.md
198 %{_datadir}/fzf/fzf-git.sh
199
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
210
211 %files -n vim-plugin-fzf-doc
212 %defattr(644,root,root,755)
213 %{_datadir}/vim/doc/fzf.txt
This page took 0.064382 seconds and 2 git commands to generate.