]> git.pld-linux.org Git - packages/fzf.git/blob - fzf.spec
69fe64bdb0e71c9da78284c4b2650a2c9e3249dc
[packages/fzf.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3 # - package fzf-tmux
4
5 %define         fzfrev           e3e76fa
6 %define         fzfvimrev        61c4b6d
7
8 Summary:        A command-line fuzzy finder written in Go
9 Name:           fzf
10 Version:        0.24.2
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:  e64eedd48032e2577b79bde356c3df9a
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-%{version}.tar.xz
22 # Source1-md5:  25a45d385d0cbdd7f59dc5441b994624
23 Source2:        https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
24 # Source2-md5:  58fb5134601d7e964c9cf35d5f47eb67
25 URL:            https://github.com/junegunn/fzf
26 BuildRequires:  golang >= 1.13
27 BuildRequires:  sed >= 4.0
28 ExclusiveArch:  %{x8664} armv5l armv6l armv7l armv8l aarch64 ppc64le
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 fzf is a general-purpose command-line fuzzy finder.
33
34 It's an interactive Unix filter for command-line that can be used with
35 any list; files, command history, processes, hostnames, bookmarks, git
36 commits, etc.
37
38 %package -n bash-completion-fzf
39 Summary:        bash-completion for fzf
40 Group:          Applications/Shells
41 Requires:       %{name} = %{version}-%{release}
42 Requires:       bash-completion >= 2.0
43 %if "%{_rpmversion}" >= "4.6"
44 BuildArch:      noarch
45 %endif
46
47 %description -n bash-completion-fzf
48 bash-completion for fzf.
49
50 %package -n zsh-completion-fzf
51 Summary:        zsh-completion for fzf
52 Group:          Applications/Shells
53 Requires:       %{name} = %{version}-%{release}
54 Requires:       zsh
55 %if "%{_rpmversion}" >= "4.6"
56 BuildArch:      noarch
57 %endif
58
59 %description -n zsh-completion-fzf
60 zsh-completion for fzf.
61
62 %package -n vim-plugin-fzf
63 Summary:        fzf integration for Vim
64 Group:          Applications/Editors/Vim
65 Requires:       %{name} >= 0.23.0
66 Requires:       file
67 Requires:       vim-rt
68 Suggests:       highlight
69 Suggests:       the_silver_searcher
70 %if "%{_rpmversion}" >= "4.6"
71 BuildArch:      noarch
72 %endif
73
74 %description -n vim-plugin-fzf
75 fzf integration for Vim.
76
77 %package -n vim-plugin-fzf-doc
78 Summary:        Documentation for fzf Vim plugin
79 Group:          Applications/Editors/Vim
80 Requires:       vim-plugin-fzf = %{version}-%{release}
81 Requires:       vim-rt
82 %if "%{_rpmversion}" >= "4.6"
83 BuildArch:      noarch
84 %endif
85
86 %description -n vim-plugin-fzf-doc
87 Documentation for fzf Vim plugin.
88
89 %prep
90 %setup -q -b1 -a2
91 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
92 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
93 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh
94 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
95
96 %build
97 %{__make} FZF_VERSION=%{version} FZF_REVISION=%{fzfrev} GOFLAGS=-mod=vendor
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101
102 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
103 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
104
105 cp -p target/fzf-linux* $RPM_BUILD_ROOT%{_bindir}/fzf
106 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
107 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
108 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
109 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
110 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
111 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
112 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
113 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
114 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
115 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %post -n vim-plugin-fzf-doc
121 %vim_doc_helptags
122
123 %postun -n vim-plugin-fzf-doc
124 %vim_doc_helptags
125
126 %files
127 %defattr(644,root,root,755)
128 %doc BUILD.md CHANGELOG.md README.md
129 %attr(755,root,root) %{_bindir}/fzf
130 %dir %{_datadir}/fzf
131 %{_mandir}/man1/fzf.1*
132
133 %files -n bash-completion-fzf
134 %defattr(644,root,root,755)
135 %{_datadir}/fzf/completion.bash
136 %{_datadir}/fzf/key-bindings.bash
137
138 %files -n zsh-completion-fzf
139 %defattr(644,root,root,755)
140 %{_datadir}/fzf/completion.zsh
141 %{_datadir}/fzf/key-bindings.zsh
142
143 %files -n vim-plugin-fzf
144 %defattr(644,root,root,755)
145 %doc README-VIM.md fzf.vim/README.md
146 %dir %{_datadir}/fzf/vim
147 %dir %{_datadir}/fzf/vim/bin
148 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
149 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
150 %{_datadir}/vim/autoload/fzf
151 %{_datadir}/vim/plugin/fzf.vim
152 %{_datadir}/vim/plugin/fzf
153
154 %files -n vim-plugin-fzf-doc
155 %defattr(644,root,root,755)
156 %{_datadir}/vim/doc/fzf.txt
This page took 0.075625 seconds and 2 git commands to generate.