--- a/debian/patches/reproducible_build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible_build.patch 2016-08-12 11:27:44.151656638 +0100 @@ -0,0 +1,56 @@ +Description: Make the build reproducible +Author: Chris Lamb +Last-Update: 2016-08-12 + +--- arj-3.10.22.orig/today.c ++++ arj-3.10.22/today.c +@@ -9,6 +9,8 @@ + #include "filemode.h" + + #include ++#include ++#include + + /* Date array */ + +@@ -25,7 +27,8 @@ int main(int argc, char **argv) + struct tm *stm; + FILE *stream; + int is_new=0; +- char *p; ++ char *p, *source_date_epoch, *endptr; ++ unsigned long long epoch; + int l; + + printf("TODAY v 1.22 [29/10/2000] Not a part of any binary package!\n\n"); +@@ -46,6 +49,30 @@ int main(int argc, char **argv) + strcat(out_name, "date_sig.c"); + cur_unixtime=time(NULL); + stm=localtime(&cur_unixtime); ++ 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); ++ } ++ cur_unixtime=epoch; ++ stm=gmtime(&cur_unixtime); ++ } + if(!stricmp(argv[1], "en")) + sprintf(date_sig, "[%02d %s %04d]", stm->tm_mday, months_en[stm->tm_mon], stm->tm_year+1900); + else if(!stricmp(argv[1], "fr")) --- a/debian/patches/series 2016-08-12 11:16:59.490043322 +0100 --- b/debian/patches/series 2016-08-12 11:27:40.891628312 +0100 @@ -16,3 +16,4 @@ security-traversal-dir.patch security-traversal-symlink.patch out-of-bounds-read.patch +reproducible_build.patch