SHA256
1
0
forked from pool/fzf
fzf/fzf.spec
Avindra Goolcharan 18d89eaf9d Accepting request 760825 from home:mcepl:branches:utilities
- Update to 0.20.0:
  - Customizable preview window color (preview-fg and preview-bg
    for --color)
    fzf --preview 'cat {}' \
        --color 'fg:#bbccdd,fg+:#ddeeff,bg:#334455,preview-bg:#223344,border:#778899' \
        --border --height 20 --layout reverse --info inline
    Removed the immediate flicking of the screen on reload action.
    : | fzf --bind 'change:reload:seq {q}' --phony
    Added clear-query and clear-selection actions for --bind
  - It is now possible to split a composite bind action over
    multiple --bind expressions by prefixing the later ones with
    +.
    fzf --bind 'ctrl-a:up+up'
    # Can be now written as
    fzf --bind 'ctrl-a:up' --bind 'ctrl-a:+up'
    # This is useful when you need to write special
    # execute/reload form (i.e. `execute:...`)
    # to avoid parse errors and add more actions to the same key
    fzf --multi --bind 'ctrl-l:select-all+execute:less {+f}' --bind 'ctrl-l:+deselect-all'
  - Fixed parse error of --bind expression where concatenated
    execute/reload action contains + character.
    fzf --multi --bind 'ctrl-l:select-all+execute(less {+f})+deselect-all'
  - Fixed bugs of reload action
    - Not triggered when there's no match even when the command
      doesn't have any placeholder expressions
    - Screen not properly cleared when --header-lines not filled
      on reload

OBS-URL: https://build.opensuse.org/request/show/760825
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=13
2020-01-06 05:20:09 +00:00

136 lines
3.9 KiB
RPMSpec

#
# spec file for package fzf
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: fzf
Version: 0.20.0
Release: 0
Summary: A command-line fuzzy finder
License: MIT
Group: Productivity/File utilities
URL: https://github.com/junegunn/fzf
Source0: https://github.com/junegunn/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Run go build && go mod vendor to get vendor/ subdirectory
Source1: vendor.tar.xz
BuildRequires: golang(API) >= 1.12
%description
fzf is an interactive Unix filter for command-line that can be used with any list; files,
command history, processes, hostnames, bookmarks, git commits, etc.
%package tmux
Summary: Tmux integration for fzf
Group: Productivity/File utilities
Supplements: packageand(fzf:tmux)
BuildArch: noarch
%description tmux
Tmux integration for fzf. Includes a wrapper script, fzf-tmux, that opens your list in a
separate tmux pane.
%package bash-completion
Summary: Bash completion for fzf
Group: Productivity/File utilities
Requires: bash-completion
Supplements: packageand(fzf:bash)
BuildArch: noarch
%description bash-completion
Bash shell completions for fzf
%package zsh-completion
Summary: ZSH completion for fzf
Group: Productivity/File utilities
Supplements: packageand(fzf:zsh)
BuildArch: noarch
%description zsh-completion
zsh shell completions for fzf
%define vimplugin_dir %{_datadir}/vim/site
%package -n vim-fzf
Summary: Vim plugin for fzf
Group: Productivity/File utilities
BuildArch: noarch
%description -n vim-fzf
Plugin for vim allowing use of fzf.
%prep
%setup -q -a1
# fix E: env-script-interpreter
sed -i 's,#!%{_bindir}/env ,#!/bin/,' ./bin/fzf-tmux
%build
export GOCACHE=$(readlink -f vendor/)
%ifarch ppc64
BUILDMOD=""
%else
BUILDMOD="-buildmode=pie"
%endif
export RPM_OPT_FLAGS="%{optflags}"
go build -v -x -mod=vendor $BUILDMOD -a -ldflags "-X main.revision=%{version}"
%install
install -Dm755 fzf %{buildroot}%{_bindir}/fzf
install -Dm755 bin/fzf-tmux %{buildroot}%{_bindir}/fzf-tmux
install -Dm644 man/man1/fzf.1 %{buildroot}%{_mandir}/man1/fzf.1
install -Dm644 man/man1/fzf-tmux.1 %{buildroot}%{_mandir}/man1/fzf-tmux.1
# shell completions
install -Dm0644 shell/completion.bash \
%{buildroot}%{_datadir}/bash-completion/completions/fzf
install -Dm0644 shell/key-bindings.bash \
%{buildroot}%{_datadir}/bash-completion/completions/fzf-key-bindings
install -Dm0644 shell/completion.zsh \
%{buildroot}%{_datadir}/zsh/site-functions/_fzf
install -Dm0644 shell/key-bindings.zsh \
%{buildroot}%{_sysconfdir}/zsh_completion.d/fzf-key-bindings
# vim plugin
install -D -m0644 -t %{buildroot}%{vimplugin_dir}/doc doc/*
install -D -m0644 -t %{buildroot}%{vimplugin_dir}/plugin plugin/*
%files
%doc README.md
%{_bindir}/fzf
%{_mandir}/man1/fzf.1%{?ext_man}
%license LICENSE
%files tmux
%{_bindir}/fzf-tmux
%{_mandir}/man1/fzf-tmux.1%{?ext_man}
%files bash-completion
%{_datadir}/bash-completion/completions/fzf
%{_datadir}/bash-completion/completions/fzf-key-bindings
%files zsh-completion
%{_datadir}/zsh
%dir %{_sysconfdir}/zsh_completion.d
%config %{_sysconfdir}/zsh_completion.d/fzf-key-bindings
%files -n vim-fzf
%doc README-VIM.md
%dir %{_datadir}/vim
%dir %{vimplugin_dir}
%{vimplugin_dir}/doc
%{vimplugin_dir}/plugin
%changelog