mosquitto/mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch
Martin Hauke 4b29b7b40a Accepting request 512087 from home:1Antoine1:branches:network:messaging:mqtt
- Add mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch: Determine build
  timestamp from latest revision of .changes file in order to make
  the build reproducible and avoid useless republishing.

OBS-URL: https://build.opensuse.org/request/show/512087
OBS-URL: https://build.opensuse.org/package/show/network:messaging:mqtt/mosquitto?expand=0&rev=3
2017-07-22 20:23:50 +00:00

19 lines
793 B
Diff

diff -up ./CMakeLists.txt.orig ./CMakeLists.txt
--- ./CMakeLists.txt.orig 2017-03-19 13:11:32.426142255 +0100
+++ ./CMakeLists.txt 2017-03-19 13:15:02.626150970 +0100
@@ -17,8 +17,13 @@ if (WIN32)
execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
else (WIN32)
- execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP
+ if(DEFINED ENV{SOURCE_DATE_EPOCH})
+ execute_process(COMMAND date -d "@$ENV{SOURCE_DATE_EPOCH}" "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ else()
+ execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
endif (WIN32)
add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\")