Description: Make the build reproducible
Author: Chris Lamb <lamby@debian.org>
Last-Update: 2020-09-25

Index: smartdns/src/smartdns.c
===================================================================
--- smartdns.orig/src/smartdns.c
+++ smartdns/src/smartdns.c
@@ -188,10 +188,7 @@ static void _smartdns_get_version(char *
 	const char *ver = SMARTDNS_VERION;
 	snprintf(str_ver, str_ver_len, "%s%s", ver, commit_ver);
 #else
-	struct tm tm;
-	get_compiled_time(&tm);
-	snprintf(str_ver, str_ver_len, "1.%.4d%.2d%.2d-%.2d%.2d%s", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
-			 tm.tm_hour, tm.tm_min, commit_ver);
+    snprintf(str_ver, sizeof(str_ver), "(unknown)");
 #endif
 }
 
@@ -734,7 +731,7 @@ static void _sig_error_exit(int signo, s
 #ifdef SMARTDNS_VERION
 	build_info = SMARTDNS_VERION;
 #else
-	build_info = __DATE__ " " __TIME__;
+	build_info = " ";
 #endif
 #if defined(__i386__)
 	int *pgregs = (int *)(&(context->uc_mcontext.gregs));
Index: smartdns/src/util.h
===================================================================
--- smartdns.orig/src/util.h
+++ smartdns/src/util.h
@@ -137,8 +137,6 @@ int full_path(char *normalized_path, int
  */
 int parse_tls_header(const char *data, size_t data_len, char *hostname, const char **hostname_ptr);
 
-void get_compiled_time(struct tm *tm);
-
 unsigned long get_system_mem_size(void);
 
 int is_numeric(const char *str);
Index: smartdns/src/util.c
===================================================================
--- smartdns.orig/src/util.c
+++ smartdns/src/util.c
@@ -1481,29 +1481,6 @@ static int parse_server_name_extension(c
 	return -2;
 }
 
-void get_compiled_time(struct tm *tm)
-{
-	char s_month[5];
-	int month = 0;
-	int day = 0;
-	int year = 0;
-	int hour = 0;
-	int min = 0;
-	int sec = 0;
-	static const char *month_names = "JanFebMarAprMayJunJulAugSepOctNovDec";
-
-	sscanf(__DATE__, "%4s %d %d", s_month, &day, &year);
-	month = (strstr(month_names, s_month) - month_names) / 3;
-	sscanf(__TIME__, "%d:%d:%d", &hour, &min, &sec);
-	tm->tm_year = year - 1900;
-	tm->tm_mon = month;
-	tm->tm_mday = day;
-	tm->tm_isdst = -1;
-	tm->tm_hour = hour;
-	tm->tm_min = min;
-	tm->tm_sec = sec;
-}
-
 unsigned long get_system_mem_size(void)
 {
 	struct sysinfo memInfo;
