[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-12-g70fca02

Ondřej Surý ondrej at sury.org
Sun Oct 14 18:31:19 UTC 2012


The following commit has been merged in the master-experimental branch:
commit d3c74cbdedbd8157627a48eaf598267a2d13781c
Author: Ondřej Surý <ondrej at sury.org>
Date:   Sun Oct 14 20:19:36 2012 +0200

    Modify FHS patch to redmine 2.1, with exception of crash log

diff --git a/debian/patches/2002_FHS_through_env_vars.patch b/debian/patches/2002_FHS_through_env_vars.patch
index f579a3c..f1500d9 100644
--- a/debian/patches/2002_FHS_through_env_vars.patch
+++ b/debian/patches/2002_FHS_through_env_vars.patch
@@ -4,78 +4,27 @@ Author: Jérémy Lal <kapouer at melix.org>
 Last-Update: 2012-01-19
 --- a/app/models/attachment.rb
 +++ b/app/models/attachment.rb
-@@ -44,7 +44,7 @@
+@@ -45,7 +45,7 @@ class Attachment < ActiveRecord::Base
                                                          "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
  
    cattr_accessor :storage_path
--  @@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{Rails.root}/files"
-+  @@storage_path = Redmine::Configuration['attachments_storage_path'] || ENV['RAILS_VAR'] ? File.join(ENV['RAILS_VAR'], 'files') : "#{Rails.root}/files"
+-  @@storage_path = Redmine::Configuration['attachments_storage_path'] || File.join(Rails.root, "files")
++  @@storage_path = Redmine::Configuration['attachments_storage_path'] || ENV['RAILS_VAR'] ? File.join(ENV['RAILS_VAR'], 'files') : File.join(Rails.root, "files")
  
-   before_save :files_to_final_location
-   after_destroy :delete_from_disk
---- a/config/environment.rb
-+++ b/config/environment.rb
-@@ -2,7 +2,15 @@
- 
- # Uncomment below to force Rails into production mode when
- # you don't control web/app server and can't set it the proper way
--# ENV['RAILS_ENV'] ||= 'production'
-+ENV['RAILS_ENV'] ||= 'production'
-+
-+# for debian package : setup proper environment variables and paths
-+# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
-+ENV['X_DEBIAN_SITEID'] ||= 'default'
-+ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
-+ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
- 
- # Bootstrap the Rails environment, frameworks, and default configuration
- require File.join(File.dirname(__FILE__), 'boot')
-@@ -31,10 +39,18 @@
-   # (by default production uses :info, the others :debug)
-   # config.log_level = :debug
- 
-+  # log path
-+  config.log_path = File.join(ENV['RAILS_LOG'], "#{ENV['RAILS_ENV']}.log") unless !ENV['RAILS_LOG']
-+
-   # Enable page/fragment caching by setting a file-based store
-   # (remember to create the caching directory and make it readable to the application)
-   # config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
- 
-+  config.cache_store = :file_store, ENV['RAILS_CACHE']
-+  
-+  # Set Active Record's database.yml path
-+  config.database_configuration_file = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
-+
-   # Activate observers that should always be running
-   # config.active_record.observers = :cacher, :garbage_collector
-   config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
+   cattr_accessor :thumbnails_storage_path
+   @@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails")
 --- a/config/initializers/10-patches.rb
 +++ b/config/initializers/10-patches.rb
-@@ -152,3 +152,6 @@
+@@ -147,3 +147,6 @@ module ActionController
      end
    end
  end
 +
 +# the session store
 +ActionController::Base.session_options[:tmpdir] = File.join(ENV['RAILS_VAR'], 'sessions') unless !ENV['RAILS_VAR']
---- a/public/dispatch.fcgi.example
-+++ b/public/dispatch.fcgi.example
-@@ -20,5 +20,8 @@
- #
- require File.dirname(__FILE__) + "/../config/environment"
- require 'fcgi_handler'
--
--RailsFCGIHandler.process!
-+if ENV['RAILS_LOG']
-+  RailsFCGIHandler.process! File.join(ENV['RAILS_LOG'], 'fastcgi.crash.log')
-+else
-+  RailsFCGIHandler.process!
-+end
 --- a/lib/redmine/configuration.rb
 +++ b/lib/redmine/configuration.rb
-@@ -31,7 +31,7 @@
+@@ -31,7 +31,7 @@ module Redmine
        # * <tt>:file</tt>: the configuration file to load (default: config/configuration.yml)
        # * <tt>:env</tt>: the environment to load the configuration for (default: Rails.env)
        def load(options={})
@@ -84,7 +33,7 @@ Last-Update: 2012-01-19
          env = options[:env] || Rails.env
  
          @config = @defaults.dup
-@@ -102,7 +102,7 @@
+@@ -102,7 +102,7 @@ module Redmine
        end
  
        def load_deprecated_email_configuration(env)
@@ -95,7 +44,7 @@ Last-Update: 2012-01-19
            @config.merge!({'email_delivery' => load_from_yaml(deprecated_email_conf, env)})
 --- a/lib/redmine/export/pdf.rb
 +++ b/lib/redmine/export/pdf.rb
-@@ -35,7 +35,7 @@
+@@ -35,7 +35,7 @@ module Redmine
          attr_accessor :footer_date
  
          def initialize(lang)
@@ -104,3 +53,30 @@ Last-Update: 2012-01-19
            FileUtils.mkdir_p @@k_path_cache unless File::exist?(@@k_path_cache)
            set_language_if_valid lang
            pdf_encoding = l(:general_pdf_encoding).upcase
+--- a/config/environment.rb
++++ b/config/environment.rb
+@@ -1,6 +1,24 @@
+ # Load the rails application
+ require File.expand_path('../application', __FILE__)
+ 
++ENV['RAILS_ENV'] ||= 'production'
++
++# for debian package : setup proper environment variables and paths
++# To run redmine as unprivileged user, see /usr/share/doc/redmine/README.Debian
++ENV['X_DEBIAN_SITEID'] ||= 'default'
++ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
++ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
++
++# log path
++config.log_path = File.join(ENV['RAILS_LOG'], "#{ENV['RAILS_ENV']}.log") unless !ENV['RAILS_LOG']
++
++config.cache_store = :file_store, ENV['RAILS_CACHE']
++
++# Set Active Record's database.yml path
++config.database_configuration_file = File.join(ENV['RAILS_ETC'], 'database.yml') unless !ENV['RAILS_ETC']
++
+ # Make sure there's no plugin in vendor/plugin before starting
+ vendor_plugins_dir = File.join(Rails.root, "vendor", "plugins")
+ if Dir.glob(File.join(vendor_plugins_dir, "*")).any?

-- 
redmine.git



More information about the Pkg-ruby-extras-commits mailing list