Source: tin
Version: 1:2.3.2-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: locale
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Dear Maintainer,

While working on the `€œreproducible builds'€ effort [1], we have noticed
that 'tin' could not be built reproducibly.

Since LC_ALL overwrites the LC_TIME value, the cpp_reprtime script
output is locale-dependent. This could be fixed adding a LC_ALL=C
definition, but as gcc now supports the SOURCE_DATE_EPOCH environment
variable [2] to set the __DATE__ value, I think the best option is to
drop cpp_reprtime -- see attached patch.

Once applied, tin can be built reproducibly in our current
experimental framework.

Regards,
Alexis Bienvenüe.

 [1]: https://wiki.debian.org/ReproducibleBuilds
 [2]: https://reproducible-builds.org/specs/source-date-epoch/



diff -Nru tin-2.3.2/debian/changelog tin-2.3.2/debian/changelog
--- tin-2.3.2/debian/changelog	2015-12-27 15:43:34.000000000 +0100
+++ tin-2.3.2/debian/changelog	2016-06-20 12:18:59.000000000 +0200
@@ -1,3 +1,9 @@
+tin (1:2.3.2-1.0~reproducible1) UNRELEASED; urgency=medium
+
+  * drop debian/cpp_reprtime, since gcc has SOURCE_DATE_EPOCH support now.
+
+ -- Alexis Bienvenüe <p...@passoire.fr>  Mon, 20 Jun 2016 12:18:59 +0200
+
 tin (1:2.3.2-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru tin-2.3.2/debian/cpp_reprtime tin-2.3.2/debian/cpp_reprtime
--- tin-2.3.2/debian/cpp_reprtime	2015-12-27 06:16:18.000000000 +0100
+++ tin-2.3.2/debian/cpp_reprtime	1970-01-01 01:00:00.000000000 +0100
@@ -1,40 +0,0 @@
-#!/bin/sh
-set -e
-
-FILE="$1"
-if [ -z "$FILE" ]; then
-  echo "Usage: $0 FILENAME" >&2
-  echo "\nThe reproducible definitions of the C time macros will be written to FILENAME\nand options for \$CPPFLAGS will be printed on standard output."
-  exit 1
-fi
-
-CHANGELOG_DATE=$(dpkg-parsechangelog --show-field Date)
-
-if [ -z "$CHANGELOG_DATE" ]; then
-  echo "dpkg-parsechangelog is unable to parse the changelog date!" >&2
-  exit 1
-fi
-
-export LC_CTIME='C'
-export TZ='UTC'
-
-cat <<END > $FILE
-/* Reproducible timestamp macros generated by $0. */
-#ifdef __TIME__
-# undef __TIME__
-#endif
-#define __TIME__ "$(date --date="$CHANGELOG_DATE" "+%T")"
-
-#ifdef __DATE__
-# undef __DATE__
-#endif
-#define __DATE__ "$(date --date="$CHANGELOG_DATE" "+%b %e %Y")"
-
-#ifdef __TIMESTAMP__
-# undef __TIMESTAMP__
-#endif
-#define __TIMESTAMP__ "$(date --date="$CHANGELOG_DATE" "+%a %b %e %T %Y")"
-END
-
-echo "-Wno-builtin-macro-redefined -include $(pwd)/$FILE"
-
diff -Nru tin-2.3.2/debian/rules tin-2.3.2/debian/rules
--- tin-2.3.2/debian/rules	2015-12-27 15:43:07.000000000 +0100
+++ tin-2.3.2/debian/rules	2016-06-20 12:17:55.000000000 +0200
@@ -8,8 +8,6 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 -include /usr/share/dpkg/buildflags.mk
 
-CPPFLAGS+=$(shell sh debian/cpp_reprtime include/reprtime.h)
-
 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
_______________________________________________
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