From 528ff4dd27df22b71b5ce3b00ec2b5bb4d0719e4 Mon Sep 17 00:00:00 2001 From: Aidan Harris Date: Mon, 11 Nov 2024 18:09:52 +0000 Subject: [PATCH] sys-apps/colortail: new package, add 0.3.3, 9999 Signed-off-by: Aidan Harris --- sys-apps/colortail/Manifest | 1 + sys-apps/colortail/colortail-0.3.3.ebuild | 39 +++++++++++ sys-apps/colortail/colortail-9999.ebuild | 38 +++++++++++ .../colortail/files/01_colorize_default.patch | 46 +++++++++++++ .../colortail/files/02_adding_option.patch | 13 ++++ sys-apps/colortail/files/colortail.1 | 64 +++++++++++++++++++ sys-apps/colortail/metadata.xml | 12 ++++ 7 files changed, 213 insertions(+) create mode 100644 sys-apps/colortail/Manifest create mode 100644 sys-apps/colortail/colortail-0.3.3.ebuild create mode 100644 sys-apps/colortail/colortail-9999.ebuild create mode 100644 sys-apps/colortail/files/01_colorize_default.patch create mode 100644 sys-apps/colortail/files/02_adding_option.patch create mode 100644 sys-apps/colortail/files/colortail.1 create mode 100644 sys-apps/colortail/metadata.xml diff --git a/sys-apps/colortail/Manifest b/sys-apps/colortail/Manifest new file mode 100644 index 0000000000..eb2f8ee8b8 --- /dev/null +++ b/sys-apps/colortail/Manifest @@ -0,0 +1 @@ +DIST colortail-0.3.3.tar.gz 97399 BLAKE2B 1aa0f69b56226c1a7966704d3fbe9c7bb1affde78b6926e2c8e69f76e54c1b3a412e5e03d0375c37ce10e6e2042f4ee73f20d9ad38be5e6b1965a059f830ce41 SHA512 0fc8b9001562e4080110fdfb2b3b2ef269618445314a816d8a020b7a6380843644a988ab45cf375856015b4b9e09b873b5b7f0540b25f7fa61008efbd5e1fe9b diff --git a/sys-apps/colortail/colortail-0.3.3.ebuild b/sys-apps/colortail/colortail-0.3.3.ebuild new file mode 100644 index 0000000000..4c3acfec69 --- /dev/null +++ b/sys-apps/colortail/colortail-0.3.3.ebuild @@ -0,0 +1,39 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="tail command with colors" +HOMEPAGE="https://github.com/joakim666/colortail" + +SRC_URI="https://github.com/joakim666/colortail/releases/download/${PV}/${P}.tar.gz" + +inherit autotools + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +PATCHES=( + "${FILESDIR}"/01_colorize_default.patch + "${FILESDIR}"/02_adding_option.patch +) + +DOCS=(TODO README ChangeLog BUGS AUTHORS example-conf/conf.{daemon,kernel,messages,secure,xferlog} ) + +src_prepare() { + eautoreconf + default +} + +src_compile() { + emake || die +} + +src_install() { + emake install DESTDIR="${ED}" || die + doman "${FILESDIR}/${PN}.1" + dodoc ${DOCS[@]} + insinto /etc/colortail + newins example-conf/conf.messages conf.colortail +} diff --git a/sys-apps/colortail/colortail-9999.ebuild b/sys-apps/colortail/colortail-9999.ebuild new file mode 100644 index 0000000000..634a249cac --- /dev/null +++ b/sys-apps/colortail/colortail-9999.ebuild @@ -0,0 +1,38 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="tail command with colors" +HOMEPAGE="https://github.com/joakim666/colortail" + +EGIT_REPO_URI="https://github.com/joakim666/colortail.git" + +inherit git-r3 autotools + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" + +PATCHES=( + "${FILESDIR}"/02_adding_option.patch +) + +DOCS=(TODO README ChangeLog BUGS AUTHORS example-conf/conf.{daemon,kernel,messages,secure,xferlog} ) + +src_prepare() { + eautoreconf + default +} + +src_compile() { + emake || die +} + +src_install() { + emake install DESTDIR="${ED}" || die + doman "${FILESDIR}/${PN}.1" + dodoc ${DOCS[@]} + insinto /etc/colortail + newins example-conf/conf.messages conf.colortail +} diff --git a/sys-apps/colortail/files/01_colorize_default.patch b/sys-apps/colortail/files/01_colorize_default.patch new file mode 100644 index 0000000000..157bcf81ee --- /dev/null +++ b/sys-apps/colortail/files/01_colorize_default.patch @@ -0,0 +1,46 @@ +Patch to use /etc/colortail/conf.colortail by default to colorizer +without the option -k +Index: colortail-0.3.2/ColorTail.cc +=================================================================== +--- colortail-0.3.2.orig/ColorTail.cc 2010-01-02 13:13:03.000000000 -0500 ++++ colortail-0.3.2/ColorTail.cc 2010-01-02 13:17:31.000000000 -0500 +@@ -20,6 +20,8 @@ + #include + #include + #include ++#include ++#include + + #include "ColorTail.h" + #include "TailFile.h" +@@ -102,9 +104,14 @@ + { + // no config file + // print error +- cout << "colortail: Couldn't open global color config file. Skipping colors for the " << argv[i] << " file." << endl; ++ //cout << "colortail: Couldn't open global color config file. Skipping colors for the " << argv[i] << " file." << endl; + // open the tailfile without colorizer +- new_tailfile->open(argv[i], NULL); ++ //new_tailfile->open(argv[i], NULL); ++ string cade = "/etc/colortail/conf.colortail"; ++ char* ccade = new char[cade.length()+1]; ++ strcpy(ccade, cade.c_str()); ++ colorizer = new Colorizer(ccade); ++ new_tailfile->open(argv[i], colorizer); + } + } + else +@@ -126,7 +133,12 @@ + // no config file + // no error message because it can be cfgfile1,,cfgfile2 + // open the tailfile without colorizer +- new_tailfile->open(argv[i], NULL); ++ //new_tailfile->open(argv[i], NULL); ++ string cade = "/etc/colortail/conf.colortail"; ++ char* ccade = new char[cade.length()+1]; ++ strcpy(ccade, cade.c_str()); ++ colorizer = new Colorizer(ccade); ++ new_tailfile->open(argv[i], colorizer); + } + } + } diff --git a/sys-apps/colortail/files/02_adding_option.patch b/sys-apps/colortail/files/02_adding_option.patch new file mode 100644 index 0000000000..fff879cd57 --- /dev/null +++ b/sys-apps/colortail/files/02_adding_option.patch @@ -0,0 +1,13 @@ +Patch to show the option -l to display without colors. +Index: colortail-0.3.2/Usage.cc +=================================================================== +--- colortail-0.3.2.orig/Usage.cc 2010-01-02 13:22:27.000000000 -0500 ++++ colortail-0.3.2/Usage.cc 2010-01-02 13:24:43.000000000 -0500 +@@ -46,6 +46,7 @@ + cout << "\t\t\t\tIf only one config file it's global otherwise" << endl; + cout << "\t\t\t\tone config file for each tail file" << endl; + cout << " -n, --lines=N\t\t\toutput the last N lines, instead of last 10" << endl; ++ cout << " -l \t\t\t\tdisplay without colors" << endl; + cout << " -q, --quiet, --silent\t\tnever output headers giving file names" << endl; + cout << " -v, --version\t\t\toutput version information and exit" << endl; + cout << endl; diff --git a/sys-apps/colortail/files/colortail.1 b/sys-apps/colortail/files/colortail.1 new file mode 100644 index 0000000000..248a5b8fdd --- /dev/null +++ b/sys-apps/colortail/files/colortail.1 @@ -0,0 +1,64 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH COLORTAIL 1 "January 2, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +colortail \- log colorizer that makes log checking easier +.SH SYNOPSIS +.B colortail +.RI [ options ] [file...] +.br +.SH DESCRIPTION +This manual page documents briefly the +.B colortail +commands. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBcolortail\fP is basically tail but with support for colors. With the help of color +config files you define what part of the output to print in which color. +.SH OPTIONS +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-f, \-\-follow +Output appended data as the file grows. +.TP +.B \-k, \-\-config=file +.B \-\-config=file1,file2,... +Color config files for the tail files. If only one config file it's global +otherwise one config file for each tail file. +.TP +.B \-n, \-\-lines=N +Output the last N lines, instead of last 10. +.TP +.B \-l +Display without colors. +.TP +.B \-q, \-\-quiet, \-\-silent +Never output headers giving file names. +.TP +.B \-v, \-\-version +Output version information and exit. +.TP +.br +.SH AUTHOR +colortail was written by Joakim Andersson Copyright (C) 2009 +.PP +This manual page was written by Elías Alejandro Año Mendoza , +for the Debian project (and may be used by others). diff --git a/sys-apps/colortail/metadata.xml b/sys-apps/colortail/metadata.xml new file mode 100644 index 0000000000..fbaaa911f0 --- /dev/null +++ b/sys-apps/colortail/metadata.xml @@ -0,0 +1,12 @@ + + + + + me@aidanharr.is + Aidan Harris + + + joakim666/colortail + + +