package/collectd: keep postgresql_default.conf when needed
authorPascal de Bruijn <p.debruijn@unilogic.nl>
Wed, 11 Mar 2020 14:13:11 +0000 (15:13 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 22 Mar 2020 15:07:15 +0000 (16:07 +0100)
$(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 <p.debruijn@unilogic.nl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/collectd/collectd.mk

index 9258977613044f79f37c5f20e0783a3394536229..65307dce4c8ff574f6d9196caba35b66338e292e 100644 (file)
@@ -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 \