summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6f9b31257d0a1f0b180278bea197fe455d8e3d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Maintainer: Ckat <ckat@teknik.io>
pkgname=fuf-git
pkgver=latest.build.r0.gac1498f
pkgrel=1
pkgdesc='Fairly Usable cli Filebrowser. dev/git version'
arch=('any')
url=https://github.com/ckath/fuf
license=('MIT')
depends=('ncurses' 'libx11')
makedepends=('git')
optdepends=('w3m: image previews')
conflicts=('fuf')
provides=('fuf')
install=fuf.install
source=("$pkgname::git+https://github.com/ckath/fuf.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g;s/^v//g'
}

build() {
  cd "$srcdir/$pkgname"
  make VERSION="$pkgver"
}

package() {
  cd "$srcdir/$pkgname"
  install -Dm755 fuf "$pkgdir/usr/bin/fuf"
  install -Dm755 scripts/open "$pkgdir/usr/lib/${pkgname%-git}/open"
  install -Dm755 scripts/preview "$pkgdir/usr/lib/${pkgname%-git}/preview"
  install -Dm644 completions/bash/fuf "$pkgdir/usr/share/bash-completion/completions/fuf"
  install -Dm644 completions/zsh/_fuf "$pkgdir/usr/share/zsh/site-functions/_fuf"
}