Merge pull request #187873 from SuperSandro2000/rsyslog

This commit is contained in:
Sandro 2022-09-20 17:03:24 +02:00 committed by GitHub
commit a00c8f2667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 186 additions and 170 deletions

View File

@ -1,14 +1,65 @@
{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, libestr, json_c, zlib, docutils, fastJson
, libkrb5 ? null, systemd ? null, jemalloc ? null, libmysqlclient ? null, postgresql ? null
, libdbi ? null, net-snmp ? null, libuuid ? null, curl ? null, gnutls ? null
, libgcrypt ? null, liblognorm ? null, openssl ? null, librelp ? null, libksi ? null
, liblogging ? null, libnet ? null, hadoop ? null, rdkafka ? null
, libmongo-client ? null, czmq ? null, rabbitmq-c ? null, hiredis ? null, mongoc ? null
, libmaxminddb ? null
, nixosTests ? null
{ lib
, stdenv
, fetchurl
, pkg-config
, autoreconfHook
, libestr
, json_c
, zlib
, docutils
, fastJson
, withKrb5 ? true
, libkrb5
, withSystemd ? stdenv.isLinux
, systemd
, withJemalloc ? true
, jemalloc
, withMysql ? true
, libmysqlclient
, withPostgres ? true
, postgresql
, withDbi ? true
, libdbi
, withNetSnmp ? true
, net-snmp
, withUuid ? true
, libuuid
, withCurl ? true
, curl
, withGnutls ? true
, gnutls
, withGcrypt ? true
, libgcrypt
, withLognorm ? true
, liblognorm
, withMaxminddb ? true
, libmaxminddb
, withOpenssl ? true
, openssl
, withRelp ? true
, librelp
, withKsi ? true
, libksi
, withLogging ? true
, liblogging
, withNet ? true
, libnet
, withHadoop ? true
, hadoop
, withRdkafka ? true
, rdkafka
, withMongo ? true
, libmongo-client
, mongoc
, withCzmq ? true
, czmq
, withRabbitmq ? true
, rabbitmq-c
, withHiredis ? true
, hiredis
, nixosTests
}:
with lib;
stdenv.mkDerivation rec {
pname = "rsyslog";
version = "8.2208.0";
@ -18,98 +69,122 @@ stdenv.mkDerivation rec {
sha256 = "sha256-FN5o57jlqwxdc0+C4tyf/yLNf0cQrWkHJ+sQp7mz314=";
};
#patches = [ ./fix-gnutls-detection.patch ];
nativeBuildInputs = [ pkg-config autoreconfHook ];
buildInputs = [
fastJson libestr json_c zlib docutils libkrb5 jemalloc
postgresql libdbi net-snmp libuuid curl gnutls libgcrypt liblognorm openssl
librelp libksi liblogging libnet hadoop rdkafka libmongo-client czmq
rabbitmq-c hiredis mongoc libmaxminddb
] ++ lib.optional (libmysqlclient != null) libmysqlclient
++ lib.optional stdenv.isLinux systemd;
fastJson
libestr
json_c
zlib
docutils
] ++ lib.optional withKrb5 libkrb5
++ lib.optional withJemalloc jemalloc
++ lib.optional withPostgres postgresql
++ lib.optional withDbi libdbi
++ lib.optional withNetSnmp net-snmp
++ lib.optional withUuid libuuid
++ lib.optional withCurl curl
++ lib.optional withGnutls gnutls
++ lib.optional withGcrypt libgcrypt
++ lib.optional withLognorm liblognorm
++ lib.optional withOpenssl openssl
++ lib.optional withRelp librelp
++ lib.optional withKsi libksi
++ lib.optional withLogging liblogging
++ lib.optional withNet libnet
++ lib.optional withHadoop hadoop
++ lib.optional withRdkafka rdkafka
++ lib.optionals withMongo [ libmongo-client mongoc ]
++ lib.optional withCzmq czmq
++ lib.optional withRabbitmq rabbitmq-c
++ lib.optional withHiredis hiredis
++ lib.optional withMaxminddb libmaxminddb
++ lib.optional withMysql libmysqlclient
++ lib.optional withSystemd systemd;
configureFlags = [
configureFlags = with lib; [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-systemdsystemunitdir=\${out}/etc/systemd/system"
(enableFeature true "largefile")
(enableFeature true "regexp")
(enableFeature (libkrb5 != null) "gssapi-krb5")
(enableFeature true "klog")
(enableFeature true "kmsg")
(enableFeature (systemd != null) "imjournal")
(enableFeature true "inet")
(enableFeature (jemalloc != null) "jemalloc")
(enableFeature true "unlimited-select")
(enableFeature false "debug")
(enableFeature false "debug-symbols")
(enableFeature true "debugless")
(enableFeature false "valgrind")
(enableFeature false "diagtools")
(enableFeature true "usertools")
(enableFeature (libmysqlclient != null) "mysql")
(enableFeature (postgresql != null) "pgsql")
(enableFeature (libdbi != null) "libdbi")
(enableFeature (net-snmp != null) "snmp")
(enableFeature (libuuid != null) "uuid")
(enableFeature (curl != null) "elasticsearch")
(enableFeature (gnutls != null) "gnutls")
(enableFeature (libgcrypt != null) "libgcrypt")
(enableFeature true "rsyslogrt")
(enableFeature true "rsyslogd")
(enableFeature true "mail")
(enableFeature (liblognorm != null) "mmnormalize")
(enableFeature (libmaxminddb != null) "mmdblookup")
(enableFeature true "mmjsonparse")
(enableFeature true "mmaudit")
(enableFeature true "mmanon")
(enableFeature true "mmutf8fix")
(enableFeature true "mmcount")
(enableFeature true "mmsequence")
(enableFeature true "mmfields")
(enableFeature true "mmpstrucdata")
(enableFeature (openssl != null) "mmrfc5424addhmac")
(enableFeature (librelp != null) "relp")
(enableFeature (libksi != null) "ksi-ls12")
(enableFeature (liblogging != null) "liblogging-stdlog")
(enableFeature (liblogging != null) "rfc3195")
(enableFeature true "imfile")
(enableFeature false "imsolaris")
(enableFeature true "imptcp")
(enableFeature true "impstats")
(enableFeature true "omprog")
(enableFeature (libnet != null) "omudpspoof")
(enableFeature true "omstdout")
(enableFeature (systemd != null) "omjournal")
(enableFeature true "pmlastmsg")
(enableFeature true "pmcisconames")
(enableFeature true "pmciscoios")
(enableFeature true "pmaixforwardedfrom")
(enableFeature true "pmsnare")
(enableFeature true "omruleset")
(enableFeature true "omuxsock")
(enableFeature true "mmsnmptrapd")
(enableFeature (hadoop != null) "omhdfs")
(enableFeature (rdkafka != null) "omkafka")
(enableFeature (libmongo-client != null) "ommongodb")
(enableFeature (czmq != null) "imczmq")
(enableFeature (czmq != null) "omczmq")
(enableFeature (rabbitmq-c != null) "omrabbitmq")
(enableFeature (hiredis != null) "omhiredis")
(enableFeature (curl != null) "omhttpfs")
(enableFeature true "generate-man-pages")
(enableFeature true "largefile")
(enableFeature true "regexp")
(enableFeature withKrb5 "gssapi-krb5")
(enableFeature true "klog")
(enableFeature true "kmsg")
(enableFeature withSystemd "imjournal")
(enableFeature true "inet")
(enableFeature withJemalloc "jemalloc")
(enableFeature true "unlimited-select")
(enableFeature withCurl "clickhouse")
(enableFeature false "debug")
(enableFeature false "debug-symbols")
(enableFeature true "debugless")
(enableFeature false "valgrind")
(enableFeature false "diagtools")
(enableFeature withCurl "fmhttp")
(enableFeature true "usertools")
(enableFeature withMysql "mysql")
(enableFeature withPostgres "pgsql")
(enableFeature withDbi "libdbi")
(enableFeature withNetSnmp "snmp")
(enableFeature withUuid "uuid")
(enableFeature withCurl "elasticsearch")
(enableFeature withGnutls "gnutls")
(enableFeature withGcrypt "libgcrypt")
(enableFeature true "rsyslogrt")
(enableFeature true "rsyslogd")
(enableFeature true "mail")
(enableFeature withLognorm "mmnormalize")
(enableFeature withMaxminddb "mmdblookup")
(enableFeature true "mmjsonparse")
(enableFeature true "mmaudit")
(enableFeature true "mmanon")
(enableFeature true "mmutf8fix")
(enableFeature true "mmcount")
(enableFeature true "mmsequence")
(enableFeature true "mmfields")
(enableFeature true "mmpstrucdata")
(enableFeature withOpenssl "mmrfc5424addhmac")
(enableFeature withRelp "relp")
(enableFeature withKsi "ksi-ls12")
(enableFeature withLogging "liblogging-stdlog")
(enableFeature withLogging "rfc3195")
(enableFeature true "imfile")
(enableFeature false "imsolaris")
(enableFeature true "imptcp")
(enableFeature true "impstats")
(enableFeature true "omprog")
(enableFeature withNet "omudpspoof")
(enableFeature true "omstdout")
(enableFeature withSystemd "omjournal")
(enableFeature true "pmlastmsg")
(enableFeature true "pmcisconames")
(enableFeature true "pmciscoios")
(enableFeature true "pmaixforwardedfrom")
(enableFeature true "pmsnare")
(enableFeature true "omruleset")
(enableFeature true "omuxsock")
(enableFeature true "mmsnmptrapd")
(enableFeature withHadoop "omhdfs")
(enableFeature withRdkafka "omkafka")
(enableFeature withMongo "ommongodb")
(enableFeature withCzmq "imczmq")
(enableFeature withCzmq "omczmq")
(enableFeature withRabbitmq "omrabbitmq")
(enableFeature withHiredis "omhiredis")
(enableFeature withCurl "omhttp")
(enableFeature true "generate-man-pages")
];
passthru.tests = {
nixos-rsyslogd = nixosTests.rsyslogd;
};
meta = {
meta = with lib; {
homepage = "https://www.rsyslog.com/";
description = "Enhanced syslog implementation";
changelog = "https://raw.githubusercontent.com/rsyslog/rsyslog/v${version}/ChangeLog";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}

View File

@ -1,60 +0,0 @@
From 588b4ca7412326abd51a5b2060eafbc04611e419 Mon Sep 17 00:00:00 2001
From: Radovan Sroka <rsroka@redhat.com>
Date: Tue, 11 Aug 2015 17:09:15 +0200
Subject: [PATCH] Fix detection of the GnuTLS package
This commit fixes a number of issues that cropped up from these changes:
23c5b3e replace deprecated GnuTLS functions with newer ones if available
88f0651 bugfix: ommysql did not work when gnutls was enabled
ce560b6 build system: Failure action in AC_CHECK_LIB check for
The solution is based on the assumption that the call to AC_CHECK_LIB()
was added purely to satisfy the subsequent calls to AC_CHECK_FUNCS().
23c5b3e had the unintentional result of libgnutls being added to LIBS
and linked to undesired components.
The next commit removed libgnutls from LIBS which made the following
calls to AC_CHECK_FUNCS() nonfunctional.
Another commit made the processing not stop upon detecting a missing
component which, again, makes the calls to AC_CHECK_FUNCS() malfunction.
The solution is to get rid of AC_CHECK_LIB() and temporarily override
LIBS for use by AC_CHECK_FUNCS().
---
configure.ac | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6f82f0c..ba3f791 100644
--- a/configure.ac
+++ b/configure.ac
@@ -763,18 +763,13 @@ AC_ARG_ENABLE(gnutls,
if test "x$enable_gnutls" = "xyes"; then
PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0)
AC_DEFINE([ENABLE_GNUTLS], [1], [Indicator that GnuTLS is present])
- AC_CHECK_LIB(
- [gnutls],
- [gnutls_global_init],
- [
- AC_DEFINE(HAVE_LIB_GNUTLS, 1, [gnutls is available])
- ],
- [AC_MSG_WARN([gnutls_global_init function missing or not detected])],
- []
- )
+ save_libs=$LIBS
+ LIBS="$LIBS $GNUTLS_LIBS"
AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,)
AC_CHECK_FUNCS(gnutls_certificate_type_set_priority,,)
+ LIBS=$save_libs
fi
+
AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes)
# libgcrypt support
@@ -1655,7 +1650,6 @@ else
AC_MSG_NOTICE([Not running from git source])
fi
-
AM_CONDITIONAL(ENABLE_GENERATE_MAN_PAGES, test x$have_to_generate_man_pages = xyes)
# rst2man

View File

@ -4742,34 +4742,35 @@ with pkgs;
rsbep = callPackage ../tools/backup/rsbep { };
rsyslog = callPackage ../tools/system/rsyslog {
hadoop = null; # Currently Broken
libksi = null; # Currently Broken
withHadoop = false; # Currently Broken
withKsi = false; # Currently Broken
};
rsyslog-light = rsyslog.override {
libkrb5 = null;
systemd = null;
jemalloc = null;
libmysqlclient = null;
postgresql = null;
libdbi = null;
net-snmp = null;
libuuid = null;
gnutls = null;
libgcrypt = null;
liblognorm = null;
openssl = null;
librelp = null;
libksi = null;
liblogging = null;
libnet = null;
hadoop = null;
rdkafka = null;
libmongo-client = null;
czmq = null;
rabbitmq-c = null;
hiredis = null;
libmaxminddb = null;
withKrb5 = false;
withSystemd = false;
withJemalloc = false;
withMysql = false;
withPostgres = false;
withDbi = false;
withNetSnmp = false;
withUuid = false;
withCurl = false;
withGnutls = false;
withGcrypt = false;
withLognorm = false;
withMaxminddb = false;
withOpenssl = false;
withRelp = false;
withKsi = false;
withLogging = false;
withNet = false;
withHadoop = false;
withRdkafka = false;
withMongo = false;
withCzmq = false;
withRabbitmq = false;
withHiredis = false;
};
rtrtr = callPackage ../servers/rtrtr {