From e929d75d7eed66f4aff4b57d0192d6332fb21257 Mon Sep 17 00:00:00 2001 From: Konstantin Menyaev Date: Thu, 25 Jul 2024 12:37:41 -0300 Subject: [PATCH] package/rsyslog: extra plugins option introduced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rsyslog package enables extra plugins based on the availability of external dependencies. However, there are many cases where those plugins are not needed, even when some of those external dependencies are enabled. Allow disabling the build of plugins. This option is useful in embedded systems to achieve compact footprint. Signed-off-by: Konstantin Menyaev Signed-off-by: Flávio Tapajós Signed-off-by: Thomas Petazzoni --- package/rsyslog/Config.in | 12 ++++++++++++ package/rsyslog/rsyslog.mk | 35 +++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/package/rsyslog/Config.in b/package/rsyslog/Config.in index d9e8b1ab6f..3c23de8346 100644 --- a/package/rsyslog/Config.in +++ b/package/rsyslog/Config.in @@ -17,6 +17,18 @@ config BR2_PACKAGE_RSYSLOG http://www.rsyslog.com +if BR2_PACKAGE_RSYSLOG + +config BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS + bool "extra plugins" + default y + help + Enable rsyslog plugins that require external + dependencies. The different plugins will be automatically + enabled if their dependencies are enabled. + +endif # BR2_PACKAGE_RSYSLOG + comment "rsyslog needs a toolchain w/ threads, dynamic library" depends on BR2_USE_MMU depends on BR2_TOOLCHAIN_HAS_SYNC_4 diff --git a/package/rsyslog/rsyslog.mk b/package/rsyslog/rsyslog.mk index fac78795c2..98e5a8f8e8 100644 --- a/package/rsyslog/rsyslog.mk +++ b/package/rsyslog/rsyslog.mk @@ -15,12 +15,15 @@ RSYSLOG_CPE_ID_VENDOR = rsyslog RSYSLOG_IGNORE_CVES += CVE-2015-3243 RSYSLOG_DEPENDENCIES = zlib libestr liblogging libfastjson host-pkgconf RSYSLOG_CONF_ENV = ac_cv_prog_cc_c99='-std=c99' + +ifeq ($(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),y) RSYSLOG_PLUGINS = imdiag imfile impstats imptcp \ mmanon mmaudit mmfields mmjsonparse mmpstrucdata mmsequence mmutf8fix \ mail omprog omruleset omstdout omuxsock \ pmaixforwardedfrom pmciscoios pmcisconames pmlastmsg pmsnare +endif -ifeq ($(BR2_PACKAGE_LIBRELP),y) +ifeq ($(BR2_PACKAGE_LIBRELP)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += librelp RSYSLOG_PLUGINS += relp endif @@ -33,7 +36,7 @@ RSYSLOG_CONF_OPTS += \ --disable-mmkubernetes \ --disable-mmnormalize -ifeq ($(BR2_PACKAGE_LIBCURL),y) +ifeq ($(BR2_PACKAGE_LIBCURL)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += libcurl RSYSLOG_CONF_OPTS += \ --enable-clickhouse \ @@ -52,35 +55,35 @@ RSYSLOG_CONF_OPTS += \ --disable-omhttpfs endif -ifeq ($(BR2_PACKAGE_CIVETWEB_LIB),y) +ifeq ($(BR2_PACKAGE_CIVETWEB_LIB)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += apr-util civetweb RSYSLOG_CONF_OPTS += --enable-imhttp else RSYSLOG_CONF_OPTS += --disable-imhttp endif -ifeq ($(BR2_PACKAGE_CZMQ),y) +ifeq ($(BR2_PACKAGE_CZMQ)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += czmq RSYSLOG_CONF_OPTS += --enable-imczmq --enable-omczmq else RSYSLOG_CONF_OPTS += --disable-imczmq --disable-omczmq endif -ifeq ($(BR2_PACKAGE_GNUTLS),y) +ifeq ($(BR2_PACKAGE_GNUTLS)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += gnutls RSYSLOG_CONF_OPTS += --enable-gnutls else RSYSLOG_CONF_OPTS += --disable-gnutls endif -ifeq ($(BR2_PACKAGE_HIREDIS),y) +ifeq ($(BR2_PACKAGE_HIREDIS)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += hiredis RSYSLOG_CONF_OPTS += --enable-omhiredis else RSYSLOG_CONF_OPTS += --disable-omhiredis endif -ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) +ifeq ($(BR2_PACKAGE_LIBGCRYPT)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += libgcrypt RSYSLOG_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config RSYSLOG_CONF_OPTS += --enable-libgcrypt @@ -88,21 +91,21 @@ else RSYSLOG_CONF_OPTS += --disable-libgcrypt endif -ifeq ($(BR2_PACKAGE_LIBMAXMINDDB),y) +ifeq ($(BR2_PACKAGE_LIBMAXMINDDB)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += libmaxminddb RSYSLOG_CONF_OPTS += --enable-mmdblookup else RSYSLOG_CONF_OPTS += --disable-mmdblookup endif -ifeq ($(BR2_PACKAGE_LIBPCAP),y) +ifeq ($(BR2_PACKAGE_LIBPCAP)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += libpcap RSYSLOG_CONF_OPTS += --enable-impcap else RSYSLOG_CONF_OPTS += --disable-impcap endif -ifeq ($(BR2_PACKAGE_MARIADB),y) +ifeq ($(BR2_PACKAGE_MARIADB)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += mariadb RSYSLOG_CONF_OPTS += --enable-mysql RSYSLOG_CONF_ENV += ac_cv_prog_MYSQL_CONFIG=$(STAGING_DIR)/usr/bin/mysql_config @@ -110,7 +113,7 @@ else RSYSLOG_CONF_OPTS += --disable-mysql endif -ifeq ($(BR2_PACKAGE_POSTGRESQL),y) +ifeq ($(BR2_PACKAGE_POSTGRESQL)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += postgresql RSYSLOG_CONF_OPTS += --enable-pgsql RSYSLOG_CONF_ENV += ac_cv_prog_PG_CONFIG=$(STAGING_DIR)/usr/bin/pg_config @@ -118,28 +121,28 @@ else RSYSLOG_CONF_OPTS += --disable-pgsql endif -ifeq ($(BR2_PACKAGE_QPID_PROTON),y) +ifeq ($(BR2_PACKAGE_QPID_PROTON)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += qpid-proton RSYSLOG_CONF_OPTS += --enable-omamqp1 else RSYSLOG_CONF_OPTS += --disable-omamqp1 endif -ifeq ($(BR2_PACKAGE_RABBITMQ_C),y) +ifeq ($(BR2_PACKAGE_RABBITMQ_C)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += rabbitmq-c RSYSLOG_CONF_OPTS += --enable-omrabbitmq else RSYSLOG_CONF_OPTS += --disable-omrabbitmq endif -ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y) +ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_DEPENDENCIES += util-linux RSYSLOG_CONF_OPTS += --enable-uuid else RSYSLOG_CONF_OPTS += --disable-uuid endif -ifeq ($(BR2_INIT_SYSTEMD),y) +ifeq ($(BR2_INIT_SYSTEMD)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_CONF_OPTS += \ --enable-imjournal \ --enable-omjournal \ @@ -151,7 +154,7 @@ RSYSLOG_CONF_OPTS += \ --disable-omjournal endif -ifeq ($(BR2_PACKAGE_LIBDBI_DRIVERS),y) +ifeq ($(BR2_PACKAGE_LIBDBI_DRIVERS)$(BR2_PACKAGE_RSYSLOG_EXTRA_PLUGINS),yy) RSYSLOG_CONF_OPTS += --enable-libdbi RSYSLOG_DEPENDENCIES += libdbi-drivers else