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

pkgname=tinyxxd
pkgver=1.3.16
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=('47884f00f246845150f53d198fd7c4170e6308e8cab6b788ffcb32cb9b18f0b0982c923cd9c76357e2dd00502fb408169b70bb9e88716b4e07194bb6283a2f94')

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"
}
