]> git.pld-linux.org Git - packages/fzf.git/blob - fzf.spec
up to 0.50.0
[packages/fzf.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3
4 %define         fzfrev          f97d275
5 %define         fzfvimrev       45d96c9
6 %define         fzfgitrev       0f1e520
7 %define         vendor_version  0.50.0
8
9 Summary:        A command-line fuzzy finder written in Go
10 Name:           fzf
11 Version:        0.50.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:  f28cc1f1c2efc11e7bdd04f35f5de140
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:  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
28 Patch0:         install.patch
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
35 BuildRequires:  xz
36 ExclusiveArch:  %go_arches
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         _debugsource_packages   0
40
41 %description
42 fzf is a general-purpose command-line fuzzy finder.
43
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
46 commits, etc.
47
48 %package tmux
49 Summary:        Script for starting fzf in tmux pane
50 Requires:       %{name} = %{version}-%{release}
51 Requires:       coreutils
52 Requires:       tmux
53 BuildArch:      noarch
54
55 %description tmux
56 Script for starting fzf in tmux pane.
57
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
63 BuildArch:      noarch
64
65 %description -n bash-completion-fzf
66 bash-completion for fzf.
67
68 %package -n zsh-completion-fzf
69 Summary:        zsh-completion for fzf
70 Group:          Applications/Shells
71 Requires:       %{name} = %{version}-%{release}
72 Requires:       zsh
73 BuildArch:      noarch
74
75 %description -n zsh-completion-fzf
76 zsh-completion for fzf.
77
78 %package git-sh
79 Summary:        bash and zsh key bindings for Git objects, powered by fzf
80 Group:          Applications/Shells
81 Requires:       %{name}-tmux
82 Requires:       awk
83 Requires:       coreutils
84 Requires:       git-core
85 Requires:       grep
86 Requires:       sed
87 Suggests:       xdg-utils
88 BuildArch:      noarch
89
90 %description git-sh
91 bash and zsh key bindings for Git objects, powered by fzf.
92
93 %package -n vim-plugin-fzf
94 Summary:        fzf integration for Vim
95 Group:          Applications/Editors/Vim
96 Requires:       %{name} >= 0.23.0
97 Requires:       file
98 Requires:       vim-rt
99 Suggests:       highlight
100 Suggests:       ripgrep
101 Suggests:       the_silver_searcher
102 BuildArch:      noarch
103
104 %description -n vim-plugin-fzf
105 fzf integration for Vim.
106
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}
111 Requires:       vim-rt
112 BuildArch:      noarch
113
114 %description -n vim-plugin-fzf-doc
115 Documentation for fzf Vim plugin.
116
117 %prep
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
122 %patch0 -p1
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
126
127 %{__mkdir_p} .go-cache
128
129 %build
130 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
131
132 %install
133 rm -rf $RPM_BUILD_ROOT
134
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}
137
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
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %post
157 %banner -o -e %{name} <<EOF
158 ==> Caveats
159 To install useful keybindings and fuzzy completion:
160   fzf-install
161 EOF
162
163 %post -n vim-plugin-fzf-doc
164 %vim_doc_helptags
165
166 %postun -n vim-plugin-fzf-doc
167 %vim_doc_helptags
168
169 %files
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
174 %dir %{_datadir}/fzf
175 %{_mandir}/man1/fzf.1*
176
177 %files tmux
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_bindir}/fzf-tmux
180
181 %files -n bash-completion-fzf
182 %defattr(644,root,root,755)
183 %{_datadir}/fzf/completion.bash
184 %{_datadir}/fzf/key-bindings.bash
185
186 %files -n zsh-completion-fzf
187 %defattr(644,root,root,755)
188 %{_datadir}/fzf/completion.zsh
189 %{_datadir}/fzf/key-bindings.zsh
190
191 %files git-sh
192 %defattr(644,root,root,755)
193 %doc fzf-git/README.md
194 %{_datadir}/fzf/fzf-git.sh
195
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
206
207 %files -n vim-plugin-fzf-doc
208 %defattr(644,root,root,755)
209 %{_datadir}/vim/doc/fzf.txt
This page took 0.115023 seconds and 4 git commands to generate.