diff --git a/gem2rpm.yml b/gem2rpm.yml index cc54bd0..ec7ae68 100644 --- a/gem2rpm.yml +++ b/gem2rpm.yml @@ -3,3 +3,5 @@ Ronn builds manuals. It converts simple, human readable textfiles to roff for terminal display, and also to HTML for the web. :license: MIT +:patches: + ronn-date.patch: -p1 diff --git a/ronn-date.patch b/ronn-date.patch new file mode 100644 index 0000000..4a865ce --- /dev/null +++ b/ronn-date.patch @@ -0,0 +1,29 @@ +https://github.com/kamontat/ronn/pull/3 +originally based on https://github.com/rtomayko/ronn/pull/98 + +commit 206846900163c8a538437444dfdd67a7a81e3801 +Author: Bernhard M. Wiedemann +Date: Mon Dec 9 14:36:21 2019 +0100 + + Allow to override build date with SOURCE_DATE_EPOCH + + 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. + + It prioritizes the variable over mtime + because openSUSE's `tallow` package touched a .md file with a patch. + +diff --git a/lib/ronn/document.rb b/lib/ronn/document.rb +index d42e2f9..6590c92 100644 +--- a/lib/ronn/document.rb ++++ b/lib/ronn/document.rb +@@ -171,6 +171,7 @@ module Ronn + # the current time. + def date + return @date if @date ++ return Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime if not ENV['SOURCE_DATE_EPOCH'].nil? + return File.mtime(path) if File.exist?(path) + Time.now + end diff --git a/rubygem-ronn.changes b/rubygem-ronn.changes index dbaf067..bb243e2 100644 --- a/rubygem-ronn.changes +++ b/rubygem-ronn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 9 10:26:45 UTC 2019 - Bernhard Wiedemann + +- Add ronn-date.patch to have reprodubible build time (boo#1047218) + ------------------------------------------------------------------- Tue Apr 25 17:12:12 UTC 2017 - avvissu@yandex.by diff --git a/rubygem-ronn.spec b/rubygem-ronn.spec index dafb796..dbc78da 100644 --- a/rubygem-ronn.spec +++ b/rubygem-ronn.spec @@ -1,7 +1,7 @@ # # spec file for package rubygem-ronn # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -37,6 +37,9 @@ BuildRequires: update-alternatives Url: http://rtomayko.github.com/ronn Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml +# MANUAL +Patch0: ronn-date.patch +# /MANUAL Summary: Builds manuals License: MIT Group: Development/Languages/Ruby @@ -47,6 +50,10 @@ Ronn builds manuals. It converts simple, human readable textfiles to roff for terminal display, and also to HTML for the web. %prep +%gem_unpack +%patch0 -p1 +find -type f -print0 | xargs -0 touch -r %{S:0} +%gem_build %build