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 /app-admin/swatch
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 'app-admin/swatch')
-rw-r--r--app-admin/swatch/Manifest1
-rw-r--r--app-admin/swatch/files/swatch-confd25
-rw-r--r--app-admin/swatch/files/swatch-init53
-rw-r--r--app-admin/swatch/files/swatch-initd52
-rw-r--r--app-admin/swatch/files/swatchrc10
-rw-r--r--app-admin/swatch/metadata.xml24
-rw-r--r--app-admin/swatch/swatch-3.2.3-r2.ebuild31
7 files changed, 196 insertions, 0 deletions
diff --git a/app-admin/swatch/Manifest b/app-admin/swatch/Manifest
new file mode 100644
index 000000000000..37fb6988ba3c
--- /dev/null
+++ b/app-admin/swatch/Manifest
@@ -0,0 +1 @@
+DIST swatch-3.2.3.tar.gz 31199 SHA256 e29480993e52f245f3abec079b3103d8e97244dafe754f8c2d37e7b0b3b58077 SHA512 8020fb99b7acfc322b2a80d8fd9669fc97f272c33b19a36ef1be025ffd1a463658e9b0cc5ddbac02b12a68db9e148da53734beb632677ef88337848bbd60e90f WHIRLPOOL 2fa2ff6dacec9bb527814b041951cfd5c48760cad3a94afcfe362bd13b38f0ea9b970aa7ff4882b30a5dabd79a552ea6e0ac8397e350ef88aa6569cdd7369bf3
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-init b/app-admin/swatch/files/swatch-init
new file mode 100644
index 000000000000..cd622de5e59d
--- /dev/null
+++ b/app-admin/swatch/files/swatch-init
@@ -0,0 +1,53 @@
+#!/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() {
+ checkpath -d -q -m 0750 -o root:root /var/run/swatch
+ 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/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/files/swatchrc b/app-admin/swatch/files/swatchrc
new file mode 100644
index 000000000000..92e88ded1ef5
--- /dev/null
+++ b/app-admin/swatch/files/swatchrc
@@ -0,0 +1,10 @@
+#
+# A sample configuration file for swatch.
+#
+# See "man swatch" for details.
+
+# Mails root when invalid remote login attempted.
+watchfor /(.*) (.*) (.*) (.*) (.*):( [iI]nvalid [uU]ser )(.*)( from )(.*)$/
+ threshold track_by=$9,type=limit,count=3,seconds=30
+ mail root,subject="Invalid user"
+
diff --git a/app-admin/swatch/metadata.xml b/app-admin/swatch/metadata.xml
new file mode 100644
index 000000000000..9180d4d30061
--- /dev/null
+++ b/app-admin/swatch/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>nimiux@gentoo.org</email>
+ <name>Chema Alonso</name>
+ </maintainer>
+ <longdescription lang="en">
+ Swatch.pl started out as the "simple watchdog" for actively
+ monitoring log files produced by UNIX's syslog facility.
+ It has since been evolving into a utility that can monitor
+ just about any type of log.
+ </longdescription>
+ <longdescription lang="es">
+ Swatch.pl comenzó como el "simple perro guardián" para
+ monitorizar activamente ficheros de registro producidos por
+ la capacidad syslog de los sistemas UNIX. Desde entonces ha
+ evolucionado hacia una utilidad que puede monitorizar cualquier
+ tipo de registro.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">swatch</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-admin/swatch/swatch-3.2.3-r2.ebuild b/app-admin/swatch/swatch-3.2.3-r2.ebuild
new file mode 100644
index 000000000000..493fd1c6ce4f
--- /dev/null
+++ b/app-admin/swatch/swatch-3.2.3-r2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+GENTOO_DEPEND_ON_PERL_SUBSLOT=yes
+inherit perl-app
+
+DESCRIPTION="Perl-based system log watcher"
+HOMEPAGE="http://sourceforge.net/projects/swatch/"
+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
+ newinitd "${FILESDIR}/${PN}-init" "${PN}"
+ newconfd "${FILESDIR}/${PN}-confd" "${PN}"
+ insinto /etc
+ doins "${FILESDIR}/swatchrc"
+}