Add senpai irc client
[slackbuilds.git] / fzf / fzf.SlackBuild
blob6f18cb5175411c2602cc9fc50710b5eff5cde942
1 #!/bin/bash
3 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4 # Version 2, December 2004
6 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
8 # Everyone is permitted to copy and distribute verbatim or modified
9 # copies of this license document, and changing it is allowed as long
10 # as the name is changed.
12 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
13 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16 # 0. You just DO WHAT THE FUCK YOU WANT TO.
18 # SlackBuild script for fzf
19 # ===========================
20 # By: r1w1s1 (https://fosstodon.org/@r1w1s1)
21 # For: fzf
22 # Descr: fzf (A command-line fuzzy finder written in Go)
23 # URL: https://github.com/junegunn/fzf
24 # Changelog:
25 # v0.54.0: 15/june/2024 by r1w1s1 - Initial build.
27 cd $(dirname $0) ; CWD=$(pwd)
29 PRGNAM=fzf
30 VERSION=${VERSION:-0.54.0}
31 BUILD=${BUILD:-1}
32 TAG=${TAG:-_r1w1s1}
33 ARCH=${ARCH:-x86_64}
35 TMP=${TMP:-/tmp/SBo}
36 PKG=$TMP/package-$PRGNAM
37 PKGTYPE=${PKGTYPE:-tgz}
38 OUTPUT=${OUTPUT:-/tmp}
40 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
41 # the name of the created package would be, and then exit. This information
42 # could be useful to other scripts.
43 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
44 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
45 exit 0
48 # Define Go environment variables
49 export GOPATH=$TMP/go
50 export GOCACHE=$TMP/go-cache
52 set-e
54 rm -rf $PKG
55 mkdir -p $TMP $PKG $OUTPUT
56 cd $TMP
57 rm -rf $PRGNAM-$VERSION
59 wget -O $PRGNAM-$VERSION.tar.gz https://github.com/junegunn/fzf/archive/refs/tags/v$VERSION.tar.gz
60 tar xvf $PRGNAM-$VERSION.tar.gz
61 cd $PRGNAM-$VERSION
63 # Compile the application
64 FZF_VERSION="$VERSION" FZF_REVISION="Slackware" make
66 mkdir -p $PKG/usr/bin
67 install -m 0755 target/fzf-linux_* $PKG/usr/bin/fzf
68 install -m 0755 bin/fzf-tmux $PKG/usr/bin/fzf-tmux
70 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
71 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
73 mkdir -p $PKG/usr/man/man1
74 install -m 0644 man/man1/fzf.1 $PKG/usr/man/man1/fzf.1
75 install -m 0644 man/man1/fzf-tmux.1 $PKG/usr/man/man1/fzf-tmux.1
78 find $PKG/usr/man -type f -exec gzip -9 {} \;
79 for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
81 mkdir -p $PKG/usr/share/bash-completion/completions/
82 install -m 0644 shell/completion.bash $PKG/usr/share/bash-completion/completions/fzf
84 mkdir -p $PKG/usr/share/zsh/site-functions/
85 install -m 0644 shell/completion.zsh $PKG/usr/share/zsh/site-functions/_fzf
87 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
88 cp -a \
89 BUILD.md CHANGELOG.md LICENSE README-VIM.md README.md shell/key-bindings.zsh shell/key-bindings.bash \
90 $PKG/usr/doc/$PRGNAM-$VERSION
92 mkdir -p $PKG/usr/share/fzf
93 cp -a \
94 shell/key-bindings.zsh shell/key-bindings.bash \
95 $PKG/usr/share/fzf
97 #Install vim plugin
98 mkdir -p $PKG/usr/share/vim/vimfiles/plugin
99 install -m 0644 plugin/fzf.vim $PKG/usr/share/vim/vimfiles/plugin
101 mkdir -p $PKG/usr/share/vim/vimfiles/doc/
102 install -m 0644 doc/fzf.txt $PKG/usr/share/vim/vimfiles/doc/
104 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
106 mkdir -p $PKG/install
107 cat $CWD/slack-desc > $PKG/install/slack-desc
109 cd $PKG
110 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
112 cd $OUTPUT
113 md5sum $PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE > $PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE.md5