Gentoo Archives: gentoo-commits

From: "José María Alonso" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/swatchdog/files/, app-admin/swatchdog/
Date: Tue, 27 Sep 2016 07:36:52
Message-Id: 1474961785.9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927.nimiux@gentoo
1 commit: 9e2e57f1d1366669a1e0ae83fc1f8d474cd8e927
2 Author: Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 27 07:36:25 2016 +0000
4 Commit: José María Alonso <nimiux <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 07:36:25 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e2e57f1
7
8 app-admin/swatch: renamed to app-admin/swatchdog
9
10 To satisfy a request made by the old Swiss watch company
11
12 Package-Manager: portage-2.2.28
13
14 app-admin/swatchdog/Manifest | 1 +
15 app-admin/swatchdog/files/swatchdog-confd | 25 ++++++++++++++
16 app-admin/swatchdog/files/swatchdog-init | 53 ++++++++++++++++++++++++++++++
17 app-admin/swatchdog/files/swatchdogrc | 10 ++++++
18 app-admin/swatchdog/metadata.xml | 24 ++++++++++++++
19 app-admin/swatchdog/swatchdog-3.2.4.ebuild | 32 ++++++++++++++++++
20 6 files changed, 145 insertions(+)
21
22 diff --git a/app-admin/swatchdog/Manifest b/app-admin/swatchdog/Manifest
23 new file mode 100644
24 index 00000000..b4cc4e6
25 --- /dev/null
26 +++ b/app-admin/swatchdog/Manifest
27 @@ -0,0 +1 @@
28 +DIST swatchdog-3.2.4.tar.gz 30122 SHA256 5bb644d3750ee89b9aecab797df66b28b9fd174a5f0f96cd62367af8975b4f63 SHA512 4e0a4e3feed00df0f0d04f94cc090e53e71fa9b20d46236ec41d63b98b5733d80a5941b491cffcbb0b655a9c7d2b5c9423ca7ae043346dbe1b05ee6ab24b9489 WHIRLPOOL 1681139e54e5f665c2573983e8488859f907b3083f3ca1106faca137fb0b978cb0b90218899728ae8775334360b28ec4572f78415bca47a6d8a1a72be9f86ef5
29
30 diff --git a/app-admin/swatchdog/files/swatchdog-confd b/app-admin/swatchdog/files/swatchdog-confd
31 new file mode 100644
32 index 00000000..13f8a0a
33 --- /dev/null
34 +++ b/app-admin/swatchdog/files/swatchdog-confd
35 @@ -0,0 +1,25 @@
36 +# /etc/conf.d/swatchdog: config file for /etc/init.d/swatchdog
37 +
38 +# Path to the swatchdog program.
39 +#SWATCHDOG_BINARY="/usr/bin/swatchdog"
40 +
41 +# Swatchrc to read patterns and actions from.
42 +#SWATCHDOGRC="/etc/swatchdogrc"
43 +
44 +# File to monitor
45 +#SWATCHDOG_TAILFILE="/var/log/syslog"
46 +
47 +# Arguments to tail program
48 +#SWATCHDOG_TAILARGS=""
49 +
50 +# Swatch log file
51 +#SWATCHDOG_LOGFILE="/var/log/swatchdog.log"
52 +
53 +# Swatch error file
54 +#SWATCHDOG_ERRFILE="/var/log/swatchdog-err.log"
55 +
56 +# Where to output the generated script to. Should not be writable by others.
57 +#SWATCHDOG_SCRIPT="/run/swatchdog/swatchdog_script.pl"
58 +
59 +# Whether to parse the complete file once at startup. Defaults to "NO".
60 +PARSE_FULL="NO"
61
62 diff --git a/app-admin/swatchdog/files/swatchdog-init b/app-admin/swatchdog/files/swatchdog-init
63 new file mode 100644
64 index 00000000..7db43eb
65 --- /dev/null
66 +++ b/app-admin/swatchdog/files/swatchdog-init
67 @@ -0,0 +1,53 @@
68 +#!/sbin/openrc-run
69 +# This script is based on the one created by Phil (bug #255329).
70 +
71 +depend() {
72 + need logger
73 +}
74 +
75 +SWATCHDOG_BINARY=${SWATCHDOG_BINARY:-/usr/bin/swatchdog}
76 +SWATCHDOGRC=${SWATCHDOGRC:-/etc/swatchdogrc}
77 +SWATCHDOG_TAILFILE=${SWATCHDOG_TAILFILE:-/var/log/syslog}
78 +SWATCHDOG_LOGFILE=${SWATCHDOG_LOGFILE:-/var/log/swatchdog.log}
79 +SWATCHDOG_ERRFILE=${SWATCHDOG_ERRFILE:-/var/log/swatchdog-err.log}
80 +SWATCHDOG_SCRIPT=${SWATCHDOG_SCRIPT:-/run/swatchdog/swatchdog_script.pl}
81 +
82 +gen_script() {
83 + local tailargs=""
84 + if [ "${SWATCHDOG_TAILARGS}" ]; then
85 + tailargs="--tail-args=\"${SWATCHDOG_TAILARGS}\""
86 + fi
87 + ebegin "Generating swatchdog script from config"
88 + ${SWATCHDOG_BINARY} --dump-script="${SWATCHDOG_SCRIPT}" \
89 + --use-cpan-file-tail ${tailargs} \
90 + --config-file "${SWATCHDOGRC}" $1 "${SWATCHDOG_TAILFILE}"
91 + eend $?
92 +}
93 +
94 +parse_full() {
95 + gen_script --examine
96 + ebegin "Parsing complete file once"
97 + /usr/bin/perl ${SWATCHDOG_SCRIPT} 1>/dev/null
98 + eend $?
99 +}
100 +
101 +start() {
102 + checkpath -d -q -m 0750 -o root:root /run/swatchdog
103 + if [ "${PARSE_FULL}" == "YES" ]; then
104 + parse_full
105 + fi
106 + gen_script --tail-file
107 + ebegin "Starting swatchdog"
108 + start-stop-daemon --start --quiet --background \
109 + --make-pidfile --pidfile /run/swatchdog/swatchdog.pid \
110 + --stdout ${SWATCHDOG_LOGFILE} --stderr ${SWATCHDOG_ERRFILE} \
111 + --exec /usr/bin/perl -- ${SWATCHDOG_SCRIPT}
112 + eend $?
113 +}
114 +
115 +stop() {
116 + ebegin "Stopping swatchdog"
117 + start-stop-daemon --stop --exec /usr/bin/perl \
118 + --pidfile /run/swatchdog/swatchdog.pid --quiet
119 + eend $?
120 +}
121
122 diff --git a/app-admin/swatchdog/files/swatchdogrc b/app-admin/swatchdog/files/swatchdogrc
123 new file mode 100644
124 index 00000000..5132f85
125 --- /dev/null
126 +++ b/app-admin/swatchdog/files/swatchdogrc
127 @@ -0,0 +1,10 @@
128 +#
129 +# A sample configuration file for swatchdog.
130 +#
131 +# See "man swatchdog" for details.
132 +
133 +# Mails root when invalid remote login attempted.
134 +watchfor /(.*) (.*) (.*) (.*) (.*):( [iI]nvalid [uU]ser )(.*)( from )(.*)$/
135 + threshold track_by=$9,type=limit,count=3,seconds=30
136 + mail root,subject="Invalid user"
137 +
138
139 diff --git a/app-admin/swatchdog/metadata.xml b/app-admin/swatchdog/metadata.xml
140 new file mode 100644
141 index 00000000..4ed3356
142 --- /dev/null
143 +++ b/app-admin/swatchdog/metadata.xml
144 @@ -0,0 +1,24 @@
145 +<?xml version="1.0" encoding="UTF-8"?>
146 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
147 +<pkgmetadata>
148 + <maintainer type="person">
149 + <email>nimiux@g.o</email>
150 + <name>Chema Alonso</name>
151 + </maintainer>
152 + <longdescription lang="en">
153 + swatchdog.pl started out as swatch, the "simple watchdog"
154 + for activity monitoring log files produced by UNIX's syslog
155 + facility. It has since been evolving into a utility that can
156 + monitor just about any type of log. The name has been changed
157 + to satisfy a request made by the old Swiss watch company.
158 + </longdescription>
159 + <longdescription lang="es">
160 + swatchdog.pl comenzó como swatch, el "simple perro guardián"
161 + para monitorizar la actividad en los ficheros de registro
162 + producidos por la característica syslog de los sistemas UNIX.
163 + Desde entonces ha evolucionado hacia una utilidad que puede
164 + monitorizar cualquier tipo de registro. Se ha cambiado el
165 + nombre del proyecto para satisfacer una petición realizada
166 + por la empresa de relojes suiza.
167 + </longdescription>
168 +</pkgmetadata>
169
170 diff --git a/app-admin/swatchdog/swatchdog-3.2.4.ebuild b/app-admin/swatchdog/swatchdog-3.2.4.ebuild
171 new file mode 100644
172 index 00000000..a5a3fe7
173 --- /dev/null
174 +++ b/app-admin/swatchdog/swatchdog-3.2.4.ebuild
175 @@ -0,0 +1,32 @@
176 +# Copyright 1999-2016 Gentoo Foundation
177 +# Distributed under the terms of the GNU General Public License v2
178 +# $Id$
179 +
180 +EAPI=5
181 +
182 +GENTOO_DEPEND_ON_PERL_SUBSLOT=yes
183 +inherit perl-app
184 +
185 +DESCRIPTION="Simple log watcher"
186 +HOMEPAGE="https://sourceforge.net/projects/swatch/"
187 +SRC_URI="mirror://sourceforge/swatch/${P}.tar.gz"
188 +
189 +LICENSE="GPL-2"
190 +SLOT="0"
191 +KEYWORDS="~amd64 ~ppc ~x86"
192 +IUSE=""
193 +
194 +RDEPEND="dev-perl/Date-Manip
195 + dev-perl/Date-Calc
196 + dev-perl/File-Tail
197 + dev-perl/TimeDate
198 + >=virtual/perl-Time-HiRes-1.12
199 + !app-admin/swatch"
200 +
201 +src_install() {
202 + emake install
203 + newinitd "${FILESDIR}/${PN}-init" "${PN}"
204 + newconfd "${FILESDIR}/${PN}-confd" "${PN}"
205 + insinto /etc
206 + doins "${FILESDIR}/${PN}rc"
207 +}