### this file is sourced not run
# source: step

# Build [1] master commit or [2] official release

repo=fzf
pkgname=$repo # for SLACKDESC

# [1] Master commit

# hash=
# MD5SUM=
# hash7=${hash#???????}; hash7=${hash%$hash7}
# PKGVER=0.17.5_2018.xx.xx_$hash7

# TARBALL=$pkgname-$hash.tar.gz
# SRC_URL=https://github.com/junegunn/$repo/archive/$hash.tar.gz

# [2] Official release

MD5SUM=86745f576850b93105bb225abc1cb32f
PKGVER=0.25.0
TARBALL=$pkgname-$PKGVER.tar.gz
SRC_URL=https://github.com/junegunn/$pkgname/archive/$PKGVER.tar.gz

PKGARCH=x86_64
PKGBUILD=1
BUNDLE=

SLACKREQ=''
SLACKDESC="$pkgname: $pkgname $PKGVER $hash7 (command-line finder)
$pkgname: fzf is a general-purpose, cross-platform command-line fuzzy finder.
$pkgname:
$pkgname: This package installs system-wide just the fzf binary and its manual without
$pkgname: modifying your shell configuration. Configuration scripts are available in
$pkgname: /usr/share/fzf for you to personalize your shell as you see fit.
$pkgname:
$pkgname:
$pkgname: License: MIT
$pkgname:
$pkgname: home page: https://github.com/juengunn/fzf
"

### default pkg_download
pkg_prepare() {
	# Download & unpack source
	case $PKGARCH in
		i686) M=386 ;;
		x86_64) M=amd64 ;;
	esac
	pkg_prepare_default &&
	# Download & unpack fzf binary
	SRC_URL="https://github.com/junegunn/fzf/releases/download/0.25.0/fzf-0.25.0-linux_$M.tar.gz" \
		TARBALL=$pkgname-bin-$PKGVER.tar.gz \
		MD5SUM=86c647f1da1aa501981ee02f47ef563d \
		pkg_prepare_default
}
### default pkg_package
### build
pkg_build() {
	cd /tmp/$pkgname-* &&
	install -m755 -Dt /usr/bin ../fzf bin/* &&
	install -m644 -Dt /usr/share/man/man1 man/man1/* &&
	install -m644 -Dt /usr/share/fzf install uninstall README.* LICENSE &&
	install -m644 -Dt /usr/share/fzf/plugin plugin/* &&
	install -m644 -Dt /usr/share/fzf/shell shell/* &&
	pkg_build_slackdesc
}

# vim:ft=sh:

