Package: chktex
Version: 1.7.4-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps

Dear Maintainer,

While working on the “reproducible builds” effort [1], we have noticed
that chktex could not be built reproducibly.

The attached patch makes sure that a fixed date timestamp is used in the 
documentation,
so the build date does not appear anywhere in the output. As a fixed date, I 
picked
the date of the last d/changelog entry.
Once this patch has been applied, chktex can be built reproducibly in our 
current
experimental framework.

Thanks,
Sascha

[1]: https://wiki.debian.org/ReproducibleBuilds
diff -Nru chktex-1.7.4/debian/patches/latex2html-date.patch chktex-1.7.4/debian/patches/latex2html-date.patch
--- chktex-1.7.4/debian/patches/latex2html-date.patch	1970-01-01 00:00:00.000000000 +0000
+++ chktex-1.7.4/debian/patches/latex2html-date.patch	2016-04-03 13:18:01.000000000 +0000
@@ -0,0 +1,19 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -212,14 +212,14 @@
+ 	-rm -r HTML
+ 	$(MKDIR_P) HTML
+ 	$(PERL5) $(srcdir)/MakeHTML.pl ChkTeX.tex > HTML/ChkTeX.tex
+-	cd HTML; $(LATEX2HTML) ChkTeX.tex
++	cd HTML; $(LATEX2HTML) -address '' -info '' ChkTeX.tex
+ 	$(PERL5) -i -pe 's%</code> %</code>%gi;s%\s+([.,?!])%$$1%g;' HTML/ChkTeX/*.html
+ 
+ README: ChkTeX.tex rmeheader MakeHTML.pl
+ 	rm -rf rme
+ 	$(MKDIR_P) rme
+ 	$(PERL5) $(srcdir)/MakeHTML.pl ChkTeX.tex > rme/ChkTeX.tex
+-	cd rme; $(LATEX2HTML) -split 0 ChkTeX.tex
++	cd rme; $(LATEX2HTML) -address '' -info '' -split 0 ChkTeX.tex
+ 	$(PERL5) -i -pe 's%L<SUP><SMALL>A</SMALL></SUP>%La%g;s%T<SMALL>E</SMALL>X%TeX%g;s%<SUB>(.*)</SUB>%$$1%g' rme/ChkTeX/*.html
+ 	$(PERL5) -i -pe 's%</code> %</code>%gi;s%\s+([.,?!])%$$1%g;' rme/ChkTeX/*.html
+ 	$(LYNX) -dump rme/ChkTeX/ChkTeX.html > rme/ChkTeX.rme
diff -Nru chktex-1.7.4/debian/patches/series chktex-1.7.4/debian/patches/series
--- chktex-1.7.4/debian/patches/series	2013-06-04 11:27:50.000000000 +0000
+++ chktex-1.7.4/debian/patches/series	2016-04-03 13:16:29.000000000 +0000
@@ -1,3 +1,4 @@
 manpage.patch
 #make.patch
 #strcpy-bug.patch
+latex2html-date.patch
diff -Nru chktex-1.7.4/debian/rules chktex-1.7.4/debian/rules
--- chktex-1.7.4/debian/rules	2015-07-05 07:59:10.000000000 +0000
+++ chktex-1.7.4/debian/rules	2016-04-03 13:15:09.000000000 +0000
@@ -16,6 +16,7 @@
 TMPCFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
 CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+DEBDATE:=\\\date{$(shell TZ=UTC LC_ALL=C date -d "$$(dpkg-parsechangelog -SDate)" +'%m\/%d\/%Y')}
 
 CFLAGS = -Wall -fstack-protector --param=ssp-buffer-size=4 -Wformat $(CPPFLAGS)
 INSTALL = install
@@ -38,7 +39,7 @@
 	# Add here commands to configure the package.
 	echo $(LDFLAGS)
 	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
-		--prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc 
+		--prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc
 
 build: build-arch build-indep
 build-arch: build-stamp
@@ -49,16 +50,20 @@
 
 	# Add here commands to compile the package.
 	# build source
+	cp -p ChkTeX.tex.in ChkTeX.tex.in.backup
+	echo $(DEBDATE)
+	sed -ri "s/.date..today./$(DEBDATE)/g" ChkTeX.tex.in
 	$(MAKE) CFLAGS="$(CFLAGS) $(CXXFLAGS)" LDFLAGS="$(LDFLAGS) -lpcreposix -lpcre" chktex ChkTeX.dvi
 	# build html documentation
 	$(MAKE) html
+	mv ChkTeX.tex.in.backup ChkTeX.tex.in
 
 	touch build-stamp
 
-clean: 
+clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp 
+	rm -f build-stamp
 
 	# Add here commands to clean up after the build process.
 	[ ! -f Makefile ] || [ ! -f config.status ] || $(MAKE) clean
@@ -105,7 +110,7 @@
 
 binary: binary-indep binary-arch
 
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: build clean binary-indep binary-arch binary install
 
 get-orig-source:
 	mkdir -p ../tarballs
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to