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