summaryrefslogtreecommitdiff
path: root/net-mail/mailgraph
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-mail/mailgraph
reinit the tree, so we can have metadata
Diffstat (limited to 'net-mail/mailgraph')
-rw-r--r--net-mail/mailgraph/Manifest8
-rw-r--r--net-mail/mailgraph/files/mailgraph.confd-new18
-rw-r--r--net-mail/mailgraph/files/mailgraph.initd-new35
-rw-r--r--net-mail/mailgraph/files/mailgraph.logrotate-new30
-rw-r--r--net-mail/mailgraph/mailgraph-1.14-r2.ebuild124
-rw-r--r--net-mail/mailgraph/metadata.xml8
6 files changed, 223 insertions, 0 deletions
diff --git a/net-mail/mailgraph/Manifest b/net-mail/mailgraph/Manifest
new file mode 100644
index 000000000000..2584dc089cde
--- /dev/null
+++ b/net-mail/mailgraph/Manifest
@@ -0,0 +1,8 @@
+AUX mailgraph.confd-new 646 SHA256 fdd9ac9a9e6a2b3855e0b1c89f0d85612cf947030d8298ab1ce686f157728fb6 SHA512 1f5b7f35db859be48aa935ba3936fea34653a1c8eaeeb8be0bb01fbc3644a10eaa636a508bfa5b987509ad59d390a52118f5b323a25044184b9e9a8046882710 WHIRLPOOL 0caf8c2b45ac57a64c538510db55a58809616098a73c6129fe2f6a596c63951e7959c708ffa164edb00040db26e9ef8c4b4fd2e0b0102a60693519e895cb4f13
+AUX mailgraph.initd-new 984 SHA256 4c164a97cc702884143ee71fb77440846e09eb2c88f730cfa11e21d621533d46 SHA512 e859488178bbb3f229a86f0f61bf0537664c1f6fd0761195e0111458671d8dc69998dad206f629e0dbe9c82248186075655a522b16b969ffd1c50d8ba825d3f1 WHIRLPOOL 4c10df8e74868b35e16304371bfadc959b026d771c7a86f6b2eaed7c326d9c208fd917f428ab6be33f4149de8fadabcfc246d8393e58536f3e3711b42ae66d61
+AUX mailgraph.logrotate-new 773 SHA256 6e319102938f09e9935ab25ce9701322b665b242a08badf3003c155ed4de51eb SHA512 a8fde20eb24964a0ab7efbe5e6ce0adc02e0d91daee519f4dd70049ac2f92fb53f63322128ae8716b64fb1aa28b7a2c55a8c647028ac73aff1687ad312d20baa WHIRLPOOL c0f54a4e13ee074b1d22c4682177f379cc71bcd5cdd798a6ad9a67484b25b76005e4d0a745461803599a78a8874312126f908c683560ab15a3a2bb9bb24d2731
+DIST mailgraph-1.14.tar.gz 22014 SHA256 50ea6ea8a33f5015926edd8b70a4d954ac27df4863514bddc5e69c948a7aac81 SHA512 3df0dae010ad166a157eb34a8b1fcf837ab42445d417855ea58937a75b74ca55c06044eefb6077a6117073c39a087bcdf5f58fe35c0e4d9c7d6b18bded7a0193 WHIRLPOOL 84540ee5138c5f311ab4b359732e1a267a19342b78cef8694d6bc5195db14fef877c0ec65b91ba8b9c5d7df1d388128ef123763ffe9b5f17a4141bc944445751
+EBUILD mailgraph-1.14-r2.ebuild 3724 SHA256 a5bb09df516ff7ced6368abaff04d4ba3f670ad1e22fc6165e266a8a0351ff4a SHA512 77484eaf2c63041bc780c18dd0120eaea06035c74526caba3b553f56fdb61189be6d13bfb5b3cc13ee059740f6bb9ae0cfef44f8de9cd80e7145abf9f4e6cedd WHIRLPOOL 72f076d51e936ad2f2d9cec53b740805a8cde8c497da5fe3a912892f7f2eca7738048426bfe766a610a327ca589cfcac0ad84fc8388439f78f4e1efb4f4121f8
+MISC ChangeLog 2665 SHA256 5a3032358ce093da10e295b41de8f85a26c2d7f8b7000fbead528548863ba04e SHA512 616ace7acaf09f45cf89e9970034553c223d0cb66d82697c96510dcde051bcaeafae3b8af35e15755240e7b2655f5bfe0f6688ec36ef7d3de838f2af8022dfbb WHIRLPOOL 239d446fb5ea1102da3ffd170d338d896809e8ad2898bc68bbe29a9df3c0f030e2759291350a3be253512485c3834f07f85ec000b4fc587d04664b34799fda7f
+MISC ChangeLog-2015 6346 SHA256 db02210c04be94b0513d24bfc918a018a4f72b38aebcdd734b77cba501b79032 SHA512 d9547ebd9fd94ff9625571a56b185c8c393427baa614352d096052cc4f3e2145475c2f0c9899358bea3e64a7feb1fa39db0ae83926048e0bdd6d9f7c660b6b50 WHIRLPOOL 37050d187fb766b4b5eb7ed07c4f0b4e5be4974facf2ebaca937cadcf19eb3877d7aa87e2313d4f3b1ca2512b7e64cfc9aaa1ccf9e34f45039529bcfa80ecde6
+MISC metadata.xml 250 SHA256 b71074f8cf023e8487d9c660f14e7005a54cbdc232d60fd8584073dfc9289b3c SHA512 64ce00687c47be8dd203fede0460d4ff5f5bb741da301d30366ed8d041fce65298e8091bcd59423e86819d62e3e8f4989652f21e8c1b50eb541c65c7788c605c WHIRLPOOL ffbddb433281246099ce9093439006a2a46077d88e8cbb1f053f8a5acd39e844ba2edd47641cc3efc04d5cff46c485c26b5d164a5f82fbbe622bb786e001a524
diff --git a/net-mail/mailgraph/files/mailgraph.confd-new b/net-mail/mailgraph/files/mailgraph.confd-new
new file mode 100644
index 000000000000..a027254ed642
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.confd-new
@@ -0,0 +1,18 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Location of logfile that all (!) mail software (MTA, spamfilter etc.) logs to.
+# mailgraph defaults to /var/log/syslog if unspecified
+MG_LOGFILE="/var/log/messages"
+
+# Required daemon settings
+MG_DAEMON_UID="mgraph"
+MG_DAEMON_GID="adm"
+MG_DAEMON_UMASK="0022"
+MG_DAEMON_LOG="/var/log/mailgraph/mailgraph.log"
+MG_DAEMON_PID="/var/run/mailgraph/mailgraph.pid"
+MG_DAEMON_RRD="/var/lib/mailgraph"
+
+# Specify any extra options here.
+# If MG_LOGFILE is in metalog format, add "-t metalog" to MG_DAEMON_OPTS
+MG_DAEMON_OPTS="--ignore-localhost"
diff --git a/net-mail/mailgraph/files/mailgraph.initd-new b/net-mail/mailgraph/files/mailgraph.initd-new
new file mode 100644
index 000000000000..564f714e3dc4
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.initd-new
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ ebegin "Starting mailgraph"
+
+ # read mail log messages somewhere other than /var/log/syslog?
+ [[ -n "${MG_LOGFILE}" ]] && MG_DAEMON_OPTS="${MG_DAEMON_OPTS} -l ${MG_LOGFILE}"
+
+ # create /var/run/mailgraph if necessary
+ if [ ! -d /var/run/mailgraph ] ; then
+ checkpath -q -d -o mgraph:adm -m 0775 /var/run/mailgraph || return 1
+ fi
+
+ UMASK=$(umask)
+ umask ${MG_DAEMON_UMASK:-0077}
+ start-stop-daemon --start \
+ --name mailgraph \
+ --user "${MG_DAEMON_UID}:${MG_DAEMON_GID}" \
+ --name mailgraph \
+ --pidfile ${MG_DAEMON_PID} \
+ --exec /usr/bin/mailgraph -- -v --daemon \
+ --daemon-log="${MG_DAEMON_LOG}" \
+ --daemon-pid="${MG_DAEMON_PID}" \
+ --daemon-rrd=/var/lib/mailgraph ${MG_DAEMON_OPTS}
+ eend $?
+ umask "${UMASK}"
+}
+
+stop() {
+ ebegin "Shutting down mailgraph"
+ start-stop-daemon --stop --quiet --pidfile "${MG_DAEMON_PID}"
+ eend $?
+}
diff --git a/net-mail/mailgraph/files/mailgraph.logrotate-new b/net-mail/mailgraph/files/mailgraph.logrotate-new
new file mode 100644
index 000000000000..a48f2dd10d4d
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.logrotate-new
@@ -0,0 +1,30 @@
+# logrotate config for mailgraph log
+
+/var/log/mailgraph/mailgraph.log {
+ ## rotate daily
+ daily
+ ## keep 30 old copies
+ rotate 30
+ ## use .YYYYMMDD instead of .0,.1,.2 etc.
+ dateext
+ ## also rotate empty logfiles to strictly retain chronology
+ ifempty
+ ## re-create source logfile with original permissions
+ ## do NOT use copy or copytruncate!
+ create
+ ## compress on next logrotate run (e.g. next day) to give
+ ## programs the chance to close the old logfile
+ delaycompress
+ ## compress logfiles
+ compress
+ compresscmd /bin/gzip
+ compressoptions -9
+ uncompresscmd /bin/gunzip
+ ## don't throw an error when a file doesn't exist
+ missingok
+ ## restart mailgraph after rotating all logfiles
+ sharedscripts
+ postrotate
+ /etc/init.d/mailgraph restart >/dev/null
+ endscript
+}
diff --git a/net-mail/mailgraph/mailgraph-1.14-r2.ebuild b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
new file mode 100644
index 000000000000..732d4934e48d
--- /dev/null
+++ b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+inherit eutils user
+
+DESCRIPTION="A mail statistics RRDtool frontend for Postfix"
+HOMEPAGE="http://mailgraph.schweikert.ch/"
+SRC_URI="http://mailgraph.schweikert.ch//pub/${P}.tar.gz"
+
+LICENSE="GPL-2"
+# Change SLOT to 0 when appropriate
+SLOT="1.14"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="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"
+}
+
+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
+ dodir /var/run
+ diropts -omgraph -gadm -m0750
+ dodir /var/log/mailgraph
+ keepdir /var/log/mailgraph
+
+ # logrotate config for mailgraph log
+ diropts ""
+ dodir /etc/logrotate.d
+ insopts -m0644
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/mailgraph.logrotate-new mailgraph
+
+ # mailgraph daemon
+ newbin mailgraph.pl mailgraph
+
+ # mailgraph CGI script
+ exeinto /usr/share/${PN}
+ doexe mailgraph.cgi
+ insinto /usr/share/${PN}
+ doins mailgraph.css
+
+ # init/conf files for mailgraph daemon
+ newinitd "${FILESDIR}"/mailgraph.initd-new mailgraph
+ newconfd "${FILESDIR}"/mailgraph.confd-new mailgraph
+
+ # docs
+ dodoc README CHANGES
+}
+
+pkg_postinst() {
+ # Fix ownerships - previous versions installed these with
+ # root as owner
+ if [[ ${REPLACING_VERSIONS} < 1.13 ]] ; then
+ if [[ -d /var/lib/mailgraph ]] ; then
+ chown mgraph:mgraph /var/lib/mailgraph
+ fi
+ if [[ -d /var/log/mailgraph ]] ; then
+ chown mgraph:adm /var/log/mailgraph
+ fi
+ if [[ -d /var/run/mailgraph ]] ; then
+ chown mgraph:adm /var/run/mailgraph
+ fi
+ fi
+ elog "Mailgraph will run as user mgraph with group adm by default."
+ 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
+ ewarn "Please make sure *all* mail related logs (MTA, spamfilter, virus scanner)"
+ 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
+ elog "Adding user apache to group mgraph so the included"
+ elog "CGI script is able to read the mailgraph RRD files"
+ if ! gpasswd -a apache mgraph >&/dev/null; then
+ eerror "Failed to add user apache to group mgraph!"
+ eerror "Please check manually."
+ fi
+ else
+ elog
+ elog "User apache not found, maybe we will be running a"
+ elog "webserver with a different UID?"
+ elog "If that's the case, please add that user to the"
+ elog "group mgraph manually to enable the included"
+ elog "CGI script to read the mailgraph RRD files:"
+ 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."
+}
diff --git a/net-mail/mailgraph/metadata.xml b/net-mail/mailgraph/metadata.xml
new file mode 100644
index 000000000000..493a4bf9e88a
--- /dev/null
+++ b/net-mail/mailgraph/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+</pkgmetadata>