summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Smith <c1pher@gentoo.org>2011-07-06 12:23:00 +0000
committerDane Smith <c1pher@gentoo.org>2011-07-06 12:23:00 +0000
commitd843faa7e5cb04fd241c80c4c9a264c048141bde (patch)
tree6132b3ac4c0c75e616e7435570146ab9dd9bdebd /app-admin
parentVersion bump. Drop older. (diff)
downloadgentoo-2-d843faa7e5cb04fd241c80c4c9a264c048141bde.tar.gz
gentoo-2-d843faa7e5cb04fd241c80c4c9a264c048141bde.tar.bz2
gentoo-2-d843faa7e5cb04fd241c80c4c9a264c048141bde.zip
app-admin/swatch: Revision bump. Add init and conf scripts. Update maintainer info.
(Portage version: 2.2.0_alpha43/cvs/Linux x86_64)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/swatch/ChangeLog9
-rw-r--r--app-admin/swatch/files/swatch-confd25
-rw-r--r--app-admin/swatch/files/swatch-initd52
-rw-r--r--app-admin/swatch/metadata.xml7
-rw-r--r--app-admin/swatch/swatch-3.2.3-r1.ebuild31
5 files changed, 122 insertions, 2 deletions
diff --git a/app-admin/swatch/ChangeLog b/app-admin/swatch/ChangeLog
index dc447d7c97f7..aa0d6aa2408c 100644
--- a/app-admin/swatch/ChangeLog
+++ b/app-admin/swatch/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/swatch
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/ChangeLog,v 1.21 2011/06/16 17:09:17 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/ChangeLog,v 1.22 2011/07/06 12:23:00 c1pher Exp $
+
+*swatch-3.2.3-r1 (06 Jul 2011)
+
+ 06 Jul 2011; Dane Smith <c1pher@gentoo.org> +swatch-3.2.3-r1.ebuild,
+ +files/swatch-confd, +files/swatch-initd, metadata.xml:
+ Revision bump. Add init script and conf script.
+ Update maintainer info. Adopted by Chema Alonso with me as Proxy.
*swatch-3.2.3 (16 Jun 2011)
diff --git a/app-admin/swatch/files/swatch-confd b/app-admin/swatch/files/swatch-confd
new file mode 100644
index 000000000000..813a2a084fc7
--- /dev/null
+++ b/app-admin/swatch/files/swatch-confd
@@ -0,0 +1,25 @@
+# /etc/conf.d/swatch: config file for /etc/init.d/swatch
+
+# Path to the swatch program.
+#SWATCH_BINARY="/usr/bin/swatch"
+
+# Swatchrc to read patterns and actions from.
+#SWATCHRC="/etc/swatchrc"
+
+# File to monitor
+#SWATCH_TAILFILE="/var/log/syslog"
+
+# Arguments to tail program
+#SWATCH_TAILARGS=""
+
+# Swatch log file
+#SWATCH_LOGFILE="/var/log/swatch.log"
+
+# Swatch error file
+#SWATCH_ERRFILE="/var/log/swatch-err.log"
+
+# Where to output the generated script to. Should not be writable by others.
+#SWATCH_SCRIPT="/var/run/swatch/swatch_script.pl"
+
+# Whether to parse the complete file once at startup. Defaults to "NO".
+PARSE_FULL="NO"
diff --git a/app-admin/swatch/files/swatch-initd b/app-admin/swatch/files/swatch-initd
new file mode 100644
index 000000000000..f1a25a66a209
--- /dev/null
+++ b/app-admin/swatch/files/swatch-initd
@@ -0,0 +1,52 @@
+#!/sbin/runscript
+# This script is based on the one created by Phil (bug #255329).
+
+depend() {
+ need logger
+}
+
+SWATCH_BINARY=${SWATCH_BINARY:-/usr/bin/swatch}
+SWATCHRC=${SWATCHRC:-/etc/swatchrc}
+SWATCH_TAILFILE=${SWATCH_TAILFILE:-/var/log/syslog}
+SWATCH_LOGFILE=${SWATCH_LOGFILE:-/var/log/swatch.log}
+SWATCH_ERRFILE=${SWATCH_ERRFILE:-/var/log/swatch-err.log}
+SWATCH_SCRIPT=${SWATCH_SCRIPT:-/var/run/swatch/swatch_script.pl}
+
+gen_script() {
+ local tailargs=""
+ if [ "${SWATCH_TAILARGS}" ]; then
+ tailargs="--tail-args=\"${SWATCH_TAILARGS}\""
+ fi
+ ebegin "Generating swatch script from config"
+ ${SWATCH_BINARY} --dump-script="${SWATCH_SCRIPT}" \
+ --use-cpan-file-tail ${tailargs} \
+ --config-file "${SWATCHRC}" $1 "${SWATCH_TAILFILE}"
+ eend $?
+}
+
+parse_full() {
+ gen_script --examine
+ ebegin "Parsing complete file once"
+ /usr/bin/perl ${SWATCH_SCRIPT} 1>/dev/null
+ eend $?
+}
+
+start() {
+ if [ "${PARSE_FULL}" == "YES" ]; then
+ parse_full
+ fi
+ gen_script --tail-file
+ ebegin "Starting swatch"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile /var/run/swatch/swatch.pid \
+ --stdout ${SWATCH_LOGFILE} --stderr ${SWATCH_ERRFILE} \
+ --exec /usr/bin/perl -- ${SWATCH_SCRIPT}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping swatch"
+ start-stop-daemon --stop --exec /usr/bin/perl \
+ --pidfile /var/run/swatch/swatch.pid --quiet
+ eend $?
+}
diff --git a/app-admin/swatch/metadata.xml b/app-admin/swatch/metadata.xml
index 73420b6cf0f0..133522523076 100644
--- a/app-admin/swatch/metadata.xml
+++ b/app-admin/swatch/metadata.xml
@@ -3,6 +3,11 @@
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
- <email>maintainer-needed@gentoo.org</email>
+ <email>nimiux@gentoo.org</email>
+ <name>Chema Alonso</name>
+</maintainer>
+<maintainer>
+ <email>c1pher@gentoo.org</email>
+ <name>Dane Smith</name>
</maintainer>
</pkgmetadata>
diff --git a/app-admin/swatch/swatch-3.2.3-r1.ebuild b/app-admin/swatch/swatch-3.2.3-r1.ebuild
new file mode 100644
index 000000000000..3eeb331ee7e8
--- /dev/null
+++ b/app-admin/swatch/swatch-3.2.3-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/swatch/swatch-3.2.3-r1.ebuild,v 1.1 2011/07/06 12:23:00 c1pher Exp $
+
+EAPI="4"
+
+inherit perl-app
+
+DESCRIPTION="Perl-based system log watcher"
+HOMEPAGE="http://swatch.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-perl/DateManip
+ dev-perl/Date-Calc
+ dev-perl/File-Tail
+ dev-perl/TimeDate
+ >=virtual/perl-Time-HiRes-1.12
+"
+
+src_install() {
+ emake install
+ dodir "/var/run/swatch"
+ newinitd "${FILESDIR}"/${PN}-initd ${PN}
+ newconfd "${FILESDIR}"/${PN}-confd ${PN}
+}