--- a/debian/patches/007-reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/007-reproducible-build.patch 2016-08-27 19:03:30.649751284 +0100 @@ -0,0 +1,70 @@ +Description: Make the build reproducible +Author: Chris Lamb +Last-Update: 2016-08-27 + +--- netrek-client-cow-3.3.0.orig/mkcflags.c ++++ netrek-client-cow-3.3.0/mkcflags.c +@@ -5,6 +5,8 @@ + #include + + #include ++#include ++#include + #include INC_SYS_TIME + #include + #include "version.h" +@@ -31,6 +33,8 @@ main (argc, argv) + char tbuff1[100], tbuff2[100]; + char pigcall[120]; + char *pigcallresp (); ++ char *source_date_epoch, *endptr; ++ unsigned long long epoch; + + if (argc != 3) + { +@@ -39,6 +43,34 @@ main (argc, argv) + } + seconds = time(0); + tm_date = localtime (&seconds); ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) ++ { ++ errno = 0; ++ epoch = strtoull(source_date_epoch, &endptr, 10); ++ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) ++ || (errno != 0 && epoch == 0)) ++ { ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", strerror(errno)); ++ exit(EXIT_FAILURE); ++ } ++ if (endptr == source_date_epoch) ++ { ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", endptr); ++ exit(EXIT_FAILURE); ++ } ++ if (*endptr != '\0') ++ { ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", endptr); ++ exit(EXIT_FAILURE); ++ } ++ if (epoch > ULONG_MAX) ++ { ++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu \n", ULONG_MAX, epoch); ++ exit(EXIT_FAILURE); ++ } ++ tm_date = gmtime (&epoch); ++ } + strftime (tbuff1, sizeof (tbuff1), "%a %b %d, %Y %r", tm_date); + strftime (tbuff2, sizeof (tbuff2), "%D", tm_date); + printf ("/*****************************************************************************/\n"); +--- netrek-client-cow-3.3.0.orig/sample_key.def ++++ netrek-client-cow-3.3.0/sample_key.def +@@ -31,7 +31,7 @@ SECKEYFILE = $(KEYFILE).secret + # CWHO = \"`whoami`@`hostname`\" + # CWHO = \"`whoami`@`domainname`\" + # CWHO = \"`whoami`@`hostname`.`domainname`\" +-CWHO = \"`whoami`@`hostname -f`\" ++CWHO = \"generic@generic\" + + + ####################################################################### --- a/debian/patches/series 2016-08-27 18:41:56.136219129 +0100 --- b/debian/patches/series 2016-08-27 19:03:28.625725285 +0100 @@ -4,3 +4,4 @@ 004-honor-flags.patch 005-hardening.patch 006-gcc5.patch +007-reproducible-build.patch