]> git.pld-linux.org Git - packages/fzf.git/blob - fzf.spec
package fzf-tmux
[packages/fzf.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3
4 %define         fzfrev          04d0b02
5 %define         fzfvimrev       9ceac71
6 %define         vendor_version  0.34.0
7
8 Summary:        A command-line fuzzy finder written in Go
9 Name:           fzf
10 Version:        0.34.0
11 Release:        1
12 License:        MIT
13 Group:          Applications/Shells
14 #Source0Download: https://github.com/junegunn/fzf/releases
15 Source0:        https://github.com/junegunn/fzf/archive/%{version}/%{name}-%{version}.tar.gz
16 # Source0-md5:  c944fc51ba24f73ecc44bf240f374001
17 # cd fzf-%{version}
18 # go mod vendor
19 # cd ..
20 # tar cJf fzf-vendor-%{version}.tar.xz fzf-%{version}/vendor
21 Source1:        %{name}-vendor-%{vendor_version}.tar.xz
22 # Source1-md5:  cd1672b3da7985ddc0709862274a007f
23 Source2:        https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
24 # Source2-md5:  cf33165a5e500c85838fa994683b2e5d
25 URL:            https://github.com/junegunn/fzf
26 BuildRequires:  golang >= 1.13
27 BuildRequires:  rpm-build >= 4.6
28 BuildRequires:  rpmbuild(macros) >= 2.009
29 BuildRequires:  sed >= 4.0
30 BuildRequires:  tar >= 1:1.22
31 BuildRequires:  xz
32 ExclusiveArch:  %go_arches
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _debugsource_packages   0
36
37 %description
38 fzf is a general-purpose command-line fuzzy finder.
39
40 It's an interactive Unix filter for command-line that can be used with
41 any list; files, command history, processes, hostnames, bookmarks, git
42 commits, etc.
43
44 %package tmux
45 Summary:        Script for starting fzf in tmux pane
46 Requires:       %{name} = %{version}-%{release}
47 Requires:       coreutils
48 Requires:       tmux
49 BuildArch:      noarch
50
51 %description tmux
52 Script for starting fzf in tmux pane.
53
54 %package -n bash-completion-fzf
55 Summary:        bash-completion for fzf
56 Group:          Applications/Shells
57 Requires:       %{name} = %{version}-%{release}
58 Requires:       bash-completion >= 1:2.0
59 BuildArch:      noarch
60
61 %description -n bash-completion-fzf
62 bash-completion for fzf.
63
64 %package -n zsh-completion-fzf
65 Summary:        zsh-completion for fzf
66 Group:          Applications/Shells
67 Requires:       %{name} = %{version}-%{release}
68 Requires:       zsh
69 BuildArch:      noarch
70
71 %description -n zsh-completion-fzf
72 zsh-completion for fzf.
73
74 %package -n vim-plugin-fzf
75 Summary:        fzf integration for Vim
76 Group:          Applications/Editors/Vim
77 Requires:       %{name} >= 0.23.0
78 Requires:       file
79 Requires:       vim-rt
80 Suggests:       highlight
81 Suggests:       ripgrep
82 Suggests:       the_silver_searcher
83 BuildArch:      noarch
84
85 %description -n vim-plugin-fzf
86 fzf integration for Vim.
87
88 %package -n vim-plugin-fzf-doc
89 Summary:        Documentation for fzf Vim plugin
90 Group:          Applications/Editors/Vim
91 Requires:       vim-plugin-fzf = %{version}-%{release}
92 Requires:       vim-rt
93 BuildArch:      noarch
94
95 %description -n vim-plugin-fzf-doc
96 Documentation for fzf Vim plugin.
97
98 %prep
99 %setup -q -a1 -a2
100 %{__mv} fzf-%{vendor_version}/vendor .
101 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
102 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
103 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux
104 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
105
106 %{__mkdir_p} .go-cache
107
108 %build
109 %__go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
115 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
116
117 cp -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
118 cp -p bin/fzf-tmux $RPM_BUILD_ROOT%{_bindir}/fzf-tmux
119 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
120 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
121 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
122 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
123 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
124 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
125 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
126 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
127 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
128 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %post -n vim-plugin-fzf-doc
134 %vim_doc_helptags
135
136 %postun -n vim-plugin-fzf-doc
137 %vim_doc_helptags
138
139 %files
140 %defattr(644,root,root,755)
141 %doc BUILD.md CHANGELOG.md README.md
142 %attr(755,root,root) %{_bindir}/fzf
143 %dir %{_datadir}/fzf
144 %{_mandir}/man1/fzf.1*
145
146 %files tmux
147 %defattr(644,root,root,755)
148 %attr(755,root,root) %{_bindir}/fzf-tmux
149
150 %files -n bash-completion-fzf
151 %defattr(644,root,root,755)
152 %{_datadir}/fzf/completion.bash
153 %{_datadir}/fzf/key-bindings.bash
154
155 %files -n zsh-completion-fzf
156 %defattr(644,root,root,755)
157 %{_datadir}/fzf/completion.zsh
158 %{_datadir}/fzf/key-bindings.zsh
159
160 %files -n vim-plugin-fzf
161 %defattr(644,root,root,755)
162 %doc README-VIM.md fzf.vim/README.md
163 %dir %{_datadir}/fzf/vim
164 %dir %{_datadir}/fzf/vim/bin
165 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
166 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
167 %{_datadir}/vim/autoload/fzf
168 %{_datadir}/vim/plugin/fzf.vim
169 %{_datadir}/vim/plugin/fzf
170
171 %files -n vim-plugin-fzf-doc
172 %defattr(644,root,root,755)
173 %{_datadir}/vim/doc/fzf.txt
This page took 0.054065 seconds and 4 git commands to generate.