commit:     dda04ca9110dd9abbd8262c37c5d2b026f4f69e8
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 24 17:18:40 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Oct 24 17:18:40 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dda04ca9

net-analyzer/nsca: Port to EAPI 7

Closes: https://bugs.gentoo.org/742218
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-analyzer/nsca/nsca-2.7.2-r103.ebuild | 41 ++++++++++++++++----------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/net-analyzer/nsca/nsca-2.7.2-r103.ebuild 
b/net-analyzer/nsca/nsca-2.7.2-r103.ebuild
index 9fe0ae002f7..c7120d06b66 100644
--- a/net-analyzer/nsca/nsca-2.7.2-r103.ebuild
+++ b/net-analyzer/nsca/nsca-2.7.2-r103.ebuild
@@ -1,9 +1,7 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
-
-inherit multilib user eutils
+EAPI=7
 
 DESCRIPTION="Nagios Service Check Acceptor"
 HOMEPAGE="https://www.nagios.org/";
@@ -15,28 +13,29 @@ KEYWORDS="~alpha amd64 ~arm ppc ppc64 sparc x86"
 IUSE="tcpd +crypt minimal"
 
 DEPEND="crypt? ( >=dev-libs/libmcrypt-2.5.1-r4 )
-       !minimal? ( tcpd? ( sys-apps/tcp-wrappers ) )"
-
+       !minimal? (
+               tcpd? ( sys-apps/tcp-wrappers )
+               acct-group/icinga
+               acct-group/nagios
+               acct-user/icinga
+               acct-user/nagios
+       )"
 RDEPEND="${DEPEND}
-       !minimal? ( || ( net-analyzer/icinga net-analyzer/nagios ) )
+       !minimal? (
+               || (
+                       net-analyzer/icinga
+                       net-analyzer/nagios
+               )
+       )
        sys-apps/openrc"
 
-pkg_setup() {
-       if ! use minimal; then
-               enewgroup nagios
-               enewgroup icinga
-               enewuser nagios -1 /bin/bash /var/nagios/home nagios
-               enewuser icinga -1 -1 /var/lib/icinga "icinga,nagios"
-       fi
-}
-
 src_configure() {
        use tcpd || export ac_cv_lib_wrap_main=no
        use crypt || export ac_cv_path_LIBMCRYPT_CONFIG=/bin/false
 
        econf \
-               --localstatedir=/var/nagios \
-               --sysconfdir=/etc/nagios \
+               --localstatedir="${EPREFIX}"/var/nagios \
+               --sysconfdir="${EPREFIX}"/etc/nagios \
                --with-nsca-user=nagios \
                --with-nsca-grp=nagios
 }
@@ -49,7 +48,7 @@ src_compile() {
                -e '/nsca_\(user\|group\)/s:nagios:icinga:' \
                -e '/nsca_chroot/s:=.*:=/var/lib/icinga/rw:' \
                -e 
'/\(command\|alternate_dump\)_file/s:/var/nagios:/var/lib/icinga:' \
-               "${S}"/sample-config/nsca.cfg > "${T}"/nsca.icinga.cfg
+               "${S}"/sample-config/nsca.cfg > "${T}"/nsca.icinga.cfg || die
 }
 
 src_install() {
@@ -58,7 +57,7 @@ src_install() {
        dobin src/send_nsca
 
        insinto /etc/nagios
-       doins "${S}"/sample-config/send_nsca.cfg
+       doins sample-config/send_nsca.cfg
 
        if ! use minimal; then
                exeinto /usr/libexec
@@ -68,7 +67,7 @@ src_install() {
                newconfd "${FILESDIR}"/nsca.conf nsca
 
                insinto /etc/nagios
-               doins "${S}"/sample-config/nsca.cfg
+               doins sample-config/nsca.cfg
 
                insinto /etc/icinga
                newins "${T}"/nsca.icinga.cfg nsca.cfg
@@ -79,7 +78,7 @@ pkg_postinst() {
        if ! use minimal; then
                elog "If you are using the nsca daemon, remember to edit"
                elog "the config file /etc/nagios/nsca.cfg"
-               elog ""
+               elog
                elog "If you intend to use nsca with Icinga, change the"
                elog "configuration file path in /etc/conf.d/nsca so that"
                elog "it will default to the correct paths and users."

Reply via email to