Package: limesuite / 18.06.0+dfsg-1

version-string Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Description: Allow overriding version string
 Add an override option for the version string in CMakeLists.txt. The
 original tries to combine its own string and EXTVER, so to make this
 the Debian package version we would have to filter out the version
 number from the changelog version.
 .
 Using the override we can simply pass the whole Debian version in
 without using complex sed or awk filtering.
Author: Andreas Bombe <aeb@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,20 +38,25 @@
 # number if there are changes within the major.minor release series
 set(LIME_SUITE_SOVER "${VERSION_MAJOR}.${VERSION_MINOR}-1")
 
-# packagers may specify -DLIME_SUITE_EXTVER="foo" to replace the git hash
-if (NOT LIME_SUITE_EXTVER)
-    include(${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake)
-    get_git_head_revision(GITREFSPEC GITHASH)
-    if (GITHASH)
-        string(SUBSTRING "${GITHASH}" 0 8 GITHASH)
-        set(LIME_SUITE_EXTVER "g${GITHASH}")
-    else (GITHASH)
-        set(LIME_SUITE_EXTVER "unknown")
-    endif (GITHASH)
-endif()
+if (NOT OVERRIDE_LIME_SUITE_VERSION)
+    # packagers may specify -DLIME_SUITE_EXTVER="foo" to replace the git hash
+    if (NOT LIME_SUITE_EXTVER)
+	include(${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake)
+	get_git_head_revision(GITREFSPEC GITHASH)
+	if (GITHASH)
+	    string(SUBSTRING "${GITHASH}" 0 8 GITHASH)
+	    set(LIME_SUITE_EXTVER "g${GITHASH}")
+	else (GITHASH)
+	    set(LIME_SUITE_EXTVER "unknown")
+	endif (GITHASH)
+    endif()
+
+    set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
+else (NOT OVERRIDE_LIME_SUITE_VERSION)
+    set(LIME_SUITE_VERSION "${OVERRIDE_LIME_SUITE_VERSION}")
+endif (NOT OVERRIDE_LIME_SUITE_VERSION)
 
 set(LIME_SUITE_LIBVER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
-set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
 
 if (NOT $ENV{SOURCE_DATE_EPOCH})
     message(FATAL_ERROR "SOURCE_DATE_EPOCH not set")