]> git.pld-linux.org Git - packages/fzf.git/blob - fzf.spec
up to 0.29.0
[packages/fzf.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3 # - package fzf-tmux
4
5 %define         fzfrev          dc975e8
6 %define         fzfvimrev       d6aa214
7 %define         vendor_version  0.29.0
8
9 Summary:        A command-line fuzzy finder written in Go
10 Name:           fzf
11 Version:        0.29.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:  14e78c2e66dd98b8e968b6c8fb4c14dd
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:  00d39a9c8468733484cf40b3426ac20b
24 Source2:        https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
25 # Source2-md5:  498bb479ca34cff6116c3c7184476d63
26 URL:            https://github.com/junegunn/fzf
27 BuildRequires:  golang >= 1.13
28 BuildRequires:  rpmbuild(macros) >= 2.005
29 BuildRequires:  sed >= 4.0
30 BuildRequires:  tar >= 1:1.22
31 BuildRequires:  xz
32 ExclusiveArch:  %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64 ppc64le s390x
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 -n bash-completion-fzf
45 Summary:        bash-completion for fzf
46 Group:          Applications/Shells
47 Requires:       %{name} = %{version}-%{release}
48 Requires:       bash-completion >= 2.0
49 BuildArch:      noarch
50
51 %description -n bash-completion-fzf
52 bash-completion for fzf.
53
54 %package -n zsh-completion-fzf
55 Summary:        zsh-completion for fzf
56 Group:          Applications/Shells
57 Requires:       %{name} = %{version}-%{release}
58 Requires:       zsh
59 BuildArch:      noarch
60
61 %description -n zsh-completion-fzf
62 zsh-completion for fzf.
63
64 %package -n vim-plugin-fzf
65 Summary:        fzf integration for Vim
66 Group:          Applications/Editors/Vim
67 Requires:       %{name} >= 0.23.0
68 Requires:       file
69 Requires:       vim-rt
70 Suggests:       highlight
71 Suggests:       ripgrep
72 Suggests:       the_silver_searcher
73 BuildArch:      noarch
74
75 %description -n vim-plugin-fzf
76 fzf integration for Vim.
77
78 %package -n vim-plugin-fzf-doc
79 Summary:        Documentation for fzf Vim plugin
80 Group:          Applications/Editors/Vim
81 Requires:       vim-plugin-fzf = %{version}-%{release}
82 Requires:       vim-rt
83 BuildArch:      noarch
84
85 %description -n vim-plugin-fzf-doc
86 Documentation for fzf Vim plugin.
87
88 %prep
89 %setup -q -a1 -a2
90 %{__mv} fzf-%{vendor_version}/vendor .
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 %{__mkdir_p} .go-cache
97
98 %build
99 GOCACHE="$(pwd)/.go-cache" go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103
104 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
105 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
106
107 cp -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
108 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
109 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
110 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
111 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
112 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
113 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
114 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
115 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
116 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
117 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %post -n vim-plugin-fzf-doc
123 %vim_doc_helptags
124
125 %postun -n vim-plugin-fzf-doc
126 %vim_doc_helptags
127
128 %files
129 %defattr(644,root,root,755)
130 %doc BUILD.md CHANGELOG.md README.md
131 %attr(755,root,root) %{_bindir}/fzf
132 %dir %{_datadir}/fzf
133 %{_mandir}/man1/fzf.1*
134
135 %files -n bash-completion-fzf
136 %defattr(644,root,root,755)
137 %{_datadir}/fzf/completion.bash
138 %{_datadir}/fzf/key-bindings.bash
139
140 %files -n zsh-completion-fzf
141 %defattr(644,root,root,755)
142 %{_datadir}/fzf/completion.zsh
143 %{_datadir}/fzf/key-bindings.zsh
144
145 %files -n vim-plugin-fzf
146 %defattr(644,root,root,755)
147 %doc README-VIM.md fzf.vim/README.md
148 %dir %{_datadir}/fzf/vim
149 %dir %{_datadir}/fzf/vim/bin
150 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
151 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
152 %{_datadir}/vim/autoload/fzf
153 %{_datadir}/vim/plugin/fzf.vim
154 %{_datadir}/vim/plugin/fzf
155
156 %files -n vim-plugin-fzf-doc
157 %defattr(644,root,root,755)
158 %{_datadir}/vim/doc/fzf.txt
This page took 0.455734 seconds and 3 git commands to generate.