Subject: bug#41688: closed ([PATCH] Add rsyslog)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 31 Dec 2021 09:27:02 +0000

Your bug report

#41688: [PATCH] Add rsyslog

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
41688: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41688
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: [PATCH] Add rsyslog
From: Ricardo Wurmus <[email-masked]>
To: [email-masked]
Cc: Katherine Cox-Buday <[email-masked]>
Date: Fri, 31 Dec 2021 10:22:11 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I’ve followed Ludo’s suggestions for the remaining package definitions
and pushed the result to the “master” branch.

Among the changes:

- fixed and clarified licenses
- removed per-module outputs
- removed default configure flags and added a comment about enabling
  optional features
- enabled tests
- removed “dev” output
- used new input style

Now I guess we’ll need an rsyslog service :)

Thank you, Katherine, for the patches and your patience!

-- 
Ricardo

Subject: Add rsyslog
From: Katherine Cox-Buday <[email-masked]>
To: [email-masked]
Date: Wed, 3 Jun 2020 09:29:57 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

From 8d8d97441b397a48ae26761c2d826f35ae5d56e9 Mon Sep 17 00:00:00 2001
From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 2 Jun 2020 14:55:23 -0500
Subject: [PATCH 1/5] gnu: Add libestr.

* gnu/packages/c.scm (libestr): New variable.
---
 gnu/packages/c.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 3e227decc9..d3820c88b2 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2019 Andreas Enge <[email-masked]>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
+;;; Copyright @ 2020 Katherine Cox-Buday <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -339,3 +340,36 @@ address space pointers point to, or what locks a function acquires or
 releases.")
     (home-page "https://sparse.wiki.kernel.org/index.php/Main_Page")
     (license license:expat)))
+
+(define-public libestr
+  (package
+    (name "libestr")
+    (version "0.1.11")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rsyslog/libestr.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1ca4rj90c0dn7kqpbcchkflxjw88a7rxcnwbr0gply4a28i01nd8"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; autogen.sh calls configure at the end of the script.
+         (replace 'bootstrap
+           (lambda _ (invoke "autoreconf" "-vfi"))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("pkg-config" ,pkg-config)
+       ("libtool" ,libtool)))
+    (home-page "https://github.com/rsyslog/libestr")
+    (synopsis "Helper functions for handling strings")
+    (description
+     "A library which contains some essential string manipulation
+functions and more, like escaping special characters.")
+    (license license:lgpl2.1)))
-- 
2.26.2

From 0e0e9cc550ff002d7bebb4f93b573c5ba527ac4d Mon Sep 17 00:00:00 2001
From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 2 Jun 2020 15:47:41 -0500
Subject: [PATCH 5/5] gnu: Add rsyslog.

* gnu/packages/logging.scm (rsyslog): New variable.
---
 gnu/packages/logging.scm | 218 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 217 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/logging.scm b/gnu/packages/logging.scm
index 9139dc440e..f6084add2f 100644
--- a/gnu/packages/logging.scm
+++ b/gnu/packages/logging.scm
@@ -33,12 +33,27 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages c)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages flex)
+  #:use-module (gnu packages geo)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages kerberos)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
-  #:use-module (gnu packages autotools))
+  #:use-module (gnu packages tcl)
+  #:use-module (gnu packages tls))
 
 (define-public log4cpp
   (package
@@ -215,3 +230,204 @@ library.")
     ;; spdlog is under Expat license, but the bundled fmt library in
     ;; "include/spdlog/fmt/bundled" is under BSD 2 clause license.
     (license (list license:expat license:bsd-2))))
+
+(define-public rsyslog
+  (let ((modules (list "fmhash" "fmhttp" "imbatchreport"
+                       "imczmq" "imdiag" "imdocker"
+                       "imfile" "imgssapi" "imkafka"
+                       "imklog" "imkmsg" "immark"
+                       "improg" "impstats" "imptcp" "imtcp"
+                       "imtuxedoulog" "imudp" "imuxsock"
+                       "mmanon" "mmaudit" "mmcount"
+                       "mmdblookup" "mmexternal"
+                       "mmfields" "mmjsonparse"
+                       "mmkubernetes" "mmnormalize"
+                       "mmpstrucdata" "mmrfc5424addhmac"
+                       "mmrm1stspace" "mmsequence"
+                       "mmsnmptrapd" "mmtaghostname"
+                       "mmutf8fix" "omclickhouse"
+                       "omczmq" "omelasticsearch"
+                       "omfile-hardened" "omgssapi"
+                       "omhttpfs" "omhttp" "omkafka"
+                       "omlibdbi" "ommail" "ommysql" "ompgsql"
+                       "omprog" "omruleset" "omsnmp"
+                       "omstdout" "omtcl" "omtesting"
+                       "omudpspoof" "omuxsock"
+                       "pmaixforwardedfrom" "pmciscoios"
+                       "pmcisconames" "pmdb2diag"
+                       "pmlastmsg" "pmnormalize"
+                       "pmnull" "pmpanngfw" "pmsnare")))
+    (package
+      (name "rsyslog")
+      (version "8.2004.0")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/rsyslog/rsyslog.git")
+               (commit (string-append "v" version))))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0h40vvrjbxkvxy1sjqjwlyjfndj81llrisp7hkqm5j4mcl4pbzb3"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           ;; autogen.sh calls configure at the end of the script.
+           (replace 'bootstrap
+             (lambda _ (invoke "autoreconf" "-vfi")))
+           (add-after 'build 'transfer-modules
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (mod (string-append out "/lib/rsyslog"))
+                      (move-module
+                       (lambda (name)
+                         (let* ((new-dir (string-append
+                                          (assoc-ref outputs name)
+                                          "/lib/rsyslog")))
+                           (mkdir-p new-dir)
+                           (for-each
+                            (lambda (old-file)
+                              (let ((new-file
+                                     (string-append
+                                      new-dir
+                                      "/"
+                                      (basename old-file))))
+                                (write (string-append old-file " -> "
+                                                      new-file))
+                                (newline)
+                                (rename-file old-file new-file)))
+                            (find-files mod (string-append "^" name)))))))
+                 (for-each move-module (list ,@modules)))
+               #t)))
+         #:configure-flags
+         (list
+          "--enable-largefile"
+          "--enable-inet"
+          "--enable-regexp"
+          "--enable-rsyslogrt"
+          "--enable-rsyslogd"
+          "--enable-unlimited_select"
+          "--enable-uuid"
+          "--enable-libgcrypt"
+          "--enable-mmanon"
+          "--enable-mmcount"
+          "--enable-liblogging_stdlog"
+          "--enable-kafka_static"
+          "--enable-atomic_operations"
+          ;; Input plugins
+          "--enable-kmsg"
+          "--enable-imptcp"
+          "--enable-imdiag"
+          "--enable-imfile"
+          "--enable-imdocker"
+          "--enable-impstats"
+          "--enable-imczmq"
+          "--enable-imbatchreport"
+          "--enable-imkafka"
+          "--enable-imtuxedoulog"
+          "--enable-improg"
+          ;; Output plugins
+          "--enable-mail"
+          "--enable-omfile_hardened"
+          "--enable-omprog"
+          "--enable-omstdout"
+          "--enable-elasticsearch"
+          "--enable-clickhouse"
+          "--enable-omhttp"
+          "--enable-omruleset"
+          "--enable-omudpspoof"
+          "--enable-omuxsock"
+          "--enable-omczmq"
+          "--enable-omhttpfs"
+          "--enable-omtcl"
+          "--enable-omkafka"
+          ;; Parser Modules
+          "--enable-pmlastmsg"
+          "--enable-pmcisconames"
+          "--enable-pmciscoios"
+          "--enable-pmnull"
+          "--enable-pmnormalize"
+          "--enable-pmaixforwardedfrom"
+          "--enable-pmsnare"
+          "--enable-pmdb2diag"
+          "--enable-pmpanngfw"
+          ;; Message Modification Modules
+          "--enable-mmnormalize"
+          "--enable-mmjsonparse"
+          "--enable-mmaudit"
+          "--enable-mmsnmptrapd"
+          "--enable-mmutf8fix"
+          "--enable-mmrfc5424addhmac"
+          "--enable-mmpstrucdata"
+          "--enable-mmsequence"
+          "--enable-mmdblookup"
+          "--enable-mmdarwin"
+          "--enable-mmfields"
+          "--enable-mmrm1stspace"
+          "--enable-mmkubernetes"
+          "--enable-mmtaghostname"
+          ;; Database Support
+          "--enable-mysql"
+          "--enable-libdbi"
+          "--enable-pgsql"
+          ;; Protocol Support
+          "--enable-openssl"
+          "--enable-gnutls"
+          "--enable-gssapi_krb5"
+          "--enable-snmp"
+          ;; Function modules
+          "--enable-fmhttp"
+          "--enable-fmhash"
+          "--enable-fmhash_xxhash")))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)
+         ("bison" ,bison)
+         ("flex" ,flex)))
+      (inputs
+       `(("libestr" ,libestr)
+         ("libfastjson" ,libfastjson)
+         ("liblogging" ,liblogging)
+         ("libz" ,zlib)
+         ("libuuid" ,util-linux "lib")
+         ("libgcrypt" ,libgcrypt)
+         ("libcurl" ,curl)
+         ("liblognorm" ,liblognorm "lib")
+         ("liblognorm" ,liblognorm "dev")
+         ("mariadb" ,mariadb "lib")
+         ("mariadb" ,mariadb "dev")
+         ("postgresql" ,postgresql)
+         ("libdbi" ,libdbi)
+         ("net-smnp" ,net-snmp)
+         ("openssl" ,openssl)
+         ("gnutls" ,gnutls)
+         ("libnet" ,libnet)
+         ("librdkafka" ,librdkafka)
+         ("lz4" ,lz4)
+         ("czmq" ,czmq)
+         ("zeromq" ,zeromq)
+         ("mit-krb5" ,mit-krb5)
+         ("cyrus-sasl" ,cyrus-sasl)
+         ("libmaxminddb" ,libmaxminddb)
+         ("tcl" ,tcl)))
+      (outputs `("out" ,@modules))
+      (home-page "https://www.rsyslog.com/")
+      (synopsis "RSYSLOG is the rocket-fast system for log processing")
+      (description
+       "It offers high-performance, great security features and a modular
+design.  While it started as a regular syslogd, rsyslog has evolved into a
+kind of swiss army knife of logging, being able to accept inputs from a wide
+variety of sources, transform them, and output to the results to diverse
+destinations.
+
+Rsyslog can deliver over one million messages per second to local
+destinations when limited processing is applied (based on v7, December
+2013).  Even with remote destinations and more elaborate processing the
+performance is usually considered \"stunning\".")
+      (license (list license:gpl3
+                     license:asl2.0
+                     license:lgpl3)))))
-- 
2.26.2

From 3667290c9d419ce5404d6a0631bf20ddbcf1c286 Mon Sep 17 00:00:00 2001
From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 2 Jun 2020 15:34:19 -0500
Subject: [PATCH 4/5] gnu: Add liblognorm.

* gnu/packages/c.scm (liblognorm): New variable.
---
 gnu/packages/c.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 98c939e76f..3a7914346e 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xml))
 
 (define-public tcc
@@ -442,3 +443,57 @@ be very fast in processing.")
      "Liblogging is an easy to use library for logging.  It offers an enhanced
 replacement for the syslog() call, but retains its ease of use.")
     (license license:bsd-2)))
+
+(define-public liblognorm
+  (package
+    (name "liblognorm")
+    (version "2.0.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rsyslog/liblognorm.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1pyy1swvq6jj12aqma42jimv71z8m66zy6ydd5v19cp2azm4krml"))))
+    (build-system gnu-build-system)
+    (arguments
+     ;; Bash scripts interact with the filesystem
+     `(#:tests? #f
+       #:configure-flags
+       (list (string-append "--includedir="
+                            (assoc-ref %outputs "dev")
+                            "/include"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'fix-circular-dependency
+           (lambda* (#:key outputs #:allow-other-keys)
+             (write (string-append "KT: " (assoc-ref outputs "lib")
+                                   "/lib/pkgconfig"))
+             (write (string-append "KT: " (assoc-ref outputs "dev")
+                                   "/lib/pkgconfig"))
+             (let ((pkgconfig (string-append (assoc-ref outputs "dev")
+                                             "/lib/pkgconfig")))
+               (mkdir-p pkgconfig)
+               (rename-file (string-append (assoc-ref outputs "lib")
+                                           "/lib/pkgconfig")
+                            pkgconfig)))))))
+    (inputs
+     `(("libestr" ,libestr)
+       ("libfastjson" ,libfastjson)
+       ("json-c" ,json-c)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (outputs '("out" "lib" "dev"))
+    (home-page "https://www.liblognorm.com")
+    (synopsis
+     "Fast samples-based log normalization library")
+    (description
+     "Liblognorm normalizes event data into well-defined name-value
+pairs and a set of tags describing the message.")
+    (license license:lgpl2.1)))
-- 
2.26.2

From db4bcfc18e95fa39851c72414261b19b25c49db0 Mon Sep 17 00:00:00 2001
From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 2 Jun 2020 15:24:59 -0500
Subject: [PATCH 2/5] gnu: Add libfastjson.

* gnu/packages/c.scm (libfastjson): New variable.
---
 gnu/packages/c.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index d3820c88b2..307d8ca182 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -373,3 +373,35 @@ releases.")
      "A library which contains some essential string manipulation
 functions and more, like escaping special characters.")
     (license license:lgpl2.1)))
+
+(define-public libfastjson
+  (package
+    (name "libfastjson")
+    (version "0.99.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rsyslog/libfastjson.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0qhs0g9slj3p0v2z4s3cnsx44msrlb4k78ljg7714qiziqbrbwyl"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (home-page "https://github.com/rsyslog/libfastjson")
+    (synopsis "Fast json library for C ")
+    (description
+     "libfastjson is a fork from json-c, and is currently under development.
+The aim of this project is not to provide a slightly modified clone of json-c.
+It's aim is to provide: a small library with essential json handling
+functions, sufficiently good json support (not 100% standards compliant), and
+be very fast in processing.")
+    (license
+     (license:non-copyleft
+      "https://github.com/rsyslog/libfastjson/blob/master/COPYING"
+      "It is a MIT license."))))
-- 
2.26.2

From 9e0c24cc6e0666581b11b45f831ab49486adbdf8 Mon Sep 17 00:00:00 2001
From: Katherine Cox-Buday <[email-masked]>
Date: Tue, 2 Jun 2020 15:29:08 -0500
Subject: [PATCH 3/5] gnu: Add liblogging.

* gnu/packages/c.scm (liblogging): New variable.
---
 gnu/packages/c.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 307d8ca182..98c939e76f 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -42,6 +42,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages pkg-config)
@@ -405,3 +406,39 @@ be very fast in processing.")
      (license:non-copyleft
       "https://github.com/rsyslog/libfastjson/blob/master/COPYING"
       "It is a MIT license."))))
+
+(define-public liblogging
+  (package
+    (name "liblogging")
+    (version "1.0.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rsyslog/liblogging.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1l32m0y65svf5vxsgw935jnqs6842rcqr56dmzwqvr00yfrjhjkp"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; autogen.sh calls configure at the end of the script.
+         (replace 'bootstrap
+           (lambda _ (invoke "autoreconf" "-vfi"))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("pkg-config" ,pkg-config)
+       ("libtool" ,libtool)
+       ;; For rst2man.py
+       ("python-docutils" ,python-docutils)))
+    (home-page "https://github.com/rsyslog/liblogging")
+    (synopsis
+     "Easy to use and lightweight signal-safe logging library")
+    (description
+     "Liblogging is an easy to use library for logging.  It offers an enhanced
+replacement for the syslog() call, but retains its ease of use.")
+    (license license:bsd-2)))
-- 
2.26.2