Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/mailgraph/files/, net-mail/mailgraph/
Date: Sat, 24 Oct 2020 21:01:36
Message-Id: 1603573276.c6ca2904b1e87ef2bb336c88375ccecbcfdc2705.soap@gentoo
1 commit: c6ca2904b1e87ef2bb336c88375ccecbcfdc2705
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 24 21:01:16 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 24 21:01:16 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6ca2904
7
8 net-mail/mailgraph: Port to EAPI 7
9
10 Closes: https://bugs.gentoo.org/742227
11 Package-Manager: Portage-3.0.8, Repoman-3.0.2
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 .../mailgraph/files/mailgraph-1.14-homedir.patch | 13 +++++++
15 net-mail/mailgraph/mailgraph-1.14-r2.ebuild | 42 ++++++++--------------
16 2 files changed, 27 insertions(+), 28 deletions(-)
17
18 diff --git a/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch b/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch
19 new file mode 100644
20 index 00000000000..3d1154f3626
21 --- /dev/null
22 +++ b/net-mail/mailgraph/files/mailgraph-1.14-homedir.patch
23 @@ -0,0 +1,13 @@
24 +--- a/mailgraph.cgi
25 ++++ b/mailgraph.cgi
26 +@@ -16,8 +16,8 @@
27 + my $points_per_sample = 3;
28 + my $ypoints = 160;
29 + my $ypoints_err = 96;
30 +-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
31 +-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
32 ++my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
33 ++my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
34 + my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
35 +
36 + my @graphs = (
37
38 diff --git a/net-mail/mailgraph/mailgraph-1.14-r2.ebuild b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
39 index 9d60fa3552b..76c14702b18 100644
40 --- a/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
41 +++ b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
42 @@ -1,8 +1,7 @@
43 # Copyright 1999-2020 Gentoo Authors
44 # Distributed under the terms of the GNU General Public License v2
45
46 -EAPI=4
47 -inherit eutils user
48 +EAPI=7
49
50 DESCRIPTION="A mail statistics RRDtool frontend for Postfix"
51 HOMEPAGE="http://mailgraph.schweikert.ch/"
52 @@ -12,36 +11,20 @@ LICENSE="GPL-2"
53 # Change SLOT to 0 when appropriate
54 SLOT="1.14"
55 KEYWORDS="amd64 x86"
56 -IUSE=""
57
58 -RDEPEND="dev-lang/perl
59 +# for the RRDs
60 +DEPEND="
61 + acct-group/mgraph
62 + acct-user/mgraph"
63 +RDEPEND="
64 + ${DEPEND}
65 + dev-lang/perl
66 dev-perl/File-Tail
67 >=net-analyzer/rrdtool-1.2.2[graph,perl]"
68 -DEPEND=">=sys-apps/sed-4"
69
70 -pkg_setup() {
71 - # add user and group for mailgraph daemon
72 - # also add mgraph to the group adm so it's able to
73 - # read syslog logfile /var/log/messages (should be owned by
74 - # root:adm with permission 0640)
75 - enewgroup mgraph
76 - enewuser mgraph -1 -1 /var/empty mgraph,adm
77 -}
78 -
79 -src_prepare() {
80 - sed -i \
81 - -e "s|\(my \$rrd = '\).*'|\1/var/lib/mailgraph/mailgraph.rrd'|" \
82 - -e "s|\(my \$rrd_virus = '\).*'|\1/var/lib/mailgraph/mailgraph_virus.rrd'|" \
83 - mailgraph.cgi || die "sed mailgraph.cgi failed"
84 -}
85 +PATCHES=( "${FILESDIR}"/${PN}-1.14-homedir.patch )
86
87 src_install() {
88 - # for the RRDs
89 - dodir /var/lib
90 - diropts -omgraph -gmgraph -m0750
91 - dodir /var/lib/mailgraph
92 - keepdir /var/lib/mailgraph
93 -
94 # log and pid file
95 diropts ""
96 dodir /var/log
97 @@ -61,9 +44,9 @@ src_install() {
98 newbin mailgraph.pl mailgraph
99
100 # mailgraph CGI script
101 - exeinto /usr/share/${PN}
102 + exeinto /usr/share/mailgraph
103 doexe mailgraph.cgi
104 - insinto /usr/share/${PN}
105 + insinto /usr/share/mailgraph
106 doins mailgraph.css
107
108 # init/conf files for mailgraph daemon
109 @@ -79,6 +62,7 @@ pkg_postinst() {
110 elog "This can be changed in /etc/conf.d/mailgraph if it doesn't fit."
111 elog "Remember to adjust MG_DAEMON_LOG, MG_DAEMON_PID and MG_DAEMON_RRD"
112 elog "as well!"
113 +
114 ewarn "Please make sure the MG_LOGFILE (default: /var/log/messages) is readable"
115 ewarn "by group adm or change MG_DAEMON_GID in /etc/conf.d/mailgraph accordingly!"
116 ewarn
117 @@ -86,6 +70,7 @@ pkg_postinst() {
118 ewarn "go to the file /var/log/messages or change MG_LOGFILE in"
119 ewarn "/etc/conf.d/mailgraph accordingly! Otherwise mailgraph won't get to know"
120 ewarn "the corresponding events (virus/spam mail found etc.)."
121 +
122 elog
123 elog "Checking for user apache:"
124 if egetent passwd apache >&/dev/null; then
125 @@ -105,6 +90,7 @@ pkg_postinst() {
126 elog
127 elog "\tgpasswd -a <user> mgraph"
128 fi
129 +
130 ewarn
131 ewarn "mailgraph.cgi is installed in /usr/share/${PN}/"
132 ewarn "You need to put it somewhere accessible though a web-server."