# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=tinyxxd
pkgver=1.3.15
pkgrel=1
pkgdesc='Standalone version of the hex dump utility that comes with ViM'
arch=(x86_64 aarch64)
url='https://github.com/xyproto/tinyxxd'
provides=(xxd)
conflicts=(xxd)
license=(GPL-2.0-only MIT)
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz")
b2sums=('0de580676d63a5535d25c222bd905178018d5bd8a5cad9d4589559f4667cc2931a8abf35ebc8c799da24ad95c595e9766efa30ddcbdfc3397afca30ab46bd934')

build() {
  make -C $pkgname-$pkgver
}

package() {
  cd $pkgname-$pkgver
  DESTDIR="$pkgdir" make install
  install -Dm644 $pkgname.1 "$pkgdir/usr/share/man/man1/$pkgname.1"
  install -Dm644 AUTHORS.md "$pkgdir/usr/share/licenses/$pkgname/AUTHORS.md"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  ln -s /usr/bin/tinyxxd "$pkgdir/usr/bin/xxd"
}
