Blame SOURCES/0078-Makefile-add-EXTRAVERSION-support.patch

e95a18
From 03ab9763f51ddf2030f60f83e76cf9c1b50b726c Mon Sep 17 00:00:00 2001
e95a18
From: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com>
e95a18
Date: Fri, 15 May 2020 11:23:14 +0200
e95a18
Subject: [PATCH 078/108] Makefile: add EXTRAVERSION support
e95a18
e95a18
Add optional EXTRAVERSION parameter to Makefile and allow to mark version
e95a18
by user friendly label. It might be useful when creating custom
e95a18
spins of mdadm, or labeling some instance in between major releases.
e95a18
e95a18
Signed-off-by: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com>
e95a18
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
e95a18
---
e95a18
 Makefile | 3 ++-
e95a18
 ReadMe.c | 5 ++++-
e95a18
 2 files changed, 6 insertions(+), 2 deletions(-)
e95a18
e95a18
diff --git a/Makefile b/Makefile
e95a18
index a33319a..0a20b75 100644
e95a18
--- a/Makefile
e95a18
+++ b/Makefile
e95a18
@@ -105,7 +105,8 @@ VERSION = $(shell [ -d .git ] && git describe HEAD | sed 's/mdadm-//')
e95a18
 VERS_DATE = $(shell [ -d .git ] && date --iso-8601 --date="`git log -n1 --format=format:%cd --date=iso --date=short`")
e95a18
 DVERS = $(if $(VERSION),-DVERSION=\"$(VERSION)\",)
e95a18
 DDATE = $(if $(VERS_DATE),-DVERS_DATE="\"$(VERS_DATE)\"",)
e95a18
-CFLAGS += $(DVERS) $(DDATE)
e95a18
+DEXTRAVERSION = $(if $(EXTRAVERSION),-DEXTRAVERSION="\" - $(EXTRAVERSION)\"",)
e95a18
+CFLAGS += $(DVERS) $(DDATE) $(DEXTRAVERSION)
e95a18
 
e95a18
 # The glibc TLS ABI requires applications that call clone(2) to set up
e95a18
 # TLS data structures, use pthreads until mdmon implements this support
e95a18
diff --git a/ReadMe.c b/ReadMe.c
e95a18
index eaf1042..06b8f7e 100644
e95a18
--- a/ReadMe.c
e95a18
+++ b/ReadMe.c
e95a18
@@ -33,7 +33,10 @@
e95a18
 #ifndef VERS_DATE
e95a18
 #define VERS_DATE "2018-10-01"
e95a18
 #endif
e95a18
-char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
e95a18
+#ifndef EXTRAVERSION
e95a18
+#define EXTRAVERSION ""
e95a18
+#endif
e95a18
+char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n";
e95a18
 
e95a18
 /*
e95a18
  * File: ReadMe.c
e95a18
-- 
e95a18
2.7.5
e95a18