commit:     c6ca2904b1e87ef2bb336c88375ccecbcfdc2705
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 24 21:01:16 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Oct 24 21:01:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6ca2904

net-mail/mailgraph: Port to EAPI 7

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

 .../mailgraph/files/mailgraph-1.14-homedir.patch   | 13 +++++++
 net-mail/mailgraph/mailgraph-1.14-r2.ebuild        | 42 ++++++++--------------
 2 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch 
b/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch
new file mode 100644
index 00000000000..3d1154f3626
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch
@@ -0,0 +1,13 @@
+--- a/mailgraph.cgi
++++ b/mailgraph.cgi
+@@ -16,8 +16,8 @@
+ my $points_per_sample = 3;
+ my $ypoints = 160;
+ my $ypoints_err = 96;
+-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
+-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database 
is
++my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD 
database is
++my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the 
Virus RRD database is
+ my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the 
images
+ 
+ my @graphs = (

diff --git a/net-mail/mailgraph/mailgraph-1.14-r2.ebuild 
b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
index 9d60fa3552b..76c14702b18 100644
--- a/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
+++ b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
@@ -1,8 +1,7 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
-inherit eutils user
+EAPI=7
 
 DESCRIPTION="A mail statistics RRDtool frontend for Postfix"
 HOMEPAGE="http://mailgraph.schweikert.ch/";
@@ -12,36 +11,20 @@ LICENSE="GPL-2"
 # Change SLOT to 0 when appropriate
 SLOT="1.14"
 KEYWORDS="amd64 x86"
-IUSE=""
 
-RDEPEND="dev-lang/perl
+# for the RRDs
+DEPEND="
+       acct-group/mgraph
+       acct-user/mgraph"
+RDEPEND="
+       ${DEPEND}
+       dev-lang/perl
        dev-perl/File-Tail
        >=net-analyzer/rrdtool-1.2.2[graph,perl]"
-DEPEND=">=sys-apps/sed-4"
 
-pkg_setup() {
-       # add user and group for mailgraph daemon
-       # also add mgraph to the group adm so it's able to
-       # read syslog logfile /var/log/messages (should be owned by
-       # root:adm with permission 0640)
-       enewgroup mgraph
-       enewuser mgraph -1 -1 /var/empty mgraph,adm
-}
-
-src_prepare() {
-       sed -i \
-               -e "s|\(my \$rrd = '\).*'|\1/var/lib/mailgraph/mailgraph.rrd'|" 
\
-               -e "s|\(my \$rrd_virus = 
'\).*'|\1/var/lib/mailgraph/mailgraph_virus.rrd'|" \
-               mailgraph.cgi || die "sed mailgraph.cgi failed"
-}
+PATCHES=( "${FILESDIR}"/${PN}-1.14-homedir.patch )
 
 src_install() {
-       # for the RRDs
-       dodir /var/lib
-       diropts -omgraph -gmgraph -m0750
-       dodir /var/lib/mailgraph
-       keepdir /var/lib/mailgraph
-
        # log and pid file
        diropts ""
        dodir /var/log
@@ -61,9 +44,9 @@ src_install() {
        newbin mailgraph.pl mailgraph
 
        # mailgraph CGI script
-       exeinto /usr/share/${PN}
+       exeinto /usr/share/mailgraph
        doexe mailgraph.cgi
-       insinto  /usr/share/${PN}
+       insinto /usr/share/mailgraph
        doins mailgraph.css
 
        # init/conf files for mailgraph daemon
@@ -79,6 +62,7 @@ pkg_postinst() {
        elog "This can be changed in /etc/conf.d/mailgraph if it doesn't fit."
        elog "Remember to adjust MG_DAEMON_LOG, MG_DAEMON_PID and MG_DAEMON_RRD"
        elog "as well!"
+
        ewarn "Please make sure the MG_LOGFILE (default: /var/log/messages) is 
readable"
        ewarn "by group adm or change MG_DAEMON_GID in /etc/conf.d/mailgraph 
accordingly!"
        ewarn
@@ -86,6 +70,7 @@ pkg_postinst() {
        ewarn "go to the file /var/log/messages or change MG_LOGFILE in"
        ewarn "/etc/conf.d/mailgraph accordingly! Otherwise mailgraph won't get 
to know"
        ewarn "the corresponding events (virus/spam mail found etc.)."
+
        elog
        elog "Checking for user apache:"
        if egetent passwd apache >&/dev/null; then
@@ -105,6 +90,7 @@ pkg_postinst() {
                elog
                elog "\tgpasswd -a <user> mgraph"
        fi
+
        ewarn
        ewarn "mailgraph.cgi is installed in /usr/share/${PN}/"
        ewarn "You need to put it somewhere accessible though a web-server."

Reply via email to