From 35e845700fb15b4ab30678c073300b508db4eb95 Mon Sep 17 00:00:00 2001
From: Pascal de Bruijn
Date: Wed, 11 Mar 2020 15:13:11 +0100
Subject: [PATCH] package/collectd: keep postgresql_default.conf when needed
$(TARGET_DIR)/usr/share/collectd/postgresql_default.conf
should not be removed when postgresql support is enabled,
as that module tries to load that file by default.
Signed-off-by: Pascal de Bruijn
Signed-off-by: Thomas Petazzoni
---
package/collectd/collectd.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index 9258977613..65307dce4c 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -218,8 +218,14 @@ endif
define COLLECTD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
rm -f $(TARGET_DIR)/usr/bin/collectd-nagios
+endef
+
+ifeq ($(BR2_PACKAGE_COLLECTD_POSTGRESQL),)
+define COLLECTD_REMOVE_UNNEEDED_POSTGRESQL_DEFAULT_CONF
rm -f $(TARGET_DIR)/usr/share/collectd/postgresql_default.conf
endef
+COLLECTD_POST_INSTALL_TARGET_HOOKS += COLLECTD_REMOVE_UNNEEDED_POSTGRESQL_DEFAULT_CONF
+endif
define COLLECTD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/collectd/collectd.service \
--
2.30.2