# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Icinga PHP libraries for Icinga Web 2"
HOMEPAGE="https://github.com/Icinga/icinga-php-thirdparty"
SRC_URI="https://github.com/Icinga/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 x86"

IUSE="php_targets_php8-1 php_targets_php8-2 php_targets_php8-3"
PHP_DEPEND="
	php_targets_php8-1? ( dev-lang/php:8.1 )
	!php_targets_php8-1? ( !dev-lang/php:8.1 )
	php_targets_php8-2? ( dev-lang/php:8.2 )
	!php_targets_php8-2? ( !dev-lang/php:8.2 )
	php_targets_php8-3? ( dev-lang/php:8.3 )
	!php_targets_php8-3? ( !dev-lang/php:8.3 )
"
DEPEND="${PHP_DEPEND}"
RDEPEND="${DEPEND}"
BDEPEND=""

src_install() {
	insinto "/usr/share/icinga-php/vendor"
	cd "${S}" || die
	doins -r ./*
}