A new user interface for you! Read more...

File sderound.patch of Package rpm

commit 329435f13d67f2039f7773e07a1b68386a8a6d56
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date:   Fri Aug 31 15:51:16 2018 +0200

    build: Make sure SOURCE_DATE_EPOCH is in the past
    
    otherwise, builds before noon will not have normalized mtimes
    from %clamp_mtime_to_source_date_epoch
    
    This also helps other programs like tar --clamp-mtime

diff --git a/build/build.c b/build/build.c
index 13c3df2c0..77cd004f1 100644
--- a/build/build.c
+++ b/build/build.c
@@ -209,8 +209,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
 	struct rpmtd_s td;
 	if (headerGet(h, RPMTAG_CHANGELOGTIME, &td, (HEADERGET_MINMEM|HEADERGET_RAW))) {
 	    char sdestr[22];
-	    snprintf(sdestr, sizeof(sdestr), "%lli",
-		     (long long) rpmtdGetNumber(&td));
+            long long sdeint = rpmtdGetNumber(&td);
+            if (sdeint % 86400 == 43200) /* was rounded to 12:00 */
+                /* make sure it is in the past, so that clamping times works */
+                sdeint -= 43200;
+	    snprintf(sdestr, sizeof(sdestr), "%lli", sdeint);
 	    rpmlog(RPMLOG_NOTICE, _("setting %s=%s\n"), "SOURCE_DATE_EPOCH", sdestr);
 	    setenv("SOURCE_DATE_EPOCH", sdestr, 0);
 	    rpmtdFreeData(&td);