summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-mail/mailgraph
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-mail/mailgraph')
-rw-r--r--net-mail/mailgraph/Manifest1
-rw-r--r--net-mail/mailgraph/files/mailgraph.confd-new19
-rw-r--r--net-mail/mailgraph/files/mailgraph.initd-new36
-rw-r--r--net-mail/mailgraph/files/mailgraph.logrotate-new31
-rw-r--r--net-mail/mailgraph/mailgraph-1.14-r2.ebuild125
-rw-r--r--net-mail/mailgraph/metadata.xml5
6 files changed, 217 insertions, 0 deletions
diff --git a/net-mail/mailgraph/Manifest b/net-mail/mailgraph/Manifest
new file mode 100644
index 00000000000..bedc68fefbb
--- /dev/null
+++ b/net-mail/mailgraph/Manifest
@@ -0,0 +1 @@
+DIST mailgraph-1.14.tar.gz 22014 SHA256 50ea6ea8a33f5015926edd8b70a4d954ac27df4863514bddc5e69c948a7aac81 SHA512 3df0dae010ad166a157eb34a8b1fcf837ab42445d417855ea58937a75b74ca55c06044eefb6077a6117073c39a087bcdf5f58fe35c0e4d9c7d6b18bded7a0193 WHIRLPOOL 84540ee5138c5f311ab4b359732e1a267a19342b78cef8694d6bc5195db14fef877c0ec65b91ba8b9c5d7df1d388128ef123763ffe9b5f17a4141bc944445751
diff --git a/net-mail/mailgraph/files/mailgraph.confd-new b/net-mail/mailgraph/files/mailgraph.confd-new
new file mode 100644
index 00000000000..54ac0f0fe09
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.confd-new
@@ -0,0 +1,19 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# 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 00000000000..13de88b1bb7
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.initd-new
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 00000000000..61972c1ddfe
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.logrotate-new
@@ -0,0 +1,31 @@
+# $Id$
+# 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 00000000000..304884db2a4
--- /dev/null
+++ b/net-mail/mailgraph/mailgraph-1.14-r2.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 00000000000..196134491c7
--- /dev/null
+++ b/net-mail/mailgraph/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+</pkgmetadata>