summaryrefslogtreecommitdiff
path: root/mail/exilog
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-06-05 18:22:26 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-06-05 18:22:26 +0000
commit40765b8a022abb87566e53f11ee455051770659c (patch)
tree812a5047f9882875d10fe8be3a58226143680f8f /mail/exilog
parent- Update to 1.3.3 (diff)
Exilog is very nice utility to parse and visualize logs from multiply exim
servers. PR: ports/81899 Submitted by: Vsevolod Stakhov <vsevolod@highsecure.ru>
Notes
Notes: svn path=/head/; revision=136846
Diffstat (limited to 'mail/exilog')
-rw-r--r--mail/exilog/Makefile88
-rw-r--r--mail/exilog/distinfo2
-rw-r--r--mail/exilog/files/exilog.sh30
-rw-r--r--mail/exilog/files/htaccess3
-rw-r--r--mail/exilog/files/patch-exilog_agent.pl15
-rw-r--r--mail/exilog/pkg-descr6
-rw-r--r--mail/exilog/pkg-plist25
7 files changed, 169 insertions, 0 deletions
diff --git a/mail/exilog/Makefile b/mail/exilog/Makefile
new file mode 100644
index 000000000000..001384e6db9c
--- /dev/null
+++ b/mail/exilog/Makefile
@@ -0,0 +1,88 @@
+# New ports collection makefile for: exilog
+# Date created: 03 Jun 2005
+# Whom: Vsevolod Stakhov <vsevolod@highsecure.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= exilog
+PORTVERSION= 0.2
+CATEGORIES= mail
+MASTER_SITES= http://duncanthrax.net/exilog/
+
+MAINTAINER= vsevolod@highsecure.ru
+COMMENT= Tool to centralize and visualize Exim logs with a web front end
+
+RUN_DEPENDS= ${SITE_PERL}/Net/Netmask.pm:${PORTSDIR}/net-mgmt/p5-Net-Netmask
+
+USE_PERL5= yes
+USE_APACHE= yes
+USE_REINPLACE= yes
+NO_BUILD= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
+# Default sql backend
+WITH_SQL_BACKEND?= mysql
+
+.if (${WITH_SQL_BACKEND} == "mysql")
+WITH_MYSQL= yes
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql
+.elif (${WITH_SQL_BACKEND} == "postgresql")
+WITH_POSTGRESQL= yes
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/pg.pm:${PORTSDIR}/databases/p5-DBD-pg
+.else
+BROKEN= "You should specify sql backend using WITH_SQL_BACKEND"
+.endif
+
+.ifndef WITHOUT_WWWDIR
+EXILOGDIR?= ${PREFIX}/www/exilog
+.else
+EXILOGDIR?= ${PREFIX}/exilog
+.endif
+
+.if defined(NO_AGENT)
+PLIST_SUB+= AGENT="@comment "
+.else
+USE_RC_SUBR= yes
+PLIST_SUB+= AGENT=""
+.endif
+
+PLIST_SUB+= EXILOGDIR="${EXILOGDIR:S,^${PREFIX}/,,}"
+
+.if !defined(NOPORTDOCS)
+PORTDOC_FILES= doc/Changelog \
+ doc/exilog.txt \
+ doc/mysql-db-script.sql \
+ doc/pgsql-db-script.sql
+.endif
+
+pre-patch:
+ @${REINPLACE_CMD} -e 's,$$RealBin/exilog.conf,${PREFIX}/etc/exilog.conf,' ${WRKSRC}/exilog_config.pm
+ @${REINPLACE_CMD} -e "s,\(use exilog_config\),use lib \'${EXILOGDIR}\'; \1," ${WRKSRC}/exilog_agent.pl
+ @${REINPLACE_CMD} -e "s,\(use exilog_config\),use lib \'${EXILOGDIR}\'; \1," ${WRKSRC}/exilog_cleanup.pl
+ @${SED} -e 's,%%RC_SUBR%%,${RC_SUBR},' \
+ -e 's,%%PREFIX%%,${PREFIX},' ${FILESDIR}/exilog.sh > ${WRKDIR}/exilog.sh
+
+do-install:
+ @${MKDIR} ${EXILOGDIR}
+ @${CP} ${WRKSRC}/*.pm ${WRKSRC}/*.css ${WRKSRC}/*.js ${EXILOGDIR}
+.if !defined(NO_AGENT)
+ @${INSTALL_SCRIPT} ${WRKSRC}/exilog_agent.pl ${PREFIX}/sbin
+.endif
+ @${INSTALL_SCRIPT} ${WRKSRC}/exilog_cleanup.pl ${PREFIX}/sbin
+ @${INSTALL_SCRIPT} ${WRKSRC}/exilog_cgi.pl ${EXILOGDIR}
+ @${CP} ${WRKSRC}/exilog.conf-example ${PREFIX}/etc/exilog.conf-dist
+ @${CHMOD} 0600 ${PREFIX}/etc/exilog.conf-dist
+ @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/etc/exilog.conf-dist
+ @${CP} ${FILESDIR}/htaccess ${EXILOGDIR}/.htaccess
+.if !defined(NO_AGENT)
+ @${INSTALL_SCRIPT} ${WRKDIR}/exilog.sh ${PREFIX}/etc/rc.d
+.endif
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for docfile in ${PORTDOC_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
+.endfor
+.endif
+
+.include <bsd.port.mk>
diff --git a/mail/exilog/distinfo b/mail/exilog/distinfo
new file mode 100644
index 000000000000..79522d020caa
--- /dev/null
+++ b/mail/exilog/distinfo
@@ -0,0 +1,2 @@
+MD5 (exilog-0.2.tar.gz) = 4f027e5400cc76f580ac9ae760c34671
+Size (exilog-0.2.tar.gz) = 82240
diff --git a/mail/exilog/files/exilog.sh b/mail/exilog/files/exilog.sh
new file mode 100644
index 000000000000..7cdb69601691
--- /dev/null
+++ b/mail/exilog/files/exilog.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Add the following lines to /etc/rc.conf to enable exilog agent:
+#
+#exilog_enable="YES"
+
+. %%RC_SUBR%%
+
+name=exilog
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/exilog_agent.pl
+pidfile=/var/run/exilog.pid
+required_files=%%PREFIX%%/etc/exilog.conf
+
+# read settings, set default values
+load_rc_config $name
+: ${exilog_enable="NO"}
+
+case $1 in
+ stop)
+ kill `cat $pidfile`
+ rm -f $pidfile
+ ;;
+ *)
+ run_rc_command "$1"
+ ;;
+esac
diff --git a/mail/exilog/files/htaccess b/mail/exilog/files/htaccess
new file mode 100644
index 000000000000..b9817ba17f79
--- /dev/null
+++ b/mail/exilog/files/htaccess
@@ -0,0 +1,3 @@
+Options +ExecCGI
+AddHandler cgi-script .pl
+DirectoryIndex exilog_cgi.pl
diff --git a/mail/exilog/files/patch-exilog_agent.pl b/mail/exilog/files/patch-exilog_agent.pl
new file mode 100644
index 000000000000..4a970498a1a5
--- /dev/null
+++ b/mail/exilog/files/patch-exilog_agent.pl
@@ -0,0 +1,15 @@
+--- exilog_agent.pl.orig Sat Jun 4 19:36:03 2005
++++ exilog_agent.pl Sat Jun 4 19:39:00 2005
+@@ -46,7 +46,11 @@
+ };
+
+ setsid();
+-
++ my $me = "exilog";
++ my $pidfile = "/var/run/".$me.".pid";
++ open (PID,">$pidfile");
++ print PID $$;
++ close (PID);
+ # dup STDOUT/ERR
+ open(STDOUT, ">&LOG");
+ open(STDERR, ">&LOG");
diff --git a/mail/exilog/pkg-descr b/mail/exilog/pkg-descr
new file mode 100644
index 000000000000..5df4032318b1
--- /dev/null
+++ b/mail/exilog/pkg-descr
@@ -0,0 +1,6 @@
+Exilog is a tool to centralize and visualize Exim logs
+across multiple Exim servers with a web front end.
+It is used in addition to Exim's standard or syslog logging.
+It does not require changing Exim or its logging style.
+
+WWW: http://duncanthrax.net/exilog/
diff --git a/mail/exilog/pkg-plist b/mail/exilog/pkg-plist
new file mode 100644
index 000000000000..cdb7e834e017
--- /dev/null
+++ b/mail/exilog/pkg-plist
@@ -0,0 +1,25 @@
+%%AGENT%%@unexec [ ! -f /var/run/exilog.pid ] || %D/etc/rc.d/exilog.sh stop
+%%AGENT%%sbin/exilog_agent.pl
+%%AGENT%%etc/rc.d/exilog.sh
+sbin/exilog_cleanup.pl
+%%EXILOGDIR%%/exilog_cgi.pl
+%%EXILOGDIR%%/exilog_cgi_html.pm
+%%EXILOGDIR%%/exilog_cgi_messages.pm
+%%EXILOGDIR%%/exilog_cgi_param.pm
+%%EXILOGDIR%%/exilog_cgi_queues.pm
+%%EXILOGDIR%%/exilog_cgi_servers.pm
+%%EXILOGDIR%%/exilog_config.pm
+%%EXILOGDIR%%/exilog_parse.pm
+%%EXILOGDIR%%/exilog_sql.pm
+%%EXILOGDIR%%/exilog_util.pm
+%%EXILOGDIR%%/exilog_jscript.js
+%%EXILOGDIR%%/exilog_stylesheet.css
+%%EXILOGDIR%%/.htaccess
+etc/exilog.conf-dist
+%%PORTDOCS%%%%DOCSDIR%%/Changelog
+%%PORTDOCS%%%%DOCSDIR%%/exilog.txt
+%%PORTDOCS%%%%DOCSDIR%%/mysql-db-script.sql
+%%PORTDOCS%%%%DOCSDIR%%/pgsql-db-script.sql
+
+@dirrm %%EXILOGDIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%