[med-svn] [soapdenovo2] 08/09: make build reproducible

Sascha Steinbiss sascha at steinbiss.name
Fri May 27 22:37:10 UTC 2016


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

sascha-guest pushed a commit to branch master
in repository soapdenovo2.

commit 16e4b35ecd16e5efe86545d29df9886321e90d97
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Fri May 27 22:09:39 2016 +0000

    make build reproducible
---
 debian/changelog            |  7 ++++++
 debian/patches/reproducible | 53 +++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series       |  1 +
 debian/rules                |  7 +++++-
 4 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index a460f1f..61e055c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+soapdenovo2 (240+dfsg-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Make build reproducible.
+
+ -- Sascha Steinbiss <sascha at steinbiss.name>  Fri, 27 May 2016 20:24:56 +0000
+
 soapdenovo2 (240+dfsg-2) unstable; urgency=medium
 
   * Fix watch file to not report "-mac"
diff --git a/debian/patches/reproducible b/debian/patches/reproducible
new file mode 100644
index 0000000..cfe76ca
--- /dev/null
+++ b/debian/patches/reproducible
@@ -0,0 +1,53 @@
+--- a/sparsePregraph/Makefile
++++ b/sparsePregraph/Makefile
+@@ -6,6 +6,7 @@
+ CFLAGS+= `dpkg-buildflags --get CFLAGS` `dpkg-buildflags --get CPPFLAGS`
+ CFLAGS+=$(HARDENING_CFLAGS)
+ endif
++CFLAGS+= -DBDATE="\"$(BDATE)\"" -DBTIME="\"$(BTIME)\""
+ LDFLAGS= `dpkg-buildflags --get LDFLAGS`
+ LDFLAGS+=$(HARDENING_LDFLAGS)
+ 
+--- a/sparsePregraph/main.cpp
++++ b/sparsePregraph/main.cpp
+@@ -5,7 +5,7 @@
+ 
+ int main ( int argc, char ** argv )
+ {
+-        fprintf ( stderr, "\nVersion 1.0.3: released on July 13th, 2012\nCompile %s\t%s\n\n", __DATE__, __TIME__ );
++        fprintf ( stderr, "\nVersion 1.0.3: released on July 13th, 2012\nCompile %s\t%s\n\n", BDATE, BTIME );
+         call_pregraph_sparse ( argc, argv );
+ }
+ 
+--- a/sparsePregraph/pregraph_sparse.cpp
++++ b/sparsePregraph/pregraph_sparse.cpp
+@@ -45,7 +45,7 @@
+ /*
+ int main ( int argc, char ** argv )
+ {
+-	fprintf ( stderr, "\nVersion 1.0.3: released on July 13th, 2012\nCompile %s\t%s\n\n", __DATE__, __TIME__ );
++	fprintf ( stderr, "\nVersion 1.0.3: released on July 13th, 2012\nCompile %s\t%s\n\n", BDATE, BTIME );
+ 	call_pregraph_sparse ( argc, argv );
+ }*/
+ 
+--- a/standardPregraph/Makefile
++++ b/standardPregraph/Makefile
+@@ -34,6 +34,7 @@
+ LIBPATH=    -L/lib64 -L/usr/lib64 -L./inc
+ LIBS=       -pthread -lz -lm 
+ EXTRA_FLAGS=
++CFLAGS+= -DBDATE="\"$(BDATE)\"" -DBTIME="\"$(BTIME)\""
+ 
+ BIT_ERR = 0
+ ifeq (,$(findstring $(shell uname -m), x86_64 ppc64 ia64))
+--- a/standardPregraph/main.c
++++ b/standardPregraph/main.c
+@@ -59,7 +59,7 @@
+ int main ( int argc, char ** argv )
+ {
+ 	crc32c_Init();
+-	fprintf ( stderr, "\nVersion 2.04: released on July 13th, 2012\nCompile %s\t%s\n", __DATE__, __TIME__ );
++	fprintf ( stderr, "\nVersion 2.04: released on July 13th, 2012\nCompile %s\t%s\n", BDATE, BTIME );
+ 	argc--;
+ 	argv++;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index a2efd1d..85102e3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix_compilation
 fix_usage_name
 add_hardening
 use_debian_zlib
+reproducible
diff --git a/debian/rules b/debian/rules
index 6959327..fec15cc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,9 +3,14 @@
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
+BUILD_DATE := $(shell TZ=UTC LC_ALL=C dpkg-parsechangelog | grep Date: | cut -d' ' -f2-7)
+export TZ=UTC
+export LC_ALL=C
+export BDATE=$(shell TZ=UTC LC_ALL=C date -d"$(BUILD_DATE)" +'%b %d %Y')
+export BTIME=$(shell TZ=UTC LC_ALL=C date -d"$(BUILD_DATE)" +'%T')
 
 %:
-	dh $@ 
+	dh $@
 
 #override_dh_auto_build:
 #	cd standardPregraph && make 63mer=1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/soapdenovo2.git



More information about the debian-med-commit mailing list