Matej Cepl
f85422a42b
anymore, shell integration scripts are now embedded in the fzf binary. This simplifies the distribution, and the users are less likely to have problems caused by using incompatible scripts and binaries. bash # Set up fzf key bindings and fuzzy completion eval "$(fzf --bash)" zsh # Set up fzf key bindings and fuzzy completion eval "$(fzf --zsh)" fish # Set up fzf key bindings fzf --fish | source OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=98
126 lines
3.7 KiB
RPMSpec
126 lines
3.7 KiB
RPMSpec
#
|
|
# spec file for package fzf
|
|
#
|
|
# Copyright (c) 2024 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/
|
|
#
|
|
|
|
|
|
%global _lto_cflags %{nil}
|
|
Name: fzf
|
|
Version: 0.48.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/fzf/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
Source1: vendor.tar.zst
|
|
BuildRequires: zstd
|
|
BuildRequires: golang(API) >= 1.19
|
|
Provides: %{name}-bash-completion = %{version}-%{release}
|
|
Obsoletes: %{name}-bash-completion < 0.48.0-1.1
|
|
Provides: %{name}-zsh-completion = %{version}-%{release}
|
|
Obsoletes: %{name}-zsh-completion < 0.48.0-1.1
|
|
Provides: %{name}-fish-completion = %{version}-%{release}
|
|
Obsoletes: %{name}-fish-completion < 0.48.0-1.1
|
|
|
|
%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: (fzf and tmux)
|
|
BuildArch: noarch
|
|
|
|
%description tmux
|
|
Tmux integration for fzf. Includes a wrapper script, fzf-tmux, that opens your list in a
|
|
separate tmux pane.
|
|
|
|
%define vimplugin_dir %{_datadir}/vim/site
|
|
|
|
%package -n vim-fzf
|
|
Summary: Vim plugin for fzf
|
|
Group: Productivity/File utilities
|
|
Requires: (vim or neovim)
|
|
BuildArch: noarch
|
|
|
|
%description -n vim-fzf
|
|
Plugin for vim allowing use of fzf.
|
|
|
|
%prep
|
|
%autosetup -p1 -a1
|
|
|
|
# fix E: env-script-interpreter
|
|
sed -i 's,#!%{_bindir}/env ,#!/bin/,' ./bin/fzf-tmux
|
|
|
|
%build
|
|
export FZF_VERSION=%{version} FZF_REVISION=tarball
|
|
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 "-s -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
|
|
|
|
# vim plugin
|
|
install -D -m0644 -t %{buildroot}%{vimplugin_dir}/doc doc/*
|
|
install -D -m0644 -t %{buildroot}%{vimplugin_dir}/plugin plugin/*
|
|
|
|
%check
|
|
export SHELL=/bin/sh GOOS=
|
|
export GOCACHE=$(readlink -f vendor/)
|
|
%ifarch ppc64
|
|
BUILDMOD=""
|
|
%else
|
|
BUILDMOD="-buildmode=pie"
|
|
%endif
|
|
export CGO_CFLAGS="%{optflags}"
|
|
export CGO_CXXFLAGS="%{optflags}"
|
|
export CGO_CPPFLAGS="%{optflags}"
|
|
go test -v -x -mod=vendor ${BUILDMOD} -a \
|
|
-ldflags "-X main.revision=%{version}" \
|
|
github.com/junegunn/fzf/src \
|
|
github.com/junegunn/fzf/src/algo \
|
|
github.com/junegunn/fzf/src/tui \
|
|
github.com/junegunn/fzf/src/util
|
|
|
|
%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 -n vim-fzf
|
|
%doc README-VIM.md
|
|
%dir %{_datadir}/vim
|
|
%dir %{vimplugin_dir}
|
|
%{vimplugin_dir}/doc
|
|
%{vimplugin_dir}/plugin
|
|
|
|
%changelog
|