diff mbox series

[2/3] package/rsyslog: extra plugins option introduced

Message ID 20240725153743.101494-2-flavio.tapajos@newtesc.com.br
State Accepted
Headers show
Series [1/3] Revert "rsyslog: not available on musl" | expand

Commit Message

Flávio Tapajós July 25, 2024, 3:37 p.m. UTC
From: Konstantin Menyaev <KAMenyaev@salutedevices.com>

By default rsyslog builds with a bunch of plugins,
most of them are not even used, despite the dependent package like lubcurl.

This option is useful in embedded systems to achieve compact footprint.

Signed-off-by: Konstantin Menyaev <KAMenyaev@salutedevices.com>
Signed-off-by: Flávio Tapajós <flavio.tapajos@newtesc.com.br>
---
 package/rsyslog/Config.in  | 10 ++++++++++
 package/rsyslog/rsyslog.mk | 35 +++++++++++++++++++----------------
 2 files changed, 29 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/package/rsyslog/Config.in b/package/rsyslog/Config.in
index d9e8b1ab6f..044ea861bc 100644
--- a/package/rsyslog/Config.in
+++ b/package/rsyslog/Config.in
@@ -17,6 +17,16 @@  config BR2_PACKAGE_RSYSLOG
 
 	  http://www.rsyslog.com
 
+if BR2_PACKAGE_RSYSLOG
+
+config BR2_PACKAGE_RSYSLOG_WITH_EXTRA_PLUGINS
+       bool "extra plugins"
+       default y
+       help
+         Rsyslog extra plugins support
+
+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..ae645011ba 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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_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_WITH_EXTRA_PLUGINS),yy)
 RSYSLOG_CONF_OPTS += --enable-libdbi
 RSYSLOG_DEPENDENCIES += libdbi-drivers
 else