| 1 | From <https://github.com/bmwiedemann/psm/commit/98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2>.
|
| 2 |
|
| 3 | From 98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2 Mon Sep 17 00:00:00 2001
|
| 4 | From: "Bernhard M. Wiedemann" <[email protected]>
|
| 5 | Date: Sun, 23 Jul 2017 07:02:28 +0200
|
| 6 | Subject: [PATCH] Allow to override build date
|
| 7 |
|
| 8 | in order to make builds reproducible.
|
| 9 | See https://reproducible-builds.org/ for why this is good
|
| 10 | and https://reproducible-builds.org/specs/source-date-epoch/
|
| 11 | for the definition of this variable.
|
| 12 |
|
| 13 | Also uses UTC to be independent of timezone settings.
|
| 14 | ---
|
| 15 | Makefile | 2 +-
|
| 16 | ipath/Makefile | 2 +-
|
| 17 | 2 files changed, 2 insertions(+), 2 deletions(-)
|
| 18 |
|
| 19 | diff --git a/Makefile b/Makefile
|
| 20 | index d79c4bd..99406ef 100644
|
| 21 | |
| 22 | |
| 23 | @@ -270,7 +270,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
|
| 24 | # file around. Generate it such that the ident command can find it
|
| 25 | # and strings -a | grep InfiniPath does a reasonable job as well.
|
| 26 | ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
|
| 27 | - date +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
|
| 28 | + date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
|
| 29 | $(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
|
| 30 | $(CC) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared -Wl,--unique='*fastpath*' \
|
| 31 | ${${TARGLIB}-objs} _revision.o -L$(build_dir)/ipath $(LDLIBS)
|
| 32 | diff --git a/ipath/Makefile b/ipath/Makefile
|
| 33 | index 8c2cc6e..73abd6f 100644
|
| 34 | |
| 35 | |
| 36 | @@ -70,7 +70,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
|
| 37 | # file around. Generate it such that the ident command can find it
|
| 38 | # and strings -a | grep InfiniPath does a reasonable job as well.
|
| 39 | ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
|
| 40 | - date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
|
| 41 | + date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
|
| 42 | $(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
|
| 43 | $(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
|
| 44 | -Wl,--unique='*fastpath*' \
|