%bcond_without check # https://github.com/junegunn/fzf %global goipath github.com/junegunn/fzf Name: fzf Version: 0.57.0 Release: %autorelease Summary: A command-line fuzzy finder written in Go # main source code is MIT # Apache-2.0: # - golang(github.com/gdamore/encoding) # - golang(github.com/gdamore/tcell/v2) # BSD-3-Clause: # - golang(golang.org/x/sys) # - golang(golang.org/x/term) # - golang(golang.org/x/text) # BSD-3-Clause AND MIT: # - golang(github.com/charlievieth/fastwalk) # MIT: # - golang(github.com/junegunn/go-shellwords) # - golang(github.com/lucasb-eyer/go-colorful) # - golang(github.com/mattn/go-isatty) # - golang(github.com/mattn/go-runewidth) # - golang(github.com/rivo/uniseg) License: Apache-2.0 AND BSD-3-Clause AND MIT URL: https://junegunn.github.io/fzf/ Source0: https://%{goipath}/archive/v%{version}/fzf-%{version}.tar.gz Source1: README.Fedora # see create-vendor-tarball.sh for how to create this Source2: fzf-%{version}-vendor.tar.gz # script that creates vendor tarball Source3: create-vendor-tarball.sh %if %{defined el8} BuildRequires: golang ExclusiveArch: %{golang_arches} %else BuildRequires: go-rpm-macros ExclusiveArch: %{golang_arches_future} %endif Provides: bundled(golang(github.com/charlievieth/fastwalk)) = 1.0.9 Provides: bundled(golang(github.com/gdamore/encoding)) = 1.0.0 Provides: bundled(golang(github.com/gdamore/tcell/v2)) = 2.7.4 Provides: bundled(golang(github.com/junegunn/go-shellwords)) = a62c48c Provides: bundled(golang(github.com/lucasb-eyer/go-colorful)) = 1.2.0 Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.20 Provides: bundled(golang(github.com/mattn/go-runewidth)) = 0.0.15 Provides: bundled(golang(github.com/rivo/uniseg)) = 0.4.7 Provides: bundled(golang(golang.org/x/sys)) = 0.28.0 Provides: bundled(golang(golang.org/x/term)) = 0.27.0 Provides: bundled(golang(golang.org/x/text)) = 0.14.0 %description fzf is a general-purpose command-line fuzzy finder. It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc. %prep %autosetup %{?rhel:-a 2} cp %{SOURCE1} . mkdir -p src/$(dirname %{goipath}) ln -s $PWD src/%{goipath} %build %if %{defined el8} export GO111MODULE=off %endif export GOPATH=$PWD export LDFLAGS='-X main.version=%{version} -X main.revision=Fedora ' %gobuild -o bin/fzf %{goipath} %install install -Dpm0755 -t %{buildroot}%{_bindir} bin/fzf bin/fzf-tmux install -Dpm0644 -t %{buildroot}%{_mandir}/man1 man/man1/*.1 # Install vim plugin install -Dpm0644 -t %{buildroot}%{_datadir}/vim/vimfiles/plugin plugin/fzf.vim install -Dpm0644 -t %{buildroot}%{_datadir}/nvim/site/plugin plugin/fzf.vim # Install shell completion # fzf is special, bash completion must be in /etc/bash_completion.d # https://bugzilla.redhat.com/show_bug.cgi?id=1789958#c7 install -Dpm0644 shell/completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/fzf install -Dpm0644 shell/completion.zsh %{buildroot}%{zsh_completions_dir}/_fzf # Install shell key bindings (not enabled) install -Dpm0644 -t %{buildroot}%{_datadir}/fzf/shell shell/key-bindings.* %if %{with check} %check export GOPATH=$PWD cd src/%{goipath} %gotest ./... %endif %files %license LICENSE %doc README.md README-VIM.md CHANGELOG.md README.Fedora %{_bindir}/fzf %{_bindir}/fzf-tmux %{_mandir}/man1/fzf.1* %{_mandir}/man1/fzf-tmux.1* %{_datadir}/fzf %if %{defined el8} # this is normally owned by filesystem %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %endif %dir %{_datadir}/vim/vimfiles/plugin %{_datadir}/vim/vimfiles/plugin/fzf.vim %dir %{_datadir}/nvim/site/plugin %{_datadir}/nvim/site/plugin/fzf.vim %{_sysconfdir}/bash_completion.d/fzf %{zsh_completions_dir}/_fzf %changelog %autochangelog