Package: coquelicot
Version: 0.9.3-1
Tags: patch
Control: block -1 by 774859

Following on from the patches I provided for bug #774859 this patch-series
updates the packaging for the new upstream v0.9.3 - I realise 0.9.2-x is now
frozen for Jessie, but I needed to backport v0.9.3 to a Jessie system, so I
made the attached patches and built (with pbuilder Jessie env) and ran/tested
it on a Jessie server. Perhaps that qualifies this as a "backport" (even though
Jessie isn't the new Stable yet...). Either way it should need trivial/no
changes for the patches to work in Unstable.

Note that these patches are designed to work against code already updated by
the #774859 patches (hence why I added the block control command). I kept the
two separate so that (if OK) the #774859 patches are towards version 0.9.2-5,
and these patches are towards version 0.9.3-1 (or -bpo...).

--
Rowan Thorpe
PGP fingerprint:
 BB0A 0787 C0EE BDD8 7F97  3D30 49F2 13A5 265D CCBD
----
"There is a great difference between worry and concern. A worried person sees
a problem, and a concerned person solves a problem."
 - Harold Stephens
From bcc16a03e4cf967fa9a3cebbbe0d387a8836c066 Mon Sep 17 00:00:00 2001
From: Rowan Thorpe <ro...@rowanthorpe.com>
Date: Fri, 9 Jan 2015 10:37:49 +0200
Subject: [PATCH] Fixes related to new upstream 0.9.3

* Delete 0002-Set-a-default-time-zone.patch (included upstream)
* Delete 0007-Add-support-for-the-Psych-YAML-engine.patch (included
  upstream)
* Delete 0008-Fix-rubygem-dep-naming.patch (included upstream)
* Delete 0009-Backport-auth-error-spill-fix.patch (included upstream)
* Add 0010-Fix-gem-dependency-issues.patch
* Refresh other patches ("dquilt refresh" also updates all patch formats)
* Regenerate static gemspec
* Update debian/README.source about running
  "debian/rules create-static-gemspec" _with patches applied_
* Update debian/README.Debian, debian/control, debian/coquelicot.examples,
  and debian/settings.yml with info/dependency for new ldap auth.
* Update version in debian/README.source
* Update years in debian/copyright
---
 debian/README.Debian                               |   6 +-
 debian/README.source                               |   6 +-
 debian/control                                     |   4 +-
 debian/copyright                                   |   4 +-
 debian/coquelicot.examples                         |   1 +
 debian/coquelicot.gemspec                          |  31 ++--
 ...ems-and-bundler-optional-to-run-the-tests.patch |   2 -
 debian/patches/0002-Set-a-default-time-zone.patch  |  37 -----
 ...use-rubygems-or-bundler-to-run-Coquelicot.patch |   2 -
 ...4-Send-the-gem-prepared-earlier-as-source.patch | 157 ++++++++++++++-------
 ...0005-Adjust-paths-to-fit-Debian-packaging.patch |  15 +-
 ...0006-Stop-using-non-free-background-image.patch |  14 +-
 ...007-Add-support-for-the-Psych-YAML-engine.patch |  81 -----------
 debian/patches/0008-Fix-rubygem-dep-naming.patch   |  44 ------
 .../0009-Backport-auth-error-spill-fix.patch       |  35 -----
 .../patches/0010-Fix-gem-dependency-issues.patch   |  27 ++++
 debian/patches/series                              |   5 +-
 debian/settings.yml                                |   5 +-
 18 files changed, 179 insertions(+), 297 deletions(-)
 delete mode 100644 debian/patches/0002-Set-a-default-time-zone.patch
 delete mode 100644 debian/patches/0007-Add-support-for-the-Psych-YAML-engine.patch
 delete mode 100644 debian/patches/0008-Fix-rubygem-dep-naming.patch
 delete mode 100644 debian/patches/0009-Backport-auth-error-spill-fix.patch
 create mode 100644 debian/patches/0010-Fix-gem-dependency-issues.patch

diff --git a/debian/README.Debian b/debian/README.Debian
index 5f16ff9..1e68def 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -14,8 +14,10 @@ To adjust the authentication method, edit the `authentication_method` options
 at the bottom of `/etc/coquelicot/settings.yml`. More details about the
 supported authentication methods can be found in
 `/usr/share/doc/coquelicot/examples/settings-simplepass.yml` for the pre-shared
-password  and `/usr/share/doc/coquelicot/examples/settings-imap.yml` for
-authentication against an IMAP server.
+password, `/usr/share/doc/coquelicot/examples/settings-imap.yml` for
+authentication against an IMAP server, and
+`/usr/share/doc/coquelicot/examples/settings-ldap.yml` for authentication
+against an LDAP server.
 
 Non-buffering HTTPS reverse proxy
 ---------------------------------
diff --git a/debian/README.source b/debian/README.source
index a61b1f0..657cf83 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -19,13 +19,15 @@ Here is how to setup a work environment:
 
 Once this is done, upgrading to a new version should look like:
 
-    VERSION=0.9.3
+    VERSION=0.9.4
     git fetch potager-upstream
     git tag -v coquelicot-$VERSION
     uscan --verbose
     git-import-orig --upstream-vcs-tag=coquelicot-$VERSION ../coquelicot-$VERSION.tar.gz
-    debian/rules create-static-gemspec
     [… Adapt as needed, refresh debian/patches …]
+    [… Apply all patches using quilt …]
+    debian/rules create-static-gemspec
+    [… Unapply all patches using quilt …]
     dch -v $VERSION-1
     git-buildpackage
     [… Test, hack, build, repeat …]
diff --git a/debian/control b/debian/control
index a21c904..1b0cf10 100644
--- a/debian/control
+++ b/debian/control
@@ -26,7 +26,8 @@ Build-Depends: debhelper (>= 7.0.50~),
                ruby-sinatra-contrib,
                ruby-timecop,
                ruby-tzinfo,
-               ruby-upr
+               ruby-upr,
+               ruby-net-ldap
 Standards-Version: 3.9.6
 Vcs-Git: git://anonscm.debian.org/collab-maint/coquelicot.git
 Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/coquelicot.git;a=summary
@@ -53,6 +54,7 @@ Depends: adduser,
          ruby-sinatra,
          ruby-sinatra-contrib,
          ruby-upr,
+         ruby-net-ldap,
          ruby | ruby-interpreter,
          ${misc:Depends},
          ${shlibs:Depends}
diff --git a/debian/copyright b/debian/copyright
index f3df669..84067ee 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,7 +3,7 @@ Upstream-Name: coquelicot
 Source: https://coquelicot.potager.org/dist/
 
 Files: *
-Copyright: 2010-2013 potager.org <jardini...@potager.org>
+Copyright: 2010-2015 potager.org <jardini...@potager.org>
                 2011 mh / immerda.ch <mh+coqueli...@immerda.ch>
 License: AGPL-3+
 
@@ -13,7 +13,7 @@ Copyright: 2008 Piotr Sarnacki (drogomir.com)
 License: Expat
 
 Files: debian/*
-Copyright: 2013 Jerémy Bobbio <lu...@debian.org>
+Copyright: 2015 Jerémy Bobbio <lu...@debian.org>
 License: permissive
  Copying and distribution of this package, with or without
  modification, are permitted in any medium without royalty
diff --git a/debian/coquelicot.examples b/debian/coquelicot.examples
index 4b9cd19..2876e51 100644
--- a/debian/coquelicot.examples
+++ b/debian/coquelicot.examples
@@ -3,4 +3,5 @@ debian/coquelicot.nginx
 debian/coquelicot.pound
 conf/settings-default.yml
 conf/settings-imap.yml
+conf/settings-ldap.yml
 conf/settings-simplepass.yml
diff --git a/debian/coquelicot.gemspec b/debian/coquelicot.gemspec
index 1edc7b3..b778dd8 100644
--- a/debian/coquelicot.gemspec
+++ b/debian/coquelicot.gemspec
@@ -1,33 +1,36 @@
 # -*- encoding: utf-8 -*-
+# stub: coquelicot 0.9.3 ruby lib
 
 Gem::Specification.new do |s|
   s.name = "coquelicot"
-  s.version = "0.9.2"
+  s.version = "0.9.3"
 
   s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+  s.require_paths = ["lib"]
   s.authors = ["potager.org", "mh / immerda.ch"]
-  s.date = "2013-04-21"
+  s.date = "2015-01-08"
   s.description = "Coquelicot is a \"one-click\" file sharing web application with a\nfocus on protecting users' privacy.\n\nBasic principle: users can upload a file to the server, in return they\nget a unique URL which can be shared with others in order to download\nthe file.\n\nCoquelicot aims to protect, to some extent, users and system\nadministrators from disclosure of the files exchanged from passive and\nnot so active attackers.\n"
   s.email = ["jardini...@potager.org"]
   s.executables = ["coquelicot"]
-  s.files = ["Gemfile", "Gemfile.lock", "HACKING", "INSTALL", "LICENSE", "NEWS", "README", "Rakefile", "TODO", "bin/coquelicot", "conf/settings-default.yml", "conf/settings-imap.yml", "conf/settings-simplepass.yml", "coquelicot.gemspec", "lib/coquelicot.rb", "lib/coquelicot/app.rb", "lib/coquelicot/auth.rb", "lib/coquelicot/auth/imap.rb", "lib/coquelicot/auth/simplepass.rb", "lib/coquelicot/base_app.rb", "lib/coquelicot/depot.rb", "lib/coquelicot/helpers.rb", "lib/coquelicot/jyraphe_migrator.rb", "lib/coquelicot/num.rb", "lib/coquelicot/rack/multipart_parser.rb", "lib/coquelicot/rack/upload.rb", "lib/coquelicot/stored_file.rb", "lib/coquelicot/version.rb", "po/coquelicot.pot", "po/de/coquelicot.po", "po/fr/coquelicot.po", "public/images/ajax-loader.gif", "public/images/blank.gif", "public/images/overlay.png", "public/javascripts/coquelicot.auth.imap.js", "public/javascripts/coquelicot.auth.simplepass.js", "public/javascripts/coquelicot.js", "public/javascripts/jquery.lightBoxFu.js", "public/javascripts/jquery.uploadProgress.js", "public/stylesheets/lightbox-fu-ie6.css", "public/stylesheets/lightbox-fu-ie7.css", "spec/coquelicot/app_spec.rb", "spec/coquelicot/depot_spec.rb", "spec/coquelicot/jyraphe_migrator_spec.rb", "spec/coquelicot/rack/multipart_parser_spec.rb", "spec/coquelicot/rack/upload_spec.rb", "spec/coquelicot/stored_file_spec.rb", "spec/coquelicot_spec.rb", "spec/fixtures/LICENSE-secret-1.0/reference", "spec/fixtures/LICENSE-secret-1.0/stored_file", "spec/fixtures/LICENSE-secret-2.0/reference", "spec/fixtures/LICENSE-secret-2.0/stored_file", "spec/fixtures/LICENSE-secret-2.0/stored_file.content", "spec/fixtures/small-secret-1.0/reference", "spec/fixtures/small-secret-1.0/stored_file", "spec/spec_helper.rb", "views/about_your_data.haml", "views/auth/imap.haml", "views/auth/simplepass.haml", "views/download_in_progress.haml", "views/enter_file_key.haml", "views/error.haml", "views/expired.haml", "views/forbidden.haml", "views/index.haml", "views/layout.haml", "views/not_found.haml", "views/ready.haml", "views/style.sass", "lib/coquelicot/debian.rb", "public/javascripts/jquery.min.js"]
+  s.files = ["Gemfile", "Gemfile.lock", "HACKING", "INSTALL", "LICENSE", "NEWS", "README", "Rakefile", "TODO", "bin/coquelicot", "conf/settings-default.yml", "conf/settings-imap.yml", "conf/settings-ldap.yml", "conf/settings-simplepass.yml", "coquelicot.gemspec", "lib/coquelicot.rb", "lib/coquelicot/app.rb", "lib/coquelicot/auth.rb", "lib/coquelicot/auth/imap.rb", "lib/coquelicot/auth/ldap.rb", "lib/coquelicot/auth/simplepass.rb", "lib/coquelicot/base_app.rb", "lib/coquelicot/debian.rb", "lib/coquelicot/depot.rb", "lib/coquelicot/helpers.rb", "lib/coquelicot/jyraphe_migrator.rb", "lib/coquelicot/num.rb", "lib/coquelicot/rack/multipart_parser.rb", "lib/coquelicot/rack/upload.rb", "lib/coquelicot/stored_file.rb", "lib/coquelicot/version.rb", "po/coquelicot.pot", "po/de/coquelicot.po", "po/es/coquelicot.po", "po/fr/coquelicot.po", "public/images/ajax-loader.gif", "public/images/blank.gif", "public/images/overlay.png", "public/javascripts/coquelicot.auth.imap.js", "public/javascripts/coquelicot.auth.ldap.js", "public/javascripts/coquelicot.auth.simplepass.js", "public/javascripts/coquelicot.js", "public/javascripts/jquery.lightBoxFu.js", "public/javascripts/jquery.min.js", "public/javascripts/jquery.uploadProgress.js", "public/stylesheets/lightbox-fu-ie6.css", "public/stylesheets/lightbox-fu-ie7.css", "spec/coquelicot/app_spec.rb", "spec/coquelicot/depot_spec.rb", "spec/coquelicot/jyraphe_migrator_spec.rb", "spec/coquelicot/rack/multipart_parser_spec.rb", "spec/coquelicot/rack/upload_spec.rb", "spec/coquelicot/stored_file_spec.rb", "spec/coquelicot_spec.rb", "spec/fixtures/LICENSE-secret-1.0/reference", "spec/fixtures/LICENSE-secret-1.0/stored_file", "spec/fixtures/LICENSE-secret-2.0/reference", "spec/fixtures/LICENSE-secret-2.0/stored_file", "spec/fixtures/LICENSE-secret-2.0/stored_file.content", "spec/fixtures/small-secret-1.0/reference", "spec/fixtures/small-secret-1.0/stored_file", "spec/spec_helper.rb", "views/about_your_data.haml", "views/auth/imap.haml", "views/auth/ldap.haml", "views/auth/simplepass.haml", "views/download_in_progress.haml", "views/enter_file_key.haml", "views/error.haml", "views/expired.haml", "views/forbidden.haml", "views/index.haml", "views/layout.haml", "views/not_found.haml", "views/ready.haml", "views/style.sass"]
   s.homepage = "https://coquelicot.potager.org/";
-  s.require_paths = ["lib"]
-  s.rubygems_version = "1.8.23"
+  s.rubygems_version = "2.2.2"
   s.summary = "\"one-click\" file sharing web application focusing on privacy"
 
   if s.respond_to? :specification_version then
-    s.specification_version = 3
+    s.specification_version = 4
 
     if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
       s.add_development_dependency(%q<rake>, [">= 0"])
-      s.add_development_dependency(%q<rspec>, ["~> 2.6"])
+      s.add_development_dependency(%q<rspec>, ["~> 2.11"])
       s.add_development_dependency(%q<hpricot>, [">= 0"])
       s.add_development_dependency(%q<timecop>, [">= 0"])
       s.add_development_dependency(%q<rack-test>, [">= 0"])
       s.add_development_dependency(%q<capybara>, [">= 0"])
       s.add_development_dependency(%q<activesupport>, [">= 0"])
-      s.add_development_dependency(%q<gettext>, [">= 0"])
+      s.add_development_dependency(%q<tzinfo>, [">= 0"])
+      s.add_development_dependency(%q<gettext>, ["~> 3"])
+      s.add_development_dependency(%q<net-ldap>, [">= 0"])
       s.add_runtime_dependency(%q<sinatra>, ["~> 1.3"])
       s.add_runtime_dependency(%q<sinatra-contrib>, ["~> 1.3"])
       s.add_runtime_dependency(%q<rack>, ["~> 1.1"])
@@ -44,13 +47,15 @@ Gem::Specification.new do |s|
       s.add_runtime_dependency(%q<moneta>, ["~> 0.7"])
     else
       s.add_dependency(%q<rake>, [">= 0"])
-      s.add_dependency(%q<rspec>, ["~> 2.6"])
+      s.add_dependency(%q<rspec>, ["~> 2.11"])
       s.add_dependency(%q<hpricot>, [">= 0"])
       s.add_dependency(%q<timecop>, [">= 0"])
       s.add_dependency(%q<rack-test>, [">= 0"])
       s.add_dependency(%q<capybara>, [">= 0"])
       s.add_dependency(%q<activesupport>, [">= 0"])
-      s.add_dependency(%q<gettext>, [">= 0"])
+      s.add_dependency(%q<tzinfo>, [">= 0"])
+      s.add_dependency(%q<gettext>, ["~> 3"])
+      s.add_dependency(%q<net-ldap>, [">= 0"])
       s.add_dependency(%q<sinatra>, ["~> 1.3"])
       s.add_dependency(%q<sinatra-contrib>, ["~> 1.3"])
       s.add_dependency(%q<rack>, ["~> 1.1"])
@@ -68,13 +73,15 @@ Gem::Specification.new do |s|
     end
   else
     s.add_dependency(%q<rake>, [">= 0"])
-    s.add_dependency(%q<rspec>, ["~> 2.6"])
+    s.add_dependency(%q<rspec>, ["~> 2.11"])
     s.add_dependency(%q<hpricot>, [">= 0"])
     s.add_dependency(%q<timecop>, [">= 0"])
     s.add_dependency(%q<rack-test>, [">= 0"])
     s.add_dependency(%q<capybara>, [">= 0"])
     s.add_dependency(%q<activesupport>, [">= 0"])
-    s.add_dependency(%q<gettext>, [">= 0"])
+    s.add_dependency(%q<tzinfo>, [">= 0"])
+    s.add_dependency(%q<gettext>, ["~> 3"])
+    s.add_dependency(%q<net-ldap>, [">= 0"])
     s.add_dependency(%q<sinatra>, ["~> 1.3"])
     s.add_dependency(%q<sinatra-contrib>, ["~> 1.3"])
     s.add_dependency(%q<rack>, ["~> 1.1"])
diff --git a/debian/patches/0001-Make-rubygems-and-bundler-optional-to-run-the-tests.patch b/debian/patches/0001-Make-rubygems-and-bundler-optional-to-run-the-tests.patch
index 7a0ca97..926c2e9 100644
--- a/debian/patches/0001-Make-rubygems-and-bundler-optional-to-run-the-tests.patch
+++ b/debian/patches/0001-Make-rubygems-and-bundler-optional-to-run-the-tests.patch
@@ -6,8 +6,6 @@ Subject: Make rubygems and bundler optional to run the tests
  spec/spec_helper.rb |   12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)
 
-diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
-index 5e20020..d95c565 100644
 --- a/spec/spec_helper.rb
 +++ b/spec/spec_helper.rb
 @@ -17,10 +17,14 @@
diff --git a/debian/patches/0002-Set-a-default-time-zone.patch b/debian/patches/0002-Set-a-default-time-zone.patch
deleted file mode 100644
index ee70110..0000000
--- a/debian/patches/0002-Set-a-default-time-zone.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lu...@debian.org>
-Date: Wed, 3 Apr 2013 10:05:33 +0000
-Subject: Set a default time zone
-
----
- coquelicot.gemspec  |    1 +
- spec/spec_helper.rb |    5 +++++
- 2 files changed, 6 insertions(+)
-
-diff --git a/coquelicot.gemspec b/coquelicot.gemspec
-index 5d8f3e1..b9c1b15 100644
---- a/coquelicot.gemspec
-+++ b/coquelicot.gemspec
-@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
-   s.add_development_dependency 'rack-test'
-   s.add_development_dependency 'capybara'
-   s.add_development_dependency 'active_support'
-+  s.add_development_dependency 'tzinfo'
-   s.add_development_dependency 'gettext'
- 
-   s.add_runtime_dependency 'sinatra', '~>1.3'
-diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
-index d95c565..375e9cf 100644
---- a/spec/spec_helper.rb
-+++ b/spec/spec_helper.rb
-@@ -30,6 +30,11 @@ require 'rack/test'
- require 'rspec'
- require 'stringio'
- 
-+# Set a default time zone. Otherwise tests using Timecop fail when
-+# active_support is loaded.
-+require 'active_support/time'
-+Time.zone = 'UTC'
-+
- require 'coquelicot'
- 
- shared_context 'with Coquelicot::Application' do
diff --git a/debian/patches/0003-Do-not-use-rubygems-or-bundler-to-run-Coquelicot.patch b/debian/patches/0003-Do-not-use-rubygems-or-bundler-to-run-Coquelicot.patch
index fd31abc..68fc375 100644
--- a/debian/patches/0003-Do-not-use-rubygems-or-bundler-to-run-Coquelicot.patch
+++ b/debian/patches/0003-Do-not-use-rubygems-or-bundler-to-run-Coquelicot.patch
@@ -6,8 +6,6 @@ Subject: Do not use rubygems or bundler to run Coquelicot
  bin/coquelicot |    8 --------
  1 file changed, 8 deletions(-)
 
-diff --git a/bin/coquelicot b/bin/coquelicot
-index 30ccc35..49d2931 100755
 --- a/bin/coquelicot
 +++ b/bin/coquelicot
 @@ -16,14 +16,6 @@
diff --git a/debian/patches/0004-Send-the-gem-prepared-earlier-as-source.patch b/debian/patches/0004-Send-the-gem-prepared-earlier-as-source.patch
index ffa666d..5734f12 100644
--- a/debian/patches/0004-Send-the-gem-prepared-earlier-as-source.patch
+++ b/debian/patches/0004-Send-the-gem-prepared-earlier-as-source.patch
@@ -9,8 +9,6 @@ Subject: Send the gem prepared earlier as source
  spec/coquelicot/app_spec.rb |   46 +++++--------------------------------------
  4 files changed, 9 insertions(+), 71 deletions(-)
 
-diff --git a/lib/coquelicot.rb b/lib/coquelicot.rb
-index 3b80200..ac54035 100644
 --- a/lib/coquelicot.rb
 +++ b/lib/coquelicot.rb
 @@ -17,6 +17,7 @@
@@ -21,11 +19,9 @@ index 3b80200..ac54035 100644
  require 'coquelicot/auth'
  require 'coquelicot/stored_file'
  require 'coquelicot/depot'
-diff --git a/lib/coquelicot/app.rb b/lib/coquelicot/app.rb
-index 181d318..7b348ea 100644
 --- a/lib/coquelicot/app.rb
 +++ b/lib/coquelicot/app.rb
-@@ -26,7 +26,6 @@ require 'moneta'
+@@ -26,7 +26,6 @@
  require 'unicorn/launcher'
  require 'rainbows'
  require 'optparse'
@@ -33,41 +29,67 @@ index 181d318..7b348ea 100644
  
  module Coquelicot
    class << self
-@@ -294,30 +293,8 @@ module Coquelicot
+@@ -290,57 +289,9 @@
+       haml :about_your_data
      end
  
-     get '/source' do
--      Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
+-    if defined? Gem::Package.build
+-      get '/source' do
+-        Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
 -
--      spec = Gem::loaded_specs['coquelicot'].clone
--      Dir.chdir(spec.full_gem_path) do
+-        spec = Gem::loaded_specs['coquelicot'].clone
 -        spec.version = gem_version
--        spec.mark_version
--        spec.validate
 -        Tempfile.open('coquelicot-gem') do |gem_file|
--          Gem::Package.open(gem_file, 'w', nil) do |pkg|
--            pkg.metadata = spec.to_yaml
--            spec.files.each do |file|
--              next if File.directory?(file)
--              stat = File.stat(file)
--              mode = stat.mode & 0777
--              size = stat.size
--              pkg.add_file_simple(file, mode, size) do |tar_io|
--                tar_io.write(open(file, "rb") { |f| f.read })
+-          Dir.mktmpdir('coquelicot-gen-gem') do |tmpdir|
+-            Dir.chdir(spec.full_gem_path) do
+-              spec.files.each do |file|
+-                dest = "#{tmpdir}/#{file}"
+-                FileUtils.mkdir_p(File.dirname(dest))
+-                FileUtils.cp(file, dest)
 -              end
 -            end
+-            Dir.chdir("#{tmpdir}") do
+-              filename = Gem::Package.build(spec)
+-              gem_file.write(File.read(filename))
+-            end
 -          end
 -          send_file gem_file.path, :filename => spec.file_name
 -          gem_file.unlink
 -        end
 -      end
+-    else
+-      get '/source' do
+-        Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
+-
+-        spec = Gem::loaded_specs['coquelicot'].clone
+-        Dir.chdir(spec.full_gem_path) do
+-          spec.version = gem_version
+-          spec.mark_version
+-          spec.validate
+-          Tempfile.open('coquelicot-gem') do |gem_file|
+-            Gem::Package.open(gem_file, 'w', nil) do |pkg|
+-              pkg.metadata = spec.to_yaml
+-              spec.files.each do |file|
+-                next if File.directory?(file)
+-                stat = File.stat(file)
+-                mode = stat.mode & 0777
+-                size = stat.size
+-                pkg.add_file_simple(file, mode, size) do |tar_io|
+-                  tar_io.write(open(file, "rb") { |f| f.read })
+-                end
+-              end
+-            end
+-            send_file gem_file.path, :filename => spec.file_name
+-            gem_file.unlink
+-          end
+-        end
+-      end
++    get '/source' do
 +      send_file "/usr/share/coquelicot/public/coquelicot-#{gem_version}.gem",
 +                :filename => "coquelicot-#{gem_version}.gem"
      end
  
      get '/random_pass' do
-diff --git a/lib/coquelicot/helpers.rb b/lib/coquelicot/helpers.rb
-index 75ab131..fd0bb1c 100644
 --- a/lib/coquelicot/helpers.rb
 +++ b/lib/coquelicot/helpers.rb
 @@ -16,8 +16,6 @@
@@ -79,7 +101,7 @@ index 75ab131..fd0bb1c 100644
  module Coquelicot
    module Helpers
      def can_provide_git_repository?
-@@ -45,9 +43,7 @@ module Coquelicot
+@@ -45,9 +43,7 @@
      end
  
      def gem_version
@@ -90,11 +112,9 @@ index 75ab131..fd0bb1c 100644
      end
  
      def clone_command
-diff --git a/spec/coquelicot/app_spec.rb b/spec/coquelicot/app_spec.rb
-index 44e5c6a..064ef2a 100644
 --- a/spec/coquelicot/app_spec.rb
 +++ b/spec/coquelicot/app_spec.rb
-@@ -272,47 +272,11 @@ describe Coquelicot::Application do
+@@ -268,80 +268,11 @@
    end
  
    describe 'get /source' do
@@ -105,38 +125,71 @@ index 44e5c6a..064ef2a 100644
 -        visit '/source'
 -      end
 -      it 'should send a file to be saved' do
--        page.response_headers['Content-Type'].should == 'application/octet-stream'
--        page.response_headers['Content-Disposition'].should =~ /^attachment;/
+-        expect(page.response_headers['Content-Type']).to be == 'application/octet-stream'
+-        expect(page.response_headers['Content-Disposition']).to match /^attachment;/
 -      end
 -      it 'should send a file with a proposed name correct for coquelicot gem' do
--        page.response_headers['Content-Disposition'].should =~ /filename="coquelicot-.*\.gem"/
+-        expect(page.response_headers['Content-Disposition']).to match /filename="coquelicot-.*\.gem"/
 -      end
--      context 'the downloaded gem' do
--        around(:each) do |example|
--          Gem::Package.open(StringIO.new(page.driver.response.body)) do |gem|
--            @gem = gem
--            example.run
+-      if defined? Gem::Package.new
+-        context 'the downloaded gem' do
+-          around(:each) do |example|
+-            Tempfile.open('coquelicot-downloaded-gem') do |gem_file|
+-              gem_file.write(page.driver.response.body)
+-              @gem = Gem::Package.new(gem_file.path)
+-              example.run
+-              gem_file.unlink
+-            end
 -          end
--        end
--        it 'should be named "coquelicot"' do
--          @gem.metadata.name.should == 'coquelicot'
--        end
--        it "should have a version containing 'onecoolhostname' for the hostname" do
--          @gem.metadata.version.to_s.should =~ /\.onecoolhostname\./
--        end
--        it "should have a version containing today's date" do
--          Timecop.freeze(Time.now) do
--            date_str = Date.today.strftime('%Y%m%d')
--            @gem.metadata.version.to_s.should =~ /\.#{date_str}$/
+-          it 'should be named "coquelicot"' do
+-            expect(@gem.spec.name).to be == 'coquelicot'
+-          end
+-          it "should have a version containing 'onecoolhostname' for the hostname" do
+-            expect(@gem.spec.version.to_s).to match /\.onecoolhostname\./
+-          end
+-          it "should have a version containing today's date" do
+-            Timecop.freeze(Time.now) do
+-              date_str = Date.today.strftime('%Y%m%d')
+-              expect(@gem.spec.version.to_s).to match /\.#{date_str}$/
+-            end
+-          end
+-          it 'should at least contain this spec file' do
+-            this_file = __FILE__.gsub(/^.*\/spec/, 'spec')
+-            content = nil
+-            @gem.spec.files.each do |file|
+-              content = File.read(file, :encoding => 'binary') if file.end_with?(this_file)
+-            end
+-            expect(content).to be == File.read(__FILE__, :encoding => 'binary')
 -          end
 -        end
--        it 'should at least contain this spec file' do
--          this_file = __FILE__.gsub(/^.*\/spec/, 'spec')
--          content = nil
--          @gem.each do |file|
--            content = file.read if file.full_name.end_with?(this_file)
+-      else
+-        context 'the downloaded gem' do
+-          around(:each) do |example|
+-            Gem::Package.open(StringIO.new(page.driver.response.body)) do |gem|
+-              @gem = gem
+-              example.run
+-            end
+-          end
+-          it 'should be named "coquelicot"' do
+-            expect(@gem.metadata.name).to be == 'coquelicot'
+-          end
+-          it "should have a version containing 'onecoolhostname' for the hostname" do
+-            expect(@gem.metadata.version.to_s).to match /\.onecoolhostname\./
+-          end
+-          it "should have a version containing today's date" do
+-            Timecop.freeze(Time.now) do
+-              date_str = Date.today.strftime('%Y%m%d')
+-              expect(@gem.metadata.version.to_s).to match /\.#{date_str}$/
+-            end
+-          end
+-          it 'should at least contain this spec file' do
+-            this_file = __FILE__.gsub(/^.*\/spec/, 'spec')
+-            content = nil
+-            @gem.each do |file|
+-              content = file.read if file.full_name.end_with?(this_file)
+-            end
+-            expect(content).to be == File.open(__FILE__, 'rb').read
 -          end
--          content.should == File.open(__FILE__, 'rb').read
 -        end
 -      end
 +    it 'should send the Debian prepared gem' do
diff --git a/debian/patches/0005-Adjust-paths-to-fit-Debian-packaging.patch b/debian/patches/0005-Adjust-paths-to-fit-Debian-packaging.patch
index eba416b..0bdca43 100644
--- a/debian/patches/0005-Adjust-paths-to-fit-Debian-packaging.patch
+++ b/debian/patches/0005-Adjust-paths-to-fit-Debian-packaging.patch
@@ -7,11 +7,9 @@ Subject: Adjust paths to fit Debian packaging
  lib/coquelicot/base_app.rb |    5 ++++-
  2 files changed, 19 insertions(+), 7 deletions(-)
 
-diff --git a/lib/coquelicot/app.rb b/lib/coquelicot/app.rb
-index 7b348ea..6c2ccb0 100644
 --- a/lib/coquelicot/app.rb
 +++ b/lib/coquelicot/app.rb
-@@ -26,6 +26,7 @@ require 'moneta'
+@@ -26,6 +26,7 @@
  require 'unicorn/launcher'
  require 'rainbows'
  require 'optparse'
@@ -19,7 +17,7 @@ index 7b348ea..6c2ccb0 100644
  
  module Coquelicot
    class << self
-@@ -232,7 +233,13 @@ module Coquelicot
+@@ -224,7 +225,13 @@
      set :protection, :except => [:session_hijacking, :remote_token]
  
      set :root, Proc.new { app_file && File.expand_path('../../..', app_file) }
@@ -34,7 +32,7 @@ index 7b348ea..6c2ccb0 100644
      set :max_file_size, 5 * 1024 * 1024 # 5 MiB
      set :default_expire, 60
      set :maximum_expire, 60 * 24 * 30 # 1 month
-@@ -241,14 +248,14 @@ module Coquelicot
+@@ -233,15 +240,15 @@
      set :random_pass_length, 16
      set :about_text, 'en' => ''
      set :additional_css, ''
@@ -43,6 +41,7 @@ index 7b348ea..6c2ccb0 100644
 +    set :pid, '/var/run/coquelicot.pid'
 +    set :log, '/var/log/coquelicot/coquelicot.log'
      set :listen, [ "127.0.0.1:51161" ]
+     set :path, '/'
      set :show_exceptions, false
      set :authentication_method, :name => :simplepass,
                                  :upload_password => 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'
@@ -52,7 +51,7 @@ index 7b348ea..6c2ccb0 100644
  
      set :upr_backend, Upr::Monitor.new(Moneta.new(:Memory))
      use Upr, :backend => upr_backend, :path_info => %q{/upload}
-@@ -284,8 +291,10 @@ module Coquelicot
+@@ -281,8 +288,10 @@
      end
  
      get '/README' do
@@ -65,11 +64,9 @@ index 7b348ea..6c2ccb0 100644
      end
  
      get '/about-your-data' do
-diff --git a/lib/coquelicot/base_app.rb b/lib/coquelicot/base_app.rb
-index c253be4..0e080ee 100644
 --- a/lib/coquelicot/base_app.rb
 +++ b/lib/coquelicot/base_app.rb
-@@ -28,7 +28,10 @@ module Coquelicot
+@@ -28,7 +28,10 @@
      helpers Coquelicot::Helpers
  
      FastGettext.add_text_domain 'coquelicot',
diff --git a/debian/patches/0006-Stop-using-non-free-background-image.patch b/debian/patches/0006-Stop-using-non-free-background-image.patch
index 6c4f9e8..06d320e 100644
--- a/debian/patches/0006-Stop-using-non-free-background-image.patch
+++ b/debian/patches/0006-Stop-using-non-free-background-image.patch
@@ -13,11 +13,9 @@ The background image currently shipped with Coquelicot is licensed under CC-BY
  views/style.sass            |    2 +-
  3 files changed, 3 insertions(+), 7 deletions(-)
 
-diff --git a/README b/README
-index 7571d3b..fe9cee5 100644
 --- a/README
 +++ b/README
-@@ -106,10 +106,6 @@ Authors
+@@ -108,10 +108,6 @@
  Coquelicot is distributed under the [GNU Affero General Public License]
  version 3 or (at your option) any later version.
  
@@ -25,14 +23,12 @@ index 7571d3b..fe9cee5 100644
 -[“coquelicot” picture] © 2008 Jean-Louis Zimmermann  
 -Licensed under [Creative Commons Attributions 2.0 Generic]  
 -
+ LDAP authentication code initially provided by Rowan Thorpe.
+ 
  *jQuery* is © 2011 John Resig. Licensed under the [MIT license].  
- *jquery.uploadProgress* is © 2008 Piotr Sarnacki. Licensed under the
- [MIT license].  
-diff --git a/spec/coquelicot/app_spec.rb b/spec/coquelicot/app_spec.rb
-index 064ef2a..1f4078d 100644
 --- a/spec/coquelicot/app_spec.rb
 +++ b/spec/coquelicot/app_spec.rb
-@@ -283,8 +283,8 @@ describe Coquelicot::Application do
+@@ -279,8 +279,8 @@
    describe 'post /authenticate' do
      context 'when given a request with too much input' do
        before do
@@ -43,8 +39,6 @@ index 064ef2a..1f4078d 100644
          post '/authenticate', :file => Rack::Test::UploadedFile.new(path, 'text/plain')
        end
        it 'should get status 413 (Request entity too large)' do
-diff --git a/views/style.sass b/views/style.sass
-index d645d4d..c1a18d1 100644
 --- a/views/style.sass
 +++ b/views/style.sass
 @@ -19,7 +19,7 @@
diff --git a/debian/patches/0007-Add-support-for-the-Psych-YAML-engine.patch b/debian/patches/0007-Add-support-for-the-Psych-YAML-engine.patch
deleted file mode 100644
index 3eea2b1..0000000
--- a/debian/patches/0007-Add-support-for-the-Psych-YAML-engine.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From: =?utf-8?q?J=C3=A9r=C3=A9my_Bobbio?= <lu...@debian.org>
-Date: Mon, 5 May 2014 16:42:41 +0200
-Subject: Add support for the Psych YAML engine
-
-Ruby 2 and onwards drop support for syck.
----
- lib/coquelicot/stored_file.rb       |    4 ----
- spec/coquelicot/stored_file_spec.rb |   18 +++++++++++++++---
- 2 files changed, 15 insertions(+), 7 deletions(-)
-
-diff --git a/lib/coquelicot/stored_file.rb b/lib/coquelicot/stored_file.rb
-index 04a4058..e617834 100644
---- a/lib/coquelicot/stored_file.rb
-+++ b/lib/coquelicot/stored_file.rb
-@@ -45,8 +45,6 @@ module Coquelicot
-     end
- 
-     def self.create(path, pass, meta)
--      YAML::ENGINE.yamler = 'syck' if YAML.const_defined? :ENGINE
--
-       salt = gen_salt
-       clear_meta = { "Coquelicot" => COQUELICOT_VERSION,
-                      "Salt" => Base64.encode64(salt).strip,
-@@ -162,8 +160,6 @@ module Coquelicot
-     end
- 
-     def initialize(path, pass)
--      YAML::ENGINE.yamler = 'syck' if YAML.const_defined? :ENGINE
--
-       @path = path
-       @file = File.open(@path)
-       if @file.lstat.size == 0 then
-diff --git a/spec/coquelicot/stored_file_spec.rb b/spec/coquelicot/stored_file_spec.rb
-index e914b01..54739ec 100644
---- a/spec/coquelicot/stored_file_spec.rb
-+++ b/spec/coquelicot/stored_file_spec.rb
-@@ -46,6 +46,17 @@ module Coquelicot
-       end
-     end
- 
-+    def read_meta(path)
-+      File.open(path) do |f|
-+        meta = f.readline
-+        while buf = f.readline
-+          break if buf =~ /^---( |\n)/
-+          meta += buf
-+        end
-+        YAML.load(meta)
-+      end
-+    end
-+
-     describe '.get_cipher' do
-       context 'when given an unknown method' do
-         it 'should raise an error' do
-@@ -172,7 +183,7 @@ module Coquelicot
-           StoredFile.stub(:gen_salt).and_return(test_salt)
-           create_stored_file('Expire-at' => expire_at)
-         end
--        let(:clear_meta) { YAML.load_file(@stored_file_path) }
-+        let(:clear_meta) { read_meta(@stored_file_path) }
-         it 'should write Coquelicot file version' do
-           clear_meta['Coquelicot'].should == '2.0'
-         end
-@@ -212,7 +223,7 @@ module Coquelicot
-         include_context 'in encrypted part', /stored_file$/
-         it 'should contain metadata as YAML block' do
-           create_stored_file
--          @cipher.content.split(/^--- \n/, 3).length.should == 2
-+          @cipher.content.split(/^---(?: |\n)/, 3).length.should == 2
-           YAML.load(@cipher.content).should be_a(Hash)
-         end
-         context 'in encrypted metadata' do
-@@ -398,7 +409,7 @@ module Coquelicot
-     describe '#close' do
-       for_all_file_versions do
-         it 'should reset the cipher' do
--          salt = Base64::decode64(YAML.load_file(stored_file_path)['Salt'])
-+          salt = Base64::decode64(read_meta(stored_file_path)['Salt'])
-           cipher = StoredFile.get_cipher('secret', salt, :decrypt)
-           StoredFile.stub(:get_cipher).and_return(cipher)
- 
diff --git a/debian/patches/0008-Fix-rubygem-dep-naming.patch b/debian/patches/0008-Fix-rubygem-dep-naming.patch
deleted file mode 100644
index 64d1b22..0000000
--- a/debian/patches/0008-Fix-rubygem-dep-naming.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From: Rowan Thorpe <ro...@rowanthorpe.com>
-Date: Fri, 2 Jan 2015 18:06:07 +0200
-Subject: Fix rubygem dep outdated-naming bug,update Gemfile.lock
-
----
- coquelicot.gemspec        | 2 +-
- Gemfile.lock              | 124 +++++++++++++++++++++++++++++------------------------------
- 2 files changed, 63 insertions(+), 63 deletions(-)
-
-diff --git a/coquelicot.gemspec b/coquelicot.gemspec
-index 5d8f3e1..19e6c94 100644
---- a/coquelicot.gemspec
-+++ b/coquelicot.gemspec
-@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
-   s.add_development_dependency 'timecop'
-   s.add_development_dependency 'rack-test'
-   s.add_development_dependency 'capybara'
--  s.add_development_dependency 'active_support'
-+  s.add_development_dependency 'activesupport'
-   s.add_development_dependency 'tzinfo'
-   s.add_development_dependency 'gettext'
- 
-diff --git a/Gemfile.lock b/Gemfile.lock
-index 8478694..87bfc51 100644
---- a/Gemfile.lock
-+++ b/Gemfile.lock
-@@ -20,8 +20,6 @@ PATH
- GEM
-   remote: https://rubygems.org/
-   specs:
--    active_support (3.0.0)
--      activesupport (= 3.0.0)
-     activesupport (3.0.0)
-     backports (3.1.0)
-     capybara (1.1.2)
-@@ -108,7 +106,7 @@ PLATFORMS
-   ruby
- 
- DEPENDENCIES
--  active_support
-+  activesupport
-   capybara
-   coquelicot!
-   gettext
diff --git a/debian/patches/0009-Backport-auth-error-spill-fix.patch b/debian/patches/0009-Backport-auth-error-spill-fix.patch
deleted file mode 100644
index ac3a1dc..0000000
--- a/debian/patches/0009-Backport-auth-error-spill-fix.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Rowan Thorpe <ro...@rowanthorpe.com>
-Date: Thu, 8 Jan 2015 13:28:10 +0200
-Subject: Backport auth-error spill fix from 0.9.3
-
----
- lib/coquelicot/app.rb | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/lib/coquelicot/app.rb b/lib/coquelicot/app.rb
-index 6c2ccb0..73328b6 100644
---- a/lib/coquelicot/app.rb
-+++ b/lib/coquelicot/app.rb
-@@ -278,7 +278,11 @@
- 
-     error 500..510 do
-       @error = env['sinatra.error'] || response.body.join
--      haml :error
-+      if request.xhr?
-+        "#{response.body.join}"
-+      else
-+        haml :error
-+      end
-     end
- 
-     get '/style.css' do
-@@ -337,6 +341,9 @@
-         'OK'
-       rescue Coquelicot::Auth::Error => ex
-         error 503, ex.message
-+      rescue => ex
-+        dump_errors! ex
-+        error 500, "Issue has been logged."
-       end
-     end
- 
diff --git a/debian/patches/0010-Fix-gem-dependency-issues.patch b/debian/patches/0010-Fix-gem-dependency-issues.patch
new file mode 100644
index 0000000..01d4278
--- /dev/null
+++ b/debian/patches/0010-Fix-gem-dependency-issues.patch
@@ -0,0 +1,27 @@
+From: Rowan Thorpe <ro...@rowanthorpe.com>
+Date: Thu, 8 Jan 2015 18:34:45 +0200
+Subject: Fix gem dependency issues
+
+---
+ coquelicot.gemspec |   3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/coquelicot.gemspec
++++ b/coquelicot.gemspec
+@@ -51,7 +51,7 @@
+   s.add_development_dependency 'capybara'
+   s.add_development_dependency 'activesupport'
+   s.add_development_dependency 'tzinfo'
+-  s.add_development_dependency 'gettext'
++  s.add_development_dependency 'gettext', '~>3'
+   s.add_development_dependency 'net-ldap'
+ 
+   s.add_runtime_dependency 'sinatra', '~>1.3'
+@@ -59,7 +59,6 @@
+   s.add_runtime_dependency 'rack', '~>1.1'
+   s.add_runtime_dependency 'haml', '~>3.1'
+   s.add_runtime_dependency 'haml-magic-translations', '~>0.3'
+-  s.add_runtime_dependency 'gettext', '~>3'
+   s.add_runtime_dependency 'sass'
+   s.add_runtime_dependency 'maruku'
+   s.add_runtime_dependency 'fast_gettext'
diff --git a/debian/patches/series b/debian/patches/series
index 8170ae3..3cdc319 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,9 +1,6 @@
 0001-Make-rubygems-and-bundler-optional-to-run-the-tests.patch
-0002-Set-a-default-time-zone.patch
 0003-Do-not-use-rubygems-or-bundler-to-run-Coquelicot.patch
 0004-Send-the-gem-prepared-earlier-as-source.patch
 0005-Adjust-paths-to-fit-Debian-packaging.patch
 0006-Stop-using-non-free-background-image.patch
-0007-Add-support-for-the-Psych-YAML-engine.patch
-0008-Fix-rubygem-dep-naming.patch
-0009-Backport-auth-error-spill-fix.patch
+0010-Fix-gem-dependency-issues.patch
diff --git a/debian/settings.yml b/debian/settings.yml
index 2d11033..c5653fd 100644
--- a/debian/settings.yml
+++ b/debian/settings.yml
@@ -111,8 +111,9 @@ show_exceptions: false
 # Authentication method
 #
 #   Please have look at
-#   `/usr/share/doc/coquelicot/examples/settings-simplepass.yml` and
-#   `/usr/share/doc/coquelicot/examples/settings-imap.yml` for more details.
+#   `/usr/share/doc/coquelicot/examples/settings-simplepass.yml`,
+#   `/usr/share/doc/coquelicot/examples/settings-imap.yml` and
+#   `/usr/share/doc/coquelicot/examples/settings-ldap.yml` for more details.
 #
 # The default password is 'test'.
 authentication_method:
-- 
2.1.3

Reply via email to