Description: replace build_date with date from changelog
 To build reproducibly build_date is set to the source date from
 the debian/changelog
Author: Christian T. Steigies <cts@debian.org>
Last-Update: 2016-03-20
Index: gle-graphics/src/gle/core.cpp
===================================================================
--- gle-graphics.orig/src/gle/core.cpp
+++ gle-graphics/src/gle/core.cpp
@@ -176,13 +176,24 @@ void g_get_version(string* version) {
 }
 
 void g_get_build_date(string* date) {
+	unsigned long epoch;
+	char *c_time_string;
 	date->resize(0);
-#if defined(__TIME__) && defined(__DATE__)
+#if defined(DEBIAN_EPOCH)
+	// convert seconds since 1970 into date string
+	const time_t build = DEBIAN_EPOCH;
+	struct tm *tm = gmtime(&build);
+	char buf[20];
+	strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
+	string bdate(buf);
+#else
+  #if defined(__TIME__) && defined(__DATE__)
 	string bdate(__DATE__);
 	bdate += " "; bdate += __TIME__;
 	str_replace_all(bdate, "  ", " ");
-	*date = bdate;
+  #endif
 #endif
+	*date = bdate;
 }
 
 string g_get_version() {
