]> git.pld-linux.org Git - SPECS.git/blob - fzf.spec
SPECS updated Sun 1 Aug 11:02:02 CEST 2021
[SPECS.git] / fzf.spec
1 # TODO:
2 # - package vendored modules
3 # - package fzf-tmux
4
5 %define         fzfrev          19759ed
6 %define         fzfvimrev       a88311b
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.1
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:  31420cb678ce9f056d39d8bec46f690a
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:  6095e1cb0e42900e1acbbc0c91b65a70
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:       the_silver_searcher
72 BuildArch:      noarch
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 BuildArch:      noarch
83
84 %description -n vim-plugin-fzf-doc
85 Documentation for fzf Vim plugin.
86
87 %prep
88 %setup -q -a1 -a2
89 %{__mv} fzf-%{vendor_version}/vendor .
90 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
91 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
92 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh
93 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
94
95 %{__mkdir_p} .go-cache
96
97 %build
98 GOCACHE="$(pwd)/.go-cache" go build -v -mod=vendor -ldflags='-X main.version=%{version} -X main.revision=%{fzfrev}' -o target/fzf
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{bash_compdir},%{zsh_compdir}}
104 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
105
106 cp -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
107 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
108 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
109 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
110 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
111 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
112 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
113 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
114 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
115 cp -p fzf.vim/doc/fzf-vim.txt $RPM_BUILD_ROOT%{_datadir}/vim/doc/fzf.txt
116 cp -p fzf.vim/bin/{preview.sh,tags.pl} $RPM_BUILD_ROOT%{_datadir}/fzf/vim/bin
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %post -n vim-plugin-fzf-doc
122 %vim_doc_helptags
123
124 %postun -n vim-plugin-fzf-doc
125 %vim_doc_helptags
126
127 %files
128 %defattr(644,root,root,755)
129 %doc BUILD.md CHANGELOG.md README.md
130 %attr(755,root,root) %{_bindir}/fzf
131 %dir %{_datadir}/fzf
132 %{_mandir}/man1/fzf.1*
133
134 %files -n bash-completion-fzf
135 %defattr(644,root,root,755)
136 %{_datadir}/fzf/completion.bash
137 %{_datadir}/fzf/key-bindings.bash
138
139 %files -n zsh-completion-fzf
140 %defattr(644,root,root,755)
141 %{_datadir}/fzf/completion.zsh
142 %{_datadir}/fzf/key-bindings.zsh
143
144 %files -n vim-plugin-fzf
145 %defattr(644,root,root,755)
146 %doc README-VIM.md fzf.vim/README.md
147 %dir %{_datadir}/fzf/vim
148 %dir %{_datadir}/fzf/vim/bin
149 %attr(755,root,root) %{_datadir}/fzf/vim/bin/preview.sh
150 %attr(755,root,root) %{_datadir}/fzf/vim/bin/tags.pl
151 %{_datadir}/vim/autoload/fzf
152 %{_datadir}/vim/plugin/fzf.vim
153 %{_datadir}/vim/plugin/fzf
154
155 %files -n vim-plugin-fzf-doc
156 %defattr(644,root,root,755)
157 %{_datadir}/vim/doc/fzf.txt
This page took 0.158177 seconds and 3 git commands to generate.