Your message dated Wed, 29 Apr 2015 16:08:47 +0000
with message-id <[email protected]>
and subject line Bug#782891: fixed in ruby-prawn 2.0.1+dfsg-1
has caused the Debian Bug report #782891,
regarding ruby-prawn: please make the build reproducible
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
782891: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782891
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: ruby-prawn
Version: 1.3.0
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
Control: block -1 by 782890

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that ruby-prawn could not be built reproducibly.

The attached patch will set the manual last update date to the latest
debian/changelog entry.

Applied together with the patch submitted for #782890, ruby-prawn can
then be built reproducibly in our current experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds

-- 
Lunar                                .''`. 
[email protected]                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
From 27cfd53708b0133278723dee307e812e4f74a33e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <[email protected]>
Date: Sun, 19 Apr 2015 16:06:50 +0200
Subject: [PATCH 2/2] Make the package build reproducibly

Add 0800_enable_manual_to_be_built_reproducibly.patch
to allow the manual last update to be set using an environment
variable and set it in debian/rules.
---
 debian/changelog                                   |  5 ++
 ...00_enable_manual_to_be_built_reproducibly.patch | 56 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/rules                                       |  4 ++
 4 files changed, 66 insertions(+)
 create mode 100644 debian/patches/0800_enable_manual_to_be_built_reproducibly.patch

diff --git a/debian/changelog b/debian/changelog
index eef987e..0fc542b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ ruby-prawn (1.3.0+dfsg-1.0~reproducible1) UNRELEASED; urgency=low
 
   * Add 0700_use_deterministic_keys_for_gradients.patch to make
     Prawn build PDF in a deterministic manner when they use gradients.
+  * Make the package build reproducibly:
+    - Add 0800_enable_manual_to_be_built_reproducibly.patch
+      to allow the manual last update to be set using an environment
+      variable.
+    - Set the build date in debian/rules.
 
  -- Jérémy Bobbio <[email protected]>  Sun, 19 Apr 2015 14:25:51 +0200
 
diff --git a/debian/patches/0800_enable_manual_to_be_built_reproducibly.patch b/debian/patches/0800_enable_manual_to_be_built_reproducibly.patch
new file mode 100644
index 0000000..e6fc7e1
--- /dev/null
+++ b/debian/patches/0800_enable_manual_to_be_built_reproducibly.patch
@@ -0,0 +1,56 @@
+Description: Enable manual to be built reproducibly
+ In order to make the manual build reproducibly, we need a way to stop
+ writing the current build time in it.
+ .
+ The following patch will allow this in two ways: if BUILD_DATE is set
+ in the environment, the date will be taken from there; otherwise, if
+ the Git index is available, the date of the last commit will be used.
+Author: Jérémy Bobbio <[email protected]>
+
+Index: git/manual/cover.rb
+===================================================================
+--- git.orig/manual/cover.rb	2015-04-19 14:21:50.000000000 +0200
++++ git/manual/cover.rb	2015-04-19 14:52:37.936507292 +0200
+@@ -23,17 +23,20 @@
+                         :size => 60}
+                      ], :at => [170, cursor - 160])
+ 
++  last_update = Time.at(ENV['BUILD_EPOCH'].to_i) if ENV['BUILD_EPOCH']
+   if Dir.exist?("#{Prawn::BASEDIR}/.git")
+     #long git commit hash
+     #commit = `git show --pretty=%H`
+     #short git commit hash
+     commit = `git show --pretty=%h`
+     git_commit = "git commit: #{commit}"
++    last_update ||= Time.at(`git log -1 --pretty='%ct'`.to_i)
+   else
+     git_commit = ""
++    last_update ||= Time.now
+   end
+ 
+-  formatted_text_box([  {:text => "Last Update: #{Time.now.strftime("%Y-%m-%d")}\n"+
++  formatted_text_box([  {:text => "Last Update: #{last_update.utc.strftime('%Y-%m-%d')}\n"+
+                                   "Prawn Version: #{Prawn::VERSION}\n"+
+                                   git_commit,
+                          :size => 12}
+Index: git/manual/document_and_page_options/metadata.rb
+===================================================================
+--- git.orig/manual/document_and_page_options/metadata.rb	2015-04-19 14:12:16.182219653 +0200
++++ git/manual/document_and_page_options/metadata.rb	2015-04-19 14:52:46.300625712 +0200
+@@ -7,6 +7,7 @@
+ require File.expand_path(File.join(File.dirname(__FILE__),
+                                    %w[.. example_helper]))
+ 
++creation_date = ENV['BUILD_EPOCH'] ? Time.at(ENV['BUILD_EPOCH'].to_i) : Time.now
+ Prawn::Document.generate("metadata.pdf",
+   :info => {
+     :Title        => "My title",
+@@ -15,7 +16,7 @@
+     :Keywords     => "test metadata ruby pdf dry",
+     :Creator      => "ACME Soft App",
+     :Producer     => "Prawn",
+-    :CreationDate => Time.now
++    :CreationDate => creation_date.utc
+   }) do
+ 
+   text "This is a test of setting metadata properties via the info option."
diff --git a/debian/patches/series b/debian/patches/series
index 3ddcfe4..6aca906 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 0500_disable_tests_using_removed_files.patch
 0600_replace_require_relative_manual.patch
 0700_use_deterministic_keys_for_gradients.patch
+0800_enable_manual_to_be_built_reproducibly.patch
diff --git a/debian/rules b/debian/rules
index f98f768..5a0b525 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,10 @@
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
 
+LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
+BUILD_EPOCH = $(shell date -u +"%s" --date="$(LAST_CHANGE)")
+export BUILD_EPOCH
+
 %:
 	dh $@ --buildsystem=ruby --with ruby
 
-- 
1.9.1

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: ruby-prawn
Source-Version: 2.0.1+dfsg-1

We believe that the bug you reported is fixed in the latest version of
ruby-prawn, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Cédric Boutillier <[email protected]> (supplier of updated ruby-prawn package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Wed, 29 Apr 2015 16:32:11 +0200
Source: ruby-prawn
Binary: ruby-prawn ruby-prawn-doc
Architecture: source all
Version: 2.0.1+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Extras Maintainers 
<[email protected]>
Changed-By: Cédric Boutillier <[email protected]>
Description:
 ruby-prawn - fast, nimble PDF generation library for Ruby
 ruby-prawn-doc - fast, nimble PDF generation library for Ruby (documentation)
Closes: 782890 782891
Changes:
 ruby-prawn (2.0.1+dfsg-1) unstable; urgency=medium
 .
   [ Jérémy Bobbio ]
   * Add 0700_use_deterministic_keys_for_gradients.patch to make
     Prawn build PDF in a deterministic manner when they use gradients.
     (Closes: #782890)
   * Make the package build reproducibly:
     - Add 0800_enable_manual_to_be_built_reproducibly.patch
       to allow the manual last update to be set using an environment
       variable. (Closes: #782891)
     - Set the build date in debian/rules.
 .
   [ Cédric Boutillier ]
   * Imported Upstream version 2.0.1+dfsg
   * Refresh patches
   * Update homepage to prawnpdf.org
   * Bump Standards-Version to 3.9.6 (no changes needed)
   * Update versions of ruby-pdf-inspector and ruby-pdf-core in dependencies
   * Enable autopkg-pkg-ruby auto-package-test suite
Checksums-Sha1:
 c2fca63c0ee12beff81c4fd9d62ca378bb0e4928 2039 ruby-prawn_2.0.1+dfsg-1.dsc
 0d60216269bc4112518f620c116de1dbd150c6e5 697011 
ruby-prawn_2.0.1+dfsg.orig.tar.gz
 b506c72e05515375168d3a46130ddb0d214ee98f 20860 
ruby-prawn_2.0.1+dfsg-1.debian.tar.xz
 2ddf5c2ffd23ff0608cad4b916c870028023a5cd 296136 ruby-prawn_2.0.1+dfsg-1_all.deb
 8fd8872c33955205edf41299a5c236c8f713bae9 375778 
ruby-prawn-doc_2.0.1+dfsg-1_all.deb
Checksums-Sha256:
 06209972b5f35f7a26710c88061f31d9a06c359a457b23ffd907b8975299331b 2039 
ruby-prawn_2.0.1+dfsg-1.dsc
 eb74df3da0942136b8eeb2ab229d0bc4c223782f3472829f935be69aa0ed2f52 697011 
ruby-prawn_2.0.1+dfsg.orig.tar.gz
 3a77ecd61b173ea109da48a32ab7addc2660030cbbd03cf4a55450ad20d5fc1c 20860 
ruby-prawn_2.0.1+dfsg-1.debian.tar.xz
 3669356aeffe11333a48646bec3b9d4ba0066db967af5eadfd525decc4389903 296136 
ruby-prawn_2.0.1+dfsg-1_all.deb
 ab7625033a48d3059d346c61df3afa9b0db5a346a7c96f43f7ad21bef5db725c 375778 
ruby-prawn-doc_2.0.1+dfsg-1_all.deb
Files:
 97142beb40f06d073a193259de9c2625 2039 ruby optional ruby-prawn_2.0.1+dfsg-1.dsc
 5faa6fd7da4f65114c508915d4795325 697011 ruby optional 
ruby-prawn_2.0.1+dfsg.orig.tar.gz
 b8ab802c30dcb88f4f9e0e4883d72f5a 20860 ruby optional 
ruby-prawn_2.0.1+dfsg-1.debian.tar.xz
 bfa3c200ad1f602c32e680c2e2663c66 296136 ruby optional 
ruby-prawn_2.0.1+dfsg-1_all.deb
 cfcf89338fbaf9478dd97c41f67419b5 375778 doc optional 
ruby-prawn-doc_2.0.1+dfsg-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCAAGBQJVQOxnAAoJEImvgrc5zSF6q6kIAIT0lSsiXkYP8m38yySJULys
2Nwxyu+UPz3QIDp2rXKOw6bmHR/w1TheOKvru2Arreb46XHhndkE9bmYjqnprk5f
znAn5TqhSQVn2LNfqNcG7A+PO9o9F5EEAvlfy7L/wlunKjbfU8AEI4MKJAFEebtM
AuEFNoTjbTltGrpHmEZmZwzPNtZl0sqVxBMXElUCo36+IRXfDkS3gwW8PXsy+mRN
t8rTMuXUkLk/yQRHaFyMUDOpFYlAMwTB5vwav9w3w9uSL2Z78f5iiwycm3N3Kq+7
DBL0hxvxGWVpOKt7v3xFhIHWcqgSj47hAav0KFlJFLO/r2mySrZ34M1yKYJhqYQ=
=5GlD
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to