From 19976e2670d11678fc9d4ec8f6bc98d1c9b3a029 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Wed, 13 Dec 2023 03:29:46 +0100
Subject: [PATCH] build: allow overriding GLUON_SITE_VERSION (#3091)

In case a community does not use Git for versioning it's site or using a
different versioning scheme that do not have annotated tags on the
master branch.

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 Makefile                      | 4 +++-
 docs/user/getting_started.rst | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 758d9a93e..6419417f1 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,9 @@ $(eval $(call mkabspath,GLUON_TARGETSDIR))
 $(eval $(call mkabspath,GLUON_PATCHESDIR))
 
 GLUON_VERSION := $(shell scripts/getversion.sh '.')
-GLUON_SITE_VERSION := $(shell scripts/getversion.sh '$(GLUON_SITEDIR)')
+
+# Set default SITE_VERSION if not set by user
+GLUON_SITE_VERSION ?= $(shell scripts/getversion.sh '$(GLUON_SITEDIR)')
 
 GLUON_MULTIDOMAIN ?= 0
 GLUON_AUTOREMOVE ?= 0
diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst
index f8652d317..5c8a0f770 100644
--- a/docs/user/getting_started.rst
+++ b/docs/user/getting_started.rst
@@ -237,6 +237,11 @@ GLUON_RELEASE
   is available. The same GLUON_RELEASE has to be passed to ``make`` and ``make manifest``
   to generate a correct manifest.
 
+GLUON_SITE_VERSION
+  Version of the site configuration. This string is displayed in the config mode
+  and `gluon-info`. If unset, Gluon generates a version string using `git describe`
+  on the site folder.
+
 GLUON_TARGET
   Target architecture to build.
 
-- 
GitLab