infinipath-psm/reproducible.patch
Nicolas Morey-Chaisemartin fa75a0373f Accepting request 644077 from home:bmwiedemann:branches:science:HPC
Extend reproducible.patch to fix all build dates to make the package build reproducible

Upstream seems orphaned.

OBS-URL: https://build.opensuse.org/request/show/644077
OBS-URL: https://build.opensuse.org/package/show/science:HPC/infinipath-psm?expand=0&rev=23
2018-10-25 07:47:14 +00:00

43 lines
2.3 KiB
Diff

From 47497ea8597baaa65d7781468d4db09abb8ebd53 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 23 Jul 2017 07:02:28 +0200
Subject: [PATCH] Allow to override build date
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also uses UTC to be independent of timezone settings.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d79c4bd..99406ef 100644
--- a/Makefile
+++ b/Makefile
@@ -270,7 +270,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
# file around. Generate it such that the ident command can find it
# and strings -a | grep InfiniPath does a reasonable job as well.
${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
- date +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
$(CC) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared -Wl,--unique='*fastpath*' \
${${TARGLIB}-objs} _revision.o -L$(build_dir)/ipath $(LDLIBS)
Index: infinipath-psm-3.3.26.604758e/ipath/Makefile
===================================================================
--- infinipath-psm-3.3.26.604758e.orig/ipath/Makefile
+++ infinipath-psm-3.3.26.604758e/ipath/Makefile
@@ -70,7 +70,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${
# file around. Generate it such that the ident command can find it
# and strings -a | grep InfiniPath does a reasonable job as well.
${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
- date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
+ date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
$(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
-Wl,--unique='*fastpath*' \