diff -Nru afterstep-2.2.12/debian/changelog afterstep-2.2.12/debian/changelog --- afterstep-2.2.12/debian/changelog 2015-05-17 10:03:13.000000000 +0000 +++ afterstep-2.2.12/debian/changelog 2015-05-31 13:03:25.000000000 +0000 @@ -1,3 +1,16 @@ +afterstep (2.2.12-6) unstable; urgency=medium + + * Apply the following patches from Juan Picca (closes: #785774): + + 47-Add-build-date-to-ASDocGen.patch: add --build-date flag + that expects an unix time (integer) and use it for timestamps + in generated files (documentation). + + 48-Make-build-reproducible.patch: modify Makefile.in by adding + the variable ASDOCGENOPTS to the command line of ASDocGen. + + debian/rules: get the unix time from the changelog file and set + the variable ASDOCGENOPTS. + + -- Robert Luberda Sun, 31 May 2015 15:03:10 +0200 + afterstep (2.2.12-5) unstable; urgency=medium * Upload to unstable. diff -Nru afterstep-2.2.12/debian/patches/47-Add-build-date-to-ASDocGen.patch afterstep-2.2.12/debian/patches/47-Add-build-date-to-ASDocGen.patch --- afterstep-2.2.12/debian/patches/47-Add-build-date-to-ASDocGen.patch 1970-01-01 00:00:00.000000000 +0000 +++ afterstep-2.2.12/debian/patches/47-Add-build-date-to-ASDocGen.patch 2015-05-31 13:03:25.000000000 +0000 @@ -0,0 +1,86 @@ +From: Juan Picca +Date: Mon, 18 May 2015 00:00:00 +0000 +Subject: 47 Add build date to ASDocGen + +Add build-date flag for use the given unix time instead current time in +timestamps. +--- + src/ASDocGen/ASDocGen.c | 31 +++++++++++++++++++++++++------ + 1 file changed, 25 insertions(+), 6 deletions(-) + +diff --git a/src/ASDocGen/ASDocGen.c b/src/ASDocGen/ASDocGen.c +index e8942d9..5f1e228 100644 +--- a/src/ASDocGen/ASDocGen.c ++++ b/src/ASDocGen/ASDocGen.c +@@ -195,14 +195,15 @@ asdocgen_usage (void) + printf ("Usage:\n" + "%s\t\t[-t |--target plain|text|html|php|xml|nroff|source] [-s | -css stylesheets_file]\n" + "\t\t\t[--faq-css stylesheets_file] [--html-data-back background] [-d | --data]\n" +- "\t\t\t[-S | --source source_dir] [-D | --dst destination_dir]\n" ++ "\t\t\t[-S | --source source_dir] [-D | --dst destination_dir] [--build-date unixtime]\n" + "-t | --target - selects oputput file format\n" + "-s | --css - selects which file to get HTML style sheets from\n" + " --faq-css - selects which file to get HTML style sheets from for FAQs\n" + " --html-data-back - which image file to use as HTML background ( default background.jpg )\n" + "-d | --data - generate HTML catalogue of image/data files\n" + "-S | --source - specifies dir to read XML source or data source from\n" +- "-D | --dst - specifies destination directory - where to wriote stuff to\n", ++ "-D | --dst - specifies destination directory - where to wriote stuff to\n" ++ " --build-date - uses the given unix time instead current time\n", + MyName); + exit (0); + } +@@ -215,6 +216,8 @@ main (int argc, char **argv) + char *source_dir = NULL ; + const char *destination_dir = NULL ; + Bool do_data = False; ++ Bool use_build_date = False; ++ time_t build_date; + ASDocType target_type = DocType_Source ; + /* Save our program name - for error messages */ + set_DeadPipe_handler(DeadPipe); +@@ -269,6 +272,17 @@ main (int argc, char **argv) + { + ++i ; + destination_dir = argv[i] ; ++ }else if( strcmp( argv[i], "--build-date" ) == 0 && i+1 < argc && argv[i+1] != NULL ) ++ { ++ ++i ; ++ struct tm tm; ++ if( strptime(argv[i], "%s", &tm) == NULL) ++ show_error( "invalid unix time \"%s\"", argv[i] ); ++ else ++ { ++ build_date = mktime(&tm); ++ use_build_date = True; ++ } + } + } + } +@@ -295,7 +309,6 @@ main (int argc, char **argv) + TopicIndexName = UserTopicIndexName ; + + if( target_type < DocType_Source ) { +- time_t curtime; + struct tm *loctime; + ASHashData hashd; + +@@ -306,9 +319,15 @@ main (int argc, char **argv) + } + + /* Get the current time. */ +- curtime = time (NULL); +- /* Convert it to local time representation. */ +- loctime = localtime (&curtime); ++ if( use_build_date ) ++ loctime = gmtime (&build_date); ++ else ++ { ++ time_t curtime = time (NULL); ++ /* Convert it to local time representation. */ ++ loctime = localtime (&curtime); ++ } ++ + strftime(CurrentDateLong, DATE_SIZE, "%b %e %Y", loctime); + strftime(CurrentDateShort, DATE_SIZE, "%m/%d/%Y", loctime); + } diff -Nru afterstep-2.2.12/debian/patches/48-Make-build-reproducible.patch afterstep-2.2.12/debian/patches/48-Make-build-reproducible.patch --- afterstep-2.2.12/debian/patches/48-Make-build-reproducible.patch 1970-01-01 00:00:00.000000000 +0000 +++ afterstep-2.2.12/debian/patches/48-Make-build-reproducible.patch 2015-05-31 13:03:25.000000000 +0000 @@ -0,0 +1,62 @@ +From: Juan Picca +Date: Tue, 19 May 2015 00:00:00 +0000 +Subject: 48 Make build reproducible + +Add variable ASDOCGENOPTS in Makefile.in to pass extra options to ASDocGen +when build the documentation. +--- + src/ASDocGen/Makefile.in | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/ASDocGen/Makefile.in b/src/ASDocGen/Makefile.in +index 4476478..c6d4407 100644 +--- a/src/ASDocGen/Makefile.in ++++ b/src/ASDocGen/Makefile.in +@@ -1,3 +1,6 @@ ++# You can set these variables from the command line. ++ASDOCGENOPTS = ++ + OBJS = ASDocGen.o datadoc.o docfile.o robodoc.o xmlproc.o + + PROG = ASDocGen +@@ -18,18 +21,18 @@ do_compile: $(OBJS) $(LIBS_DEPEND) Makefile show_flags_cc + @touch do_compile + + doc_man: do_compile +- @echo -n "Generating man pages ..." ; ./ASDocGen -l log.man -t nroff ; echo "Done" ; touch doc_man ++ @echo -n "Generating man pages ..." ; ./ASDocGen -l log.man -t nroff $(ASDOCGENOPTS) ; echo "Done" ; touch doc_man + + doc_html: do_compile +- @echo -n "Generating HTML docs ..." ; ./ASDocGen -l log.html -t html ; echo "Done" ; \ ++ @echo -n "Generating HTML docs ..." ; ./ASDocGen -l log.html -t html $(ASDOCGENOPTS) ; echo "Done" ; \ + echo -n "Extracting Visualselect HTML ..." ; tar xf visualselect4html.tar -C html ; echo "Done" ; \ + touch doc_html + + doc_xml: do_compile +- @echo -n "Generating XML docs ..." ; ./ASDocGen -l log.xml -t xml ; echo "Done" ; touch doc_xml ++ @echo -n "Generating XML docs ..." ; ./ASDocGen -l log.xml -t xml $(ASDOCGENOPTS) ; echo "Done" ; touch doc_xml + + doc_text: do_compile +- @echo -n "Generating Plain Text docs ..." ; ./ASDocGen -l log.text -t plain ; echo "Done" ; touch doc_text ++ @echo -n "Generating Plain Text docs ..." ; ./ASDocGen -l log.text -t plain $(ASDOCGENOPTS) ; echo "Done" ; touch doc_text + + data_php: do_compile + @echo "Generating PHP catalogue of installed data files ..." ; \ +@@ -37,7 +40,7 @@ data_php: do_compile + FONT_PATH="$HOME/.afterstep/desktop/fonts/:/usr/local/share/afterstep/desktop/fonts/:/usr/share/fonts/default/TrueType/:/usr/X11R6/lib/X11/fonts/TTF"; \ + IMAGE_PATH="$HOME/.afterstep/desktop/icons/:/usr/local/share/afterstep/desktop/icons/:$HOME/.afterstep/desktop/:/usr/local/share/afterstep/desktop/:$HOME/.afterstep/desktop/buttons/:/usr/local/share/afterstep/desktop/buttons/:$HOME/.afterstep/backgrounds/:/usr/local/share/afterstep/backgrounds/:/usr/X11R6/include/X11/pixmaps/"; \ + export IMAGE_PATH; export FONT_PATH; \ +- ./ASDocGen -t php --data --css data_html_styles.css -S $(AFTER_SHAREDIR) -D data/php -l /log.data.php.log ; \ ++ ./ASDocGen -t php --data --css data_html_styles.css -S $(AFTER_SHAREDIR) -D data/php -l /log.data.php.log $(ASDOCGENOPTS) ; \ + IMAGE_PATH=$(old_IMAGE_PATH); FONT_PATH=$(old_FONT_PATH); \ + export IMAGE_PATH; export FONT_PATH; \ + echo "Done" +@@ -86,7 +89,7 @@ install.data_html: do_compile + FONT_PATH="@with_afterdir@/desktop/fonts/:@datarootdir@/afterstep/desktop/fonts/:/usr/share/fonts/default/TrueType/:@x_libraries@/X11/fonts/TTF"; \ + IMAGE_PATH="@with_afterdir@/desktop/icons/:@datarootdir@/afterstep/desktop/icons/:@with_afterdir@/desktop/:@datarootdir@/afterstep/desktop/:@with_afterdir@/desktop/buttons/:@datarootdir@/afterstep/desktop/buttons/:@with_afterdir@/backgrounds/:@datarootdir@/afterstep/backgrounds/:@x_includes@/X11/pixmaps/"; \ + export IMAGE_PATH; export FONT_PATH; \ +- ./ASDocGen -t html --data --css data_html_styles.css -S $(AFTER_SHAREDIR) -D $(AFTER_DOC_DIR)/html/data -l /dev/null ; \ ++ ./ASDocGen -t html --data --css data_html_styles.css -S $(AFTER_SHAREDIR) -D $(AFTER_DOC_DIR)/html/data -l /dev/null $(ASDOCGENOPTS) ; \ + IMAGE_PATH=$(old_IMAGE_PATH); FONT_PATH=$(old_FONT_PATH); \ + export IMAGE_PATH; export FONT_PATH; \ + echo "Done"; \ diff -Nru afterstep-2.2.12/debian/patches/series afterstep-2.2.12/debian/patches/series --- afterstep-2.2.12/debian/patches/series 2015-05-17 10:03:13.000000000 +0000 +++ afterstep-2.2.12/debian/patches/series 2015-05-31 13:03:25.000000000 +0000 @@ -21,3 +21,5 @@ 44-Fix-build-with-gcc-5.patch 45-Fix-libAfterBase-Makefile.patch 46-Show-compiler-flags.patch +47-Add-build-date-to-ASDocGen.patch +48-Make-build-reproducible.patch diff -Nru afterstep-2.2.12/debian/rules afterstep-2.2.12/debian/rules --- afterstep-2.2.12/debian/rules 2015-05-17 10:03:13.000000000 +0000 +++ afterstep-2.2.12/debian/rules 2015-05-31 13:03:25.000000000 +0000 @@ -1,6 +1,8 @@ #!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 +LAST_CHANGE=$(shell dpkg-parsechangelog -S Date) +BUILD_DATE=$(shell date +%s -d "$(LAST_CHANGE)") SHELL := /bin/sh DH_AUTO_OPTIONS := -v -Sautoconf @@ -71,7 +73,7 @@ # Usage: call(common-build,additional make args) define common-build dh_auto_build $(DH_AUTO_OPTIONS) --parallel -- \ - SHELL="$(SHELL) -e" \ + SHELL="$(SHELL) -e" ASDOCGENOPTS="--build-date $(BUILD_DATE)" \ $1 endef