# Template file for 'xbps'
pkgname=xbps
version=21.1
revision=5
archs="i686 x86_64 x86_64-musl"
bootstrap=yes
build_style=configure
short_desc="XBPS package system utilities"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="BSD-2-Clause, BSD-3-Clause, ISC"
homepage="https://gitlab.com/xtraeme/xbps/"
changelog="${homepage}-/blob/master/NEWS.md"
distfiles="${homepage}-/archive/${version}/xbps-${version}.tar.gz"
checksum=51a8ab75ece07bea64ea325e2c62314f9477bab06de297e8d3577f0fb4f48578

hostmakedepends="pkgconf"
makedepends="libarchive-devel"
depends="ca-certificates xbps-triggers"

make_dirs="/etc/xbps.d 0755 root root"

do_configure() {
	./configure --prefix=/usr \
	--sysconfdir=/etc \
	--enable-lto
}

pre_build() {
	vmkdir usr/share/xbps.d
}

post_install() {
	
	local repo="https://repo-default.voidlinux.org/current" suffix=
	case "$XBPS_TARGET_MACHINE" in
		*-musl)       suffix="/musl";;
	esac

	echo "repository=${repo}${suffix}" > \
		${DESTDIR}/usr/share/xbps.d/00-repository-main.conf
	echo "architecture=${XBPS_TARGET_MACHINE}" > \
		${DESTDIR}/usr/share/xbps.d/xbps-arch.conf

	vlicense LICENSE
	vlicense 3RDPARTY
}
