+COLLECTD_URL ?= https://github.com/collectd/collectd
+
+# there are 4 collectd flavors:
+# -"stable" - based on stable collectd release
+# -"latest" - development version, based on main branch
+# -"experimental" - it is based on main branch as above and includes
+# set pull requests with experimental features
+# -"collectd-6" - based on the collectd 6.0 branch
+ifeq ($(COLLECTD_FLAVOR), stable)
+# using the most recent stable release
+ COLLECTD_TAG ?= collectd-5.12
+ SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs
+endif
+ifeq ($(COLLECTD_FLAVOR), latest)
+# collectd code from main branch
+ COLLECTD_TAG ?= main
+ SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
+endif
+ifeq ($(COLLECTD_FLAVOR), experimental)
+# 'experimental' flavor is using additional Pull Requests that
+# are put on top of main release
+ COLLECTD_TAG ?= main
+ SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
+ COLLECTD_USE_EXPERIMENTAL_PR ?= y
+endif #end of experimental-branch handling
+ifeq ($(COLLECTD_FLAVOR), collectd-6)
+# 'collectd-6' flavor is using collectd-6.0 branch
+ COLLECTD_TAG ?= collectd-6.0
+ SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
+ COLLECTD_USE_EXPERIMENTAL_PR ?= y
+endif #end of collectd-6.0-branch handling