# Template file for 'eza'
pkgname=eza
version=0.20.12
revision=2
build_style=cargo
hostmakedepends="pkg-config"
makedepends="libgit2-1.8-devel"
short_desc="Modern replacement for ls"
maintainer="tranzystorekk <tranzystorek.io@protonmail.com>"
license="EUPL-1.2"
homepage="https://eza.rocks"
changelog="https://raw.githubusercontent.com/eza-community/eza/main/CHANGELOG.md"
distfiles="https://github.com/eza-community/eza/archive/refs/tags/v${version}.tar.gz
 https://github.com/eza-community/eza/releases/download/v${version}/man-${version}.tar.gz"
checksum="c40edf02e662f6bba4997a3d497a30561c3d2de9a329f9869761acf8b7f69562
 0395bf06eedcdef958ef4132c2fc60be18ba60eb275b10010c5bf1e7af6a3949"

skip_extraction="man-${version}.tar.gz"

post_extract() {
	vsrcextract -C manpages --strip-components=3 man-${version}.tar.gz
}

post_install() {
	vcompletion completions/bash/eza bash
	vcompletion completions/fish/eza.fish fish
	vcompletion completions/zsh/_eza zsh

	for manpage in manpages/*; do
		vman ${manpage}
	done

	vlicense LICENSE.txt

	ln -s eza ${DESTDIR}/usr/bin/exa
}

exa_package() {
	depends="eza>=${version}_${revision}"
	short_desc+=" - transitional dummy package"
	pkg_install() {
		vmove usr/bin/exa
	}
}
