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