# Template file for 'soft-serve'
pkgname=soft-serve
version=0.11.6
revision=1
build_style=go
build_helper=qemu
go_import_path="github.com/charmbracelet/soft-serve"
go_ldflags="-X main.Version=${version}"
go_package="github.com/charmbracelet/soft-serve/cmd/soft"
depends="git git-lfs openssh"
checkdepends="${depends}"
short_desc="Tasty, self-hostable Git server for the command line"
maintainer="zenobit <zen@osowoso.org>"
license="MIT"
homepage="https://github.com/charmbracelet/soft-serve"
changelog="https://github.com/charmbracelet/soft-serve/releases"
distfiles="https://github.com/charmbracelet/soft-serve/archive/refs/tags/v${version}.tar.gz"
checksum=0536934663508b1949193d6bd7ebcee227d40c8162a0dcfd338f1f33f74474bb
if [[ "$XBPS_TARGET_MACHINE" == 'i686' ]] && [[ "$XBPS_TARGET_LIBC" == "glibc" ]]; then
	make_check=no # The test failure on i686 comes from git-lfs
	# Pending patch: https://github.com/git-lfs/git-lfs/pull/6200
fi

system_accounts="_softserve"
_softserve_homedir="/var/lib/soft-serve"
make_dirs="/var/lib/soft-serve 0755 _softserve _softserve"

post_install() {
	local _soft="${DESTDIR}/usr/bin/soft"
	for shell in bash fish zsh; do
		vtargetrun ${_soft} completion ${shell} > soft.${shell}
		vcompletion soft.${shell} ${shell} soft
	done

	vtargetrun ${_soft} man > soft.1
	vman soft.1

	vlicense LICENSE
	vsv soft-serve
}
