public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: www-apps/icingaweb2-module-director/files/, www-apps/icingaweb2-module-director/
@ 2023-09-13  9:26 David Seifert
  0 siblings, 0 replies; only message in thread
From: David Seifert @ 2023-09-13  9:26 UTC (permalink / raw
  To: gentoo-commits

commit:     465e4825788695ac53930c04e576cd0ab111fb5b
Author:     Anton Fischl <github <AT> fischl-online <DOT> de>
AuthorDate: Wed Sep 13 09:25:44 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Sep 13 09:25:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=465e4825

www-apps/icingaweb2-module-director: update 9999

Signed-off-by: Anton Fischl <github <AT> fischl-online.de>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 www-apps/icingaweb2-module-director/files/director | 23 +++++++
 .../files/icinga-director.sh                       |  2 +
 .../icingaweb2-module-director-9999.ebuild         | 75 ++++++++++++++--------
 3 files changed, 75 insertions(+), 25 deletions(-)

diff --git a/www-apps/icingaweb2-module-director/files/director b/www-apps/icingaweb2-module-director/files/director
new file mode 100644
index 000000000000..b2721d1e8dcd
--- /dev/null
+++ b/www-apps/icingaweb2-module-director/files/director
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+
+description="Icinga2 Director Daemon"
+supervisor=supervise-daemon
+respawn_period="${respawn_period:-30}"
+term_type="${term_type:-linux}"
+command=/usr/share/icingaweb2/bin/icinga-director.sh
+pidfile="/run/${RC_SVCNAME}.pid"
+command_user="nobody:icingaweb2"
+
+depend() {
+        need apache2 mysql php-fpm icinga2
+}
+
+start_pre() {
+        chgrp icingaweb2 /usr/share/icingaweb2/bin/icingacli
+        export EINFO_QUIET="${quiet:-yes}"
+}
+
+stop_pre()
+{
+        export EINFO_QUIET="${quiet:-yes}"
+}

diff --git a/www-apps/icingaweb2-module-director/files/icinga-director.sh b/www-apps/icingaweb2-module-director/files/icinga-director.sh
new file mode 100644
index 000000000000..f0a9db21a368
--- /dev/null
+++ b/www-apps/icingaweb2-module-director/files/icinga-director.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+/usr/share/icingaweb2/bin/icingacli director daemon run

diff --git a/www-apps/icingaweb2-module-director/icingaweb2-module-director-9999.ebuild b/www-apps/icingaweb2-module-director/icingaweb2-module-director-9999.ebuild
index c9a76d37b383..370c6d78fa9b 100644
--- a/www-apps/icingaweb2-module-director/icingaweb2-module-director-9999.ebuild
+++ b/www-apps/icingaweb2-module-director/icingaweb2-module-director-9999.ebuild
@@ -1,50 +1,75 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-DESCRIPTION="Icinga Web 2 plugin for configuration"
-HOMEPAGE="https://dev.icinga.org/projects/icingaweb2-module-director/"
 inherit systemd
-if [[ "${PV}" == 9999 ]]; then
+
+DESCRIPTION="Icinga Web 2 plugin for configuration"
+HOMEPAGE="https://github.com/Icinga/icingaweb2-module-director/"
+
+if [[ ${PV} == *9999 ]]; then
 	inherit git-r3
-	EGIT_REPO_URI="https://github.com/Icinga/icingaweb2-module-director.git"
+	EGIT_REPO_URI="https://github.com/Icinga/${PN}.git"
 else
 	KEYWORDS="~amd64 ~x86"
-	MY_PN="icingaweb2-module-director"
-	SRC_URI="https://codeload.github.com/Icinga/${MY_PN}/tar.gz/v${PV} -> ${P}.tar.gz"
-	S="${WORKDIR}/${MY_PN}-${PV}"
+	SRC_URI="https://codeload.github.com/Icinga/${PN}/tar.gz/v${PV} -> ${P}.tar.gz"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
+# Dependencies according to https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/02-Installation.md
+IUSE="php_targets_php8-1"
 
-DEPEND=">=net-analyzer/icinga2-2.6.0
-	>=www-apps/icingaweb2-2.6.0
-	|| (
-		dev-lang/php:7.3[curl,iconv,pcntl,posix,sockets]
-		dev-lang/php:7.4[curl,iconv,pcntl,posix,sockets]
-		dev-lang/php:8.0[curl,iconv,pcntl,posix,sockets]
-	)
+PHP_DEPEND="
+	php_targets_php8-1? ( dev-lang/php:8.1[curl,iconv,pcntl,posix,sockets] )
+"
+DEPEND="
 	acct-group/icingaweb2
-	acct-user/icingadirector"
-RDEPEND="${DEPEND}"
+	acct-user/icingadirector
+"
+RDEPEND="
+	${PHP_DEPEND}
+	${DEPEND}
+	>=www-apps/icingaweb2-module-incubator-0.18.0
+	>=dev-libs/icinga-php-library-0.5.0
+	>=dev-libs/icinga-php-thirdparty-0.9.0
+	>=www-apps/icingaweb2-2.9.0
+"
 
 src_install() {
-	insinto "/usr/share/icingaweb2/modules/director/"
-	doins -r "${S}"/*
+	insinto /usr/share/icingaweb2/modules/${PN##*-}/
+	doins -r .
+
+	exeinto /usr/share/icingaweb2/bin/
+	doexe "${FILESDIR}"/icinga-director.sh
+
+	doinitd "${FILESDIR}"/director
+
 	keepdir /var/lib/${PN}
 	fowners icingadirector:icingaweb2 /var/lib/${PN}
 	fperms 0750 /var/lib/${PN}
 	sed -e "s|/usr/bin/icingacli|/usr/share/icingaweb2/bin/icingacli|g" \
-		contrib/systemd/icinga-director.service > "${T}/icinga-director.service" \
+		contrib/systemd/icinga-director.service > "${T}"/icinga-director.service \
 		|| die "failed to patch icinga-director.service"
-	systemd_dounit "${T}/icinga-director.service"
+	systemd_dounit "${T}"/icinga-director.service
 }
 
 pkg_postinst() {
-	elog "Please see the following documentation for installation"
-	elog "https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/02-Installation.md"
-	elog "or upgrading"
-	elog "https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/05-Upgrading.md"
+	# According to PMS this can be a space-separated list of version
+	# numbers, even though in practice it is typically just one.
+	local oldver
+	for oldver in ${REPLACING_VERSIONS}; do
+		if ver_test "${oldver}" -lt "1.10.0"; then
+			ewarn "You are upgrading from ${oldver} to ${PVR}"
+			ewarn "please read https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/05-Upgrading.md#upgrade-to-1.10.x"
+			ewarn "for breaking changes"
+			ewarn
+			ewarn "Also, don't forget to upgrade database schema."
+			ewarn "Otherwise icingaweb2-module-director will not work!"
+			ewarn "(Web GUI => Configuration => Modules => director => Configuration)"
+			ewarn
+			break
+		fi
+	done
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-13  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13  9:26 [gentoo-commits] repo/gentoo:master commit in: www-apps/icingaweb2-module-director/files/, www-apps/icingaweb2-module-director/ David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox