[Pkg-javascript-commits] [node-ws] 03/04: reproducible build for help2man generation

Ximin Luo infinity0 at pwned.gg
Fri Apr 17 08:32:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0-guest pushed a commit to branch master
in repository node-ws.

commit fedf72d5d41168da8aed72a0f88e3c1e0a6d2311
Author: Ximin Luo <infinity0 at pwned.gg>
Date:   Fri Apr 17 10:28:45 2015 +0200

    reproducible build for help2man generation
---
 debian/control                              | 1 +
 debian/rules                                | 4 ++++
 debian/strip-nondeterminism/dpkg-sourcedate | 3 +++
 debian/strip-nondeterminism/help2man        | 5 +++++
 4 files changed, 13 insertions(+)

diff --git a/debian/control b/debian/control
index 4dc14ca..3ed7eac 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Ximin Luo <infinity0 at pwned.gg>, Jérémy Lal <kapouer at melix.org>
 Build-Depends:
  debhelper (>= 9.0.0),
  dh-buildinfo,
+ faketime,
  help2man,
  node-commander,
  node-nan,
diff --git a/debian/rules b/debian/rules
index c2918a8..0c3c2bf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,10 @@
 SHLIBSDIR = debian/node-ws/usr/lib/nodejs/ws/lib
 SHLIBS = bufferutil.node validation.node
 
+# reproducible documentation
+export SOURCEDATE := $(shell debian/strip-nondeterminism/dpkg-sourcedate)
+export PATH := $(CURDIR)/debian/strip-nondeterminism:$(PATH)
+
 %:
 	dh $@
 
diff --git a/debian/strip-nondeterminism/dpkg-sourcedate b/debian/strip-nondeterminism/dpkg-sourcedate
new file mode 100755
index 0000000..be9cb53
--- /dev/null
+++ b/debian/strip-nondeterminism/dpkg-sourcedate
@@ -0,0 +1,3 @@
+#!/bin/sh
+export TZ=UTC # faketime uses UTC
+exec date -d "$(dpkg-parsechangelog --count 1 -SDate)" --iso-8601=seconds
diff --git a/debian/strip-nondeterminism/help2man b/debian/strip-nondeterminism/help2man
new file mode 100755
index 0000000..06373cf
--- /dev/null
+++ b/debian/strip-nondeterminism/help2man
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Depends: faketime
+# Eventually the upstream tool should support SOURCEDATE internally.
+test -n "$SOURCEDATE" || { echo >&2 "$0: SOURCEDATE not set"; exit 255; }
+exec faketime -f "$(date -d "$SOURCEDATE" +'%Y-%m-%d %H:%M:%S')" /usr/bin/help2man "$@"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ws.git



More information about the Pkg-javascript-commits mailing list