|
| 1 | +# Copyright 1999-2024 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +DESCRIPTION="Icinga Web 2 plugin for configuration" |
| 7 | +HOMEPAGE="https://github.com/Icinga/icingaweb2-module-director/" |
| 8 | +if [[ "${PV}" == 9999 ]]; then |
| 9 | + inherit git-r3 |
| 10 | + EGIT_REPO_URI="https://github.com/Icinga/${PN}.git" |
| 11 | +else |
| 12 | + KEYWORDS="~amd64 ~x86" |
| 13 | + SRC_URI="https://codeload.github.com/Icinga/${PN}/tar.gz/v${PV} -> ${P}.tar.gz" |
| 14 | + S="${WORKDIR}/${PN}-${PV}" |
| 15 | +fi |
| 16 | + |
| 17 | +LICENSE="GPL-2" |
| 18 | +SLOT="0" |
| 19 | + |
| 20 | +# Dependencies according to https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/02-Installation.md |
| 21 | +IUSE="php_targets_php8-2 php_targets_php8-3" |
| 22 | +PHP_DEPEND=" |
| 23 | + php_targets_php8-2? ( dev-lang/php:8.2[curl,iconv,pcntl,posix,sockets] ) |
| 24 | + php_targets_php8-3? ( dev-lang/php:8.3[curl,iconv,pcntl,posix,sockets] ) |
| 25 | +" |
| 26 | +RDEPEND=" |
| 27 | + ${PHP_DEPEND} |
| 28 | + >=www-apps/icingaweb2-module-incubator-0.22.0 |
| 29 | + >=dev-libs/icinga-php-library-0.14.1 |
| 30 | + >=dev-libs/icinga-php-thirdparty-0.12.1 |
| 31 | + >=www-apps/icingaweb2-2.12.1 |
| 32 | + " |
| 33 | +DEPEND="" |
| 34 | + |
| 35 | +src_install() { |
| 36 | + insinto "/usr/share/icingaweb2/modules/${PN##*-}/" |
| 37 | + doins -r "${S}"/* |
| 38 | + |
| 39 | + exeinto /usr/share/icingaweb2/bin/ |
| 40 | + doexe "${FILESDIR}/icinga-director.sh" |
| 41 | + |
| 42 | + doinitd "${FILESDIR}/director" |
| 43 | +} |
| 44 | + |
| 45 | +pkg_postinst() { |
| 46 | + # According to PMS this can be a space-separated list of version |
| 47 | + # numbers, even though in practice it is typically just one. |
| 48 | + local oldver |
| 49 | + for oldver in ${REPLACING_VERSIONS}; do |
| 50 | + if ver_test "${oldver}" -lt "1.11.0"; then |
| 51 | + ewarn "You are upgrading from $oldver to ${PVR}" |
| 52 | + ewarn "please read https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/05-Upgrading.md#upgrade-to-1.11.x" |
| 53 | + ewarn "for breaking changes" |
| 54 | + ewarn "" |
| 55 | + ewarn "Also, don't forget to upgrade database schema." |
| 56 | + ewarn "Otherwise icingaweb2-module-director will not work!" |
| 57 | + ewarn "(Web GUI => Configuration => Modules => director => Configuration)" |
| 58 | + ewarn "" |
| 59 | + break |
| 60 | + fi |
| 61 | + done |
| 62 | +} |
0 commit comments