]> git.pld-linux.org Git - packages/fzf.git/commitdiff
Package install script to setup user bashrc/zshrc
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 30 Sep 2022 06:32:10 +0000 (09:32 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Fri, 30 Sep 2022 06:33:27 +0000 (09:33 +0300)
fzf.spec
install.patch [new file with mode: 0644]

index 629139cfde879e1af11e60fc6036743c9c72c47e..0558ea7cef3d9d3ad182391ac42630c66a59bbb2 100644 (file)
--- a/fzf.spec
+++ b/fzf.spec
@@ -26,6 +26,7 @@ Source2:      https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfv
 Source3:       https://github.com/junegunn/fzf-git.sh/archive/%{fzfgitrev}/fzf-git.sh-%{fzfgitrev}.tar.gz
 # Source3-md5: 672c3efba11c015c5d282562553eac07
 Patch0:                fzf-git-awk.patch
+Patch1:                install.patch
 URL:           https://github.com/junegunn/fzf
 BuildRequires: golang >= 1.13
 BuildRequires: rpm-build >= 4.6
@@ -122,8 +123,9 @@ Documentation for fzf Vim plugin.
 cd fzf-git
 %patch0
 cd ..
+%patch1 -p1
 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
-%{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux
+%{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux install
 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
 
 %{__mkdir_p} .go-cache
@@ -138,6 +140,7 @@ install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/fzf/vim/bin,%{_mandir}/man1,%{
 install -d $RPM_BUILD_ROOT%{_datadir}/vim/{doc,autoload,plugin/fzf}
 
 install -p target/fzf $RPM_BUILD_ROOT%{_bindir}/fzf
+install -p install $RPM_BUILD_ROOT%{_bindir}/fzf-install
 install -p bin/fzf-tmux $RPM_BUILD_ROOT%{_bindir}/fzf-tmux
 cp -p man/man1/fzf.1 $RPM_BUILD_ROOT%{_mandir}/man1
 cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
@@ -164,6 +167,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc BUILD.md CHANGELOG.md README.md
 %attr(755,root,root) %{_bindir}/fzf
+%attr(755,root,root) %{_bindir}/fzf-install
 %dir %{_datadir}/fzf
 %{_mandir}/man1/fzf.1*
 
diff --git a/install.patch b/install.patch
new file mode 100644 (file)
index 0000000..9aec970
--- /dev/null
@@ -0,0 +1,36 @@
+1. disable fish as not packaged and creates broken symlinks
+1. disabled download as we pre-package
+
+--- fzf-0.34.0/install~        2022-09-30 09:21:44.085976824 +0300
++++ fzf-0.34.0/install 2022-09-30 09:29:08.782477314 +0300
+@@ -6,7 +6,7 @@
+ auto_completion=
+ key_bindings=
+ update_config=2
+-shells="bash zsh fish"
++shells="bash zsh"
+ prefix='~/.fzf'
+ prefix_expand=~/.fzf
+ fish_dir=${XDG_CONFIG_HOME:-$HOME/.config}/fish
+@@ -163,8 +163,9 @@
+   chmod +x fzf && check_binary
+ }
+-# Try to download binary executable
+ archi=$(uname -sm)
++download() {
++# Try to download binary executable
+ binary_available=1
+ binary_error=""
+ case "$archi" in
+@@ -184,6 +185,10 @@
+   Windows*\ *64)   download fzf-$version-windows_amd64.zip    ;;
+   *)               binary_available=0 binary_error=1 ;;
+ esac
++}
++
++# pre-packaged, so always true
++binary_available=1 binary_error=""
+ cd "$fzf_base"
+ if [ -n "$binary_error" ]; then
This page took 0.15256 seconds and 4 git commands to generate.