mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 20:36:40 +02:00
community/syslog-summary: new aport
https://github.com/dpaleino/syslog-summary Summarize the contents of a syslog log file / useful with logcheck Patched to support: - new thread safe version of python-magic - socklog
This commit is contained in:
parent
febfba2695
commit
fbbc0f0c76
15
community/syslog-summary/00-fix_Makefile.patch
Normal file
15
community/syslog-summary/00-fix_Makefile.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- syslog-summary-1.14/Makefile
|
||||
+++ syslog-summary-1.14/Makefile.new
|
||||
@@ -6,8 +6,12 @@
|
||||
version = $(shell grep ^version syslog-summary | cut -d\" -f2)
|
||||
|
||||
install:
|
||||
+ install -d $(DESTDIR)/usr/bin
|
||||
+ install -d $(DESTDIR)/etc/syslog-summary
|
||||
+ install -d $(DESTDIR)/usr/share/man/man1
|
||||
install -m 755 syslog-summary $(DESTDIR)/usr/bin/syslog-summary
|
||||
install -m 644 ignore.rules $(DESTDIR)/etc/syslog-summary/ignore.rules
|
||||
+ install -m 644 syslog-summary.1 $(DESTDIR)/usr/share/man/man1
|
||||
|
||||
uninstall:
|
||||
[ ! -f $(DESTDIR)/usr/bin/syslog-summary ] || rm -v $(DESTDIR)/usr/bin/syslog-summary
|
||||
17
community/syslog-summary/01-fix_Shebang.patch
Normal file
17
community/syslog-summary/01-fix_Shebang.patch
Normal file
@ -0,0 +1,17 @@
|
||||
From: David Paleino <dapal@debian.org>
|
||||
Subject: don't hardcode python2.5
|
||||
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588524
|
||||
|
||||
---
|
||||
syslog-summary | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- syslog-summary.orig/syslog-summary
|
||||
+++ syslog-summary/syslog-summary
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python2.5
|
||||
+#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright © 2008-2009, David Paleino <d.paleino@gmail.com>
|
||||
|
||||
16
community/syslog-summary/02-new-python-magic.patch
Normal file
16
community/syslog-summary/02-new-python-magic.patch
Normal file
@ -0,0 +1,16 @@
|
||||
## use the new thread safe version of python-magic not the original ##
|
||||
|
||||
--- syslog-summary-1.14/syslog-summary
|
||||
+++ syslog-summary-1.14/syslog-summary.new
|
||||
@@ -130,9 +130,8 @@
|
||||
"""Returns True if the filename is a gzipped compressed file"""
|
||||
try:
|
||||
import magic
|
||||
- ms = magic.open(magic.MAGIC_NONE)
|
||||
- ms.load()
|
||||
- if re.search("^gzip compressed data.*", ms.file(filename)):
|
||||
+ ms = magic.from_file(filename)
|
||||
+ if re.search("^gzip compressed data.*", ms):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
14
community/syslog-summary/03-socklog-compat.patch
Normal file
14
community/syslog-summary/03-socklog-compat.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- syslog-summary-1.14/syslog-summary
|
||||
+++ syslog-summary-1.14/syslog-summary.new
|
||||
@@ -43,6 +43,11 @@
|
||||
from optparse import OptionParser
|
||||
|
||||
datepats = [
|
||||
+ # 1st => runit / svlogd || svlogd -t || -tt || -ttt
|
||||
+ re.compile(r"^[\@\.\-\:\_ A-Za-z0-9]{0,26}?(\w+[.]\w+): \w+[ :0-9]{12} "),
|
||||
+ # 2nd & 3rd => digit dates / mysql error logs
|
||||
+ re.compile(r"^([- 0-9]{10} {1,2}[:0-9]{7,8})([ 0-9]{16})? "),
|
||||
+ re.compile(r"^(InnoDB:|Tcp|Time.*Argument|Version:|mysqld,) "),
|
||||
re.compile(r"^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] "),
|
||||
re.compile(r"^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 0-9][0-9][0-9][0-9]:[0-9][0-9] "),
|
||||
re.compile(r"^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 0-9][0-9][0-9][0-9]:[0-9][0-9]:[0-9][0-9] "),
|
||||
85
community/syslog-summary/04-rm-whitespace.patch
Normal file
85
community/syslog-summary/04-rm-whitespace.patch
Normal file
@ -0,0 +1,85 @@
|
||||
--- syslog-summary-1.14/syslog-summary
|
||||
+++ syslog-summary-1.14/syslog-summary.new
|
||||
@@ -4,22 +4,22 @@
|
||||
# Copyright © 2008-2009, David Paleino <d.paleino@gmail.com>
|
||||
# © 2001-2008, Tommi Virtanen <tv@debian.org>
|
||||
# © 1998-2000, Lars Wirzenius <liw@iki.fi>
|
||||
-#
|
||||
+#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
-#
|
||||
+#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
-#
|
||||
+#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
# MA 02110-1301, USA.
|
||||
-
|
||||
+
|
||||
"""Summarize the contents of a syslog log file.
|
||||
|
||||
The syslog(3) service writes system log messages in a certain format:
|
||||
@@ -139,10 +139,10 @@
|
||||
return False
|
||||
except:
|
||||
from os.path import splitext
|
||||
-
|
||||
+
|
||||
if not QUIET:
|
||||
print "Using fallback detection... please install python-magic for better gzip detection."
|
||||
-
|
||||
+
|
||||
if splitext(filename)[1] == ".gz":
|
||||
return True
|
||||
else:
|
||||
@@ -154,7 +154,7 @@
|
||||
ignored_count = 0
|
||||
if not QUIET:
|
||||
print "Summarizing %s" % filename
|
||||
-
|
||||
+
|
||||
# If the file is a gzipped log, open it
|
||||
# using the proper function from the gzip
|
||||
# module.
|
||||
@@ -165,7 +165,7 @@
|
||||
file = open(filename, "r")
|
||||
except IOError, e:
|
||||
io_error(e, filename, True)
|
||||
-
|
||||
+
|
||||
linecount = 0
|
||||
|
||||
shaobj = sha1()
|
||||
@@ -193,13 +193,13 @@
|
||||
# foo+=1
|
||||
shaobj.update(line)
|
||||
linecount += 1
|
||||
-
|
||||
+
|
||||
if should_be_ignored(line):
|
||||
ignored_count += 1
|
||||
if DEBUG:
|
||||
print "Ignoring: %s" % line
|
||||
line = file.readline()
|
||||
-
|
||||
+
|
||||
date, rest = split_date(line)
|
||||
if date:
|
||||
found = pidpat.search(rest)
|
||||
@@ -232,7 +232,7 @@
|
||||
# print foo
|
||||
states[filename] = (linecount + ignored_count, shaobj.hexdigest())
|
||||
# print states
|
||||
-
|
||||
+
|
||||
if QUIET and order:
|
||||
print "Summarizing %s" % filename
|
||||
if not QUIET or order:
|
||||
43
community/syslog-summary/APKBUILD
Normal file
43
community/syslog-summary/APKBUILD
Normal file
@ -0,0 +1,43 @@
|
||||
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
|
||||
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
|
||||
pkgname=syslog-summary
|
||||
pkgver=1.14
|
||||
pkgrel=0
|
||||
pkgdesc="Summarize the contents of a syslog log file / useful with logcheck"
|
||||
url="https://github.com/dpaleino/syslog-summary"
|
||||
arch="noarch"
|
||||
license="GPL3"
|
||||
depends="py2-magic"
|
||||
subpackages="$pkgname-doc"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/dpaleino/$pkgname/archive/$pkgver.tar.gz
|
||||
00-fix_Makefile.patch
|
||||
01-fix_Shebang.patch
|
||||
02-new-python-magic.patch
|
||||
03-socklog-compat.patch
|
||||
04-rm-whitespace.patch
|
||||
"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make DESTDIR="$pkgdir" install || return 1
|
||||
}
|
||||
|
||||
md5sums="fd812eaf4897b1b4a6e55ad920137cc0 syslog-summary-1.14.tar.gz
|
||||
a4826943cfbeabe1313e57d9010032f6 00-fix_Makefile.patch
|
||||
0b873e4f86bea34c0f2318e3efa55322 01-fix_Shebang.patch
|
||||
04e2e6e3aab70ad858d59a2a9c058223 02-new-python-magic.patch
|
||||
69ed13b784d4fc8f09e65c70587e673c 03-socklog-compat.patch
|
||||
4b458c0f73d3bfca01c1f837d53148c1 04-rm-whitespace.patch"
|
||||
sha256sums="ff9b43c26a494b84b780146e6f8bc0fd61c74158725a1666e5d84bf93d90e04d syslog-summary-1.14.tar.gz
|
||||
82faaa6ee87e8a33a14b85287520724130e9d923352370a4b16f70d788982e73 00-fix_Makefile.patch
|
||||
90d9e8699fba9db3efacd3c4a808b7a2e95667df1c50d6913b9b233c9fb929f8 01-fix_Shebang.patch
|
||||
44f5bf029b79b877d1df616cd9fcbaa028f3aebd03b6d9dc267e770026b00e44 02-new-python-magic.patch
|
||||
4c877e2b9e77581ca68e328c7ae574a098eacb5fbd1fb4fa1c276682cfd69100 03-socklog-compat.patch
|
||||
a542f169d04de1ea2c1ce5ce4715c3bf55a62c385815bfd493fd21d8fb9b7970 04-rm-whitespace.patch"
|
||||
sha512sums="dab82f9d5e0e452d880e7e503c1de148d902c461abaf6fc1a0768516bd010c6a4e5cdbb61fd1d6e0283d55c8de9a11d02bd5828fab31cae98b59ca336a7f1a73 syslog-summary-1.14.tar.gz
|
||||
752914623deb2a9c4aec9de3bf3a8c61e2086a40d47445ea775eba44e3e23b12fe9145afb3bdbef1d7b28604c023985a8d9c34c1914e7dfe178de65ffbfb2c49 00-fix_Makefile.patch
|
||||
6d4705bae4e095a7a877ae71525df3f8bda8daa27cdd0e534fba21cfc221c130b1567e32a64f0f4327273023f9d5e890d3365b292fa3a54e508abd8fea6332d2 01-fix_Shebang.patch
|
||||
fa6be5429ca0f72cc8e1686933f956cedf89e6476cc9a25dda066be50aa05a79be8a81ff164aa3becac9f59e9948ef203c3f6d5c3889f921471e674dfc3d5098 02-new-python-magic.patch
|
||||
480d817ed9acb79e71ad173aaa691d9894cdbd3fb5bf8bd04640d3e88e1419e8338ab8e2c4be7f587afec5ee5e5651e1f472b031401787453ea9ca8a73107652 03-socklog-compat.patch
|
||||
84394c7cb364ac1df0456bcacdb68db66827000329e874aab0f1867a6d860499f04eee7701cfcdce79ec13f341a69196d95d3505f811c8f35fbe974e364030ed 04-rm-whitespace.patch"
|
||||
Loading…
x
Reference in New Issue
Block a user