From 4b29b7b40a910810c1727e2fc98946002e67cb55f3d653e443340262138b8a21 Mon Sep 17 00:00:00 2001 From: Martin Hauke Date: Sat, 22 Jul 2017 20:23:50 +0000 Subject: [PATCH] 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 --- mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch | 18 ++++++++++++++++++ mosquitto.changes | 7 +++++++ mosquitto.spec | 7 +++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch diff --git a/mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch b/mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch new file mode 100644 index 0000000..75f2936 --- /dev/null +++ b/mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,18 @@ +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}\") diff --git a/mosquitto.changes b/mosquitto.changes index bc78c15..049e81d 100644 --- a/mosquitto.changes +++ b/mosquitto.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jul 7 18:33:53 UTC 2017 - antoine.belvire@opensuse.org + +- 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. + ------------------------------------------------------------------- Wed Jul 5 20:35:17 UTC 2017 - mardnh@gmx.de diff --git a/mosquitto.spec b/mosquitto.spec index a6c3e57..6931bfb 100644 --- a/mosquitto.spec +++ b/mosquitto.spec @@ -35,7 +35,9 @@ Source2: mosquitto.fw Source4: README-conf-d Source5: README-ca_certificates Source6: README-certs -Patch: mosquitto-1.4.1_apparmor.patch +Patch0: mosquitto-1.4.1_apparmor.patch +# PATCH-FIX-UPSTREAM mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch -- Make the build reproducible +Patch1: mosquitto-1.4.12-use-SOURCE_DATE_EPOCH.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake BuildRequires: gcc-c++ @@ -136,7 +138,8 @@ Client for Mosquitto. %prep %setup -q -%patch -p1 +%patch0 -p1 +%patch1 find misc -type f -print0 | xargs -r0 chmod a-x %build