[DRE-commits] r3810 - in packages-wip/redmine/trunk/debian: . doc/examples patches
Jérémy Lal
kapouer-guest at alioth.debian.org
Mon Jul 20 11:01:32 UTC 2009
Author: kapouer-guest
Date: 2009-07-20 11:01:31 +0000 (Mon, 20 Jul 2009)
New Revision: 3810
Added:
packages-wip/redmine/trunk/debian/patches/01-paths.patch
Removed:
packages-wip/redmine/trunk/debian/patches/02_production_env_and_path_config.patch
packages-wip/redmine/trunk/debian/patches/03_email_path_config.patch
packages-wip/redmine/trunk/debian/patches/04_files_path_config.patch
packages-wip/redmine/trunk/debian/patches/05_sessions_path_config.patch
packages-wip/redmine/trunk/debian/patches/06_fastcgilog_path_config.patch
Modified:
packages-wip/redmine/trunk/debian/doc/examples/apache2-alias.conf
packages-wip/redmine/trunk/debian/doc/examples/apache2-host.conf
packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host-alias.conf
packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host.conf
packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket-alias.conf
packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket.conf
packages-wip/redmine/trunk/debian/patches/series
packages-wip/redmine/trunk/debian/postinst
Log:
Change the way paths are configured, allows easier configuration.
Modified: packages-wip/redmine/trunk/debian/doc/examples/apache2-alias.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/apache2-alias.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/apache2-alias.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,8 +1,11 @@
<VirtualHost localhost>
- # if one day the special option is no longer needed
- SetEnv RAILS_RELATIVE_URL_ROOT "/redmine"
- # the needed special fcgid option
+ # DefaultInitEnv may not work, in that case, replace it with SetEnv
DefaultInitEnv RAILS_RELATIVE_URL_ROOT "/redmine"
+ DefaultInitEnv RAILS_ETC "/etc/redmine"
+ DefaultInitEnv RAILS_LOG "/var/log/redmine"
+ DefaultInitEnv RAILS_VAR "/var/lib/redmine"
+ DefaultInitEnv RAILS_CACHE "/var/cache/redmine"
+
# the fcgid socket path
SocketPath "/var/run/redmine/sockets"
Alias "/redmine" /usr/share/redmine/public
Modified: packages-wip/redmine/trunk/debian/doc/examples/apache2-host.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/apache2-host.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/apache2-host.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,4 +1,10 @@
<VirtualHost localhost>
+ # DefaultInitEnv may not work, in that case, replace it with SetEnv
+ DefaultInitEnv RAILS_RELATIVE_URL_ROOT "/redmine"
+ DefaultInitEnv RAILS_ETC "/etc/redmine"
+ DefaultInitEnv RAILS_LOG "/var/log/redmine"
+ DefaultInitEnv RAILS_VAR "/var/lib/redmine"
+ DefaultInitEnv RAILS_CACHE "/var/cache/redmine"
# the fcgid socket path
SocketPath "/var/run/redmine/sockets"
DocumentRoot /usr/share/redmine/public
Modified: packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host-alias.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host-alias.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host-alias.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -13,7 +13,11 @@
"socket" => "/var/run/redmine/sockets/fcgi.socket",
"bin-path" => "/usr/share/redmine/public/dispatch.fcgi",
"bin-environment" => (
- "RAILS_RELATIVE_URL_ROOT" => "/redmine"
+ "RAILS_RELATIVE_URL_ROOT" => "/redmine",
+ "RAILS_ETC" => "/etc/redmine",
+ "RAILS_LOG" => "/var/log/redmine",
+ "RAILS_VAR" => "/var/lib/redmine",
+ "RAILS_CACHE" => "/var/cache/redmine"
),
"check-local" => "disable",
"kill-signal" => 10 # this is because programs linked against libfcgi need USR1 kill-signal
Modified: packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/lighttpd-host.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -11,6 +11,12 @@
"max-procs" => 2,
"socket" => "/var/run/redmine/sockets/fcgi.socket",
"bin-path" => "/usr/share/redmine/public/dispatch.fcgi",
+ "bin-environment" => (
+ "RAILS_ETC" => "/etc/redmine",
+ "RAILS_LOG" => "/var/log/redmine",
+ "RAILS_VAR" => "/var/lib/redmine",
+ "RAILS_CACHE" => "/var/cache/redmine"
+ ),
"kill-signal" => 10 # this is because programs linked against libfcgi need USR1 kill-signal
)
)
Modified: packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket-alias.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket-alias.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket-alias.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -13,7 +13,11 @@
"socket" => "/var/run/redmine/sockets/fcgi.socket",
"bin-path" => "/usr/share/redmine/public/dispatch.fcgi",
"bin-environment" => (
- "RAILS_RELATIVE_URL_ROOT" => "/redmine"
+ "RAILS_RELATIVE_URL_ROOT" => "/redmine",
+ "RAILS_ETC" => "/etc/redmine",
+ "RAILS_LOG" => "/var/log/redmine",
+ "RAILS_VAR" => "/var/lib/redmine",
+ "RAILS_CACHE" => "/var/cache/redmine"
),
"check-local" => "disable",
"kill-signal" => 10 # this is because programs linked against libfcgi need USR1 kill-signal
Modified: packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket.conf
===================================================================
--- packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket.conf 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/doc/examples/lighttpd-socket.conf 2009-07-20 11:01:31 UTC (rev 3810)
@@ -11,6 +11,12 @@
"max-procs" => 2,
"socket" => "/var/run/redmine/sockets/fcgi.socket",
"bin-path" => "/usr/share/redmine/public/dispatch.fcgi",
+ "bin-environment" => (
+ "RAILS_ETC" => "/etc/redmine",
+ "RAILS_LOG" => "/var/log/redmine",
+ "RAILS_VAR" => "/var/lib/redmine",
+ "RAILS_CACHE" => "/var/cache/redmine"
+ ),
"kill-signal" => 10 # this is because programs linked against libfcgi need USR1 kill-signal
)
)
Added: packages-wip/redmine/trunk/debian/patches/01-paths.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/01-paths.patch (rev 0)
+++ packages-wip/redmine/trunk/debian/patches/01-paths.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -0,0 +1,84 @@
+Allows path configuration through environment variables RAILS_LOG, RAILS_VAR, RAILS_ETC, RAILS_CACHE
+
+diff -Nur redmine-0.9.0/app/models/attachment.rb redmine-0.9.0.new/app/models/attachment.rb
+--- redmine-0.9.0/app/models/attachment.rb 2009-04-25 11:31:36.000000000 +0200
++++ redmine-0.9.0.new/app/models/attachment.rb 2009-07-20 10:10:20.577250208 +0200
+@@ -43,7 +43,7 @@
+ "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
+
+ cattr_accessor :storage_path
+- @@storage_path = "#{RAILS_ROOT}/files"
++ @@storage_path = ENV['RAILS_VAR'] ? File.join(ENV['RAILS_VAR'], 'files') : "#{RAILS_ROOT}/files"
+
+ def validate
+ if self.filesize > Setting.attachment_max_size.to_i.kilobytes
+diff -Nur redmine-0.9.0/config/environment.rb redmine-0.9.0.new/config/environment.rb
+--- redmine-0.9.0/config/environment.rb 2009-05-17 11:55:13.000000000 +0200
++++ redmine-0.9.0.new/config/environment.rb 2009-07-20 10:03:30.529220583 +0200
+@@ -2,7 +2,10 @@
+
+ # 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'
++#not needed ENV['RAILS_LOG'] ||= '/var/log/redmine'
++#not needed ENV['RAILS_ETC'] ||= '/etc/redmine'
++ENV['RAILS_CACHE'] ||= "#{RAILS_ROOT}/cache"
+
+ # Specifies gem version of Rails to use when vendor/rails is not present
+ RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
+@@ -30,9 +33,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.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
++
++ # the file cache store
++ 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
+diff -Nur redmine-0.9.0/config/initializers/10-patches.rb redmine-0.9.0.new/config/initializers/10-patches.rb
+--- redmine-0.9.0/config/initializers/10-patches.rb 2009-02-22 15:46:32.000000000 +0100
++++ redmine-0.9.0.new/config/initializers/10-patches.rb 2009-07-20 10:12:30.665222136 +0200
+@@ -78,3 +78,6 @@
+ end
+
+ ActionMailer::Base.send :include, AsynchronousMailer
++
++# the session store
++ActionController::Base.session_options[:tmpdir] = File.join(ENV['RAILS_VAR'], 'sessions') unless !ENV['RAILS_VAR']
+diff -Nur redmine-0.9.0/config/initializers/40-email.rb redmine-0.9.0.new/config/initializers/40-email.rb
+--- redmine-0.9.0/config/initializers/40-email.rb 2008-07-04 20:55:45.000000000 +0200
++++ redmine-0.9.0.new/config/initializers/40-email.rb 2009-07-20 10:06:39.470459347 +0200
+@@ -1,7 +1,7 @@
+ # Loads action_mailer settings from email.yml
+ # and turns deliveries on if configuration file is found
+
+-filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
++filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'email.yml') : File.join(File.dirname(__FILE__), '..', 'email.yml')
+ if File.file?(filename)
+ mailconfig = YAML::load_file(filename)
+
+diff -Nur redmine-0.9.0/public/dispatch.fcgi.example redmine-0.9.0.new/public/dispatch.fcgi.example
+--- redmine-0.9.0/public/dispatch.fcgi.example 2008-11-11 14:54:10.000000000 +0100
++++ redmine-0.9.0.new/public/dispatch.fcgi.example 2009-07-20 10:14:50.137220270 +0200
+@@ -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'), 20
++else
++ RailsFCGIHandler.process!
++end
Deleted: packages-wip/redmine/trunk/debian/patches/02_production_env_and_path_config.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/02_production_env_and_path_config.patch 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/02_production_env_and_path_config.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,39 +0,0 @@
-Sets the environment to "production".
-Define paths for :
-* log files in /var/log/redmine/
-* database.yml in /etc/redmine/
-* file cache store in /var/cache/redmine/
-
-diff -Nur redmine-0.9.0/config/environment.rb redmine-0.9.0.new/config/environment.rb
---- redmine-0.9.0/config/environment.rb 2009-03-11 23:33:27.000000000 +0100
-+++ redmine-0.9.0.new/config/environment.rb 2009-03-11 23:45:24.000000000 +0100
-@@ -2,7 +2,7 @@
-
- # 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'
-
- # Specifies gem version of Rails to use when vendor/rails is not present
- RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
-@@ -29,11 +29,20 @@
- # Force all environments to use the same logger level
- # (by default production uses :info, the others :debug)
- # config.log_level = :debug
-+
-+ # log path
-+ config.log_path = "/var/log/redmine/#{ENV['RAILS_ENV']}.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.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
-
-+ # the file cache store
-+ config.cache_store = :file_store, "/var/cache/redmine/"
-+
-+ # Set Active Record's database.yml path
-+ config.database_configuration_file = '/etc/redmine/database.yml'
-+
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector
- config.active_record.observers = :message_observer
Deleted: packages-wip/redmine/trunk/debian/patches/03_email_path_config.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/03_email_path_config.patch 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/03_email_path_config.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,14 +0,0 @@
-Define path for email.yml in /etc/redmine/
-
-diff -Nur redmine-0.9.0/config/initializers/40-email.rb redmine-0.9.0.new/config/initializers/40-email.rb
---- redmine-0.9.0/config/initializers/40-email.rb 2009-03-11 19:51:04.000000000 +0100
-+++ redmine-0.9.0.new/config/initializers/40-email.rb 2009-03-11 20:38:51.000000000 +0100
-@@ -1,7 +1,7 @@
- # Loads action_mailer settings from email.yml
- # and turns deliveries on if configuration file is found
-
--filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
-+filename = '/etc/redmine/email.yml'
- if File.file?(filename)
- mailconfig = YAML::load_file(filename)
-
Deleted: packages-wip/redmine/trunk/debian/patches/04_files_path_config.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/04_files_path_config.patch 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/04_files_path_config.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,14 +0,0 @@
-Define path for uploaded attachments in /var/lib/redmine/files/
-
-diff -Nur redmine-0.9.0/app/models/attachment.rb redmine-0.9.0.new/app/models/attachment.rb
---- redmine-0.9.0/app/models/attachment.rb 2009-03-11 21:20:07.000000000 +0100
-+++ redmine-0.9.0.new/app/models/attachment.rb 2009-03-11 21:21:02.000000000 +0100
-@@ -43,7 +43,7 @@
- "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
-
- cattr_accessor :storage_path
-- @@storage_path = "#{RAILS_ROOT}/files"
-+ @@storage_path = "/var/lib/redmine/files"
-
- def validate
- errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes
Deleted: packages-wip/redmine/trunk/debian/patches/05_sessions_path_config.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/05_sessions_path_config.patch 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/05_sessions_path_config.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,12 +0,0 @@
-Define path for sessions files in /var/lib/redmine/sessions/
-
-diff -Nur redmine-0.9.0/config/initializers/10-patches.rb redmine-0.9.0.new/config/initializers/10-patches.rb
---- redmine-0.9.0/config/initializers/10-patches.rb 2009-02-22 15:46:32.000000000 +0100
-+++ redmine-0.9.0.new/config/initializers/10-patches.rb 2009-03-11 23:38:16.000000000 +0100
-@@ -78,3 +78,6 @@
- end
-
- ActionMailer::Base.send :include, AsynchronousMailer
-+
-+# the session store
-+ActionController::Base.session_options[:tmpdir] = '/var/lib/redmine/sessions/'
Deleted: packages-wip/redmine/trunk/debian/patches/06_fastcgilog_path_config.patch
===================================================================
--- packages-wip/redmine/trunk/debian/patches/06_fastcgilog_path_config.patch 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/06_fastcgilog_path_config.patch 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,11 +0,0 @@
-Define path for fastcgi log file in /var/log/redmine/
-
-diff -Nur redmine-0.9.0/public/dispatch.fcgi.example redmine-0.9.0.new/public/dispatch.fcgi.example
---- redmine-0.9.0/public/dispatch.fcgi.example 2008-11-11 14:54:10.000000000 +0100
-+++ redmine-0.9.0.new/public/dispatch.fcgi.example 2009-03-12 01:18:52.000000000 +0100
-@@ -21,4 +21,4 @@
- require File.dirname(__FILE__) + "/../config/environment"
- require 'fcgi_handler'
-
--RailsFCGIHandler.process!
-+RailsFCGIHandler.process! '/var/log/redmine/fastcgi.crash.log', 20
Modified: packages-wip/redmine/trunk/debian/patches/series
===================================================================
--- packages-wip/redmine/trunk/debian/patches/series 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/patches/series 2009-07-20 11:01:31 UTC (rev 3810)
@@ -1,5 +1 @@
-02_production_env_and_path_config.patch
-03_email_path_config.patch
-04_files_path_config.patch
-05_sessions_path_config.patch
-06_fastcgilog_path_config.patch
+01-paths.patch
Modified: packages-wip/redmine/trunk/debian/postinst
===================================================================
--- packages-wip/redmine/trunk/debian/postinst 2009-07-19 22:27:29 UTC (rev 3809)
+++ packages-wip/redmine/trunk/debian/postinst 2009-07-20 11:01:31 UTC (rev 3810)
@@ -68,9 +68,9 @@
if [ $withdb -eq 1 ]; then
db_get redmine/default-language && DEFAULT_LANGUAGE="$RET"
# handle rake install
- rake -s db:migrate RAILS_ENV=production VERBOSE=false
- rake -s redmine:load_default_data RAILS_ENV=production REDMINE_LANG=$DEFAULT_LANGUAGE
- rake -s config/initializers/session_store.rb RAILS_ENV=production
+ rake -s db:migrate RAILS_ENV=production RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine" VERBOSE=false
+ rake -s redmine:load_default_data RAILS_ENV=production RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine" REDMINE_LANG=$DEFAULT_LANGUAGE
+ rake -s config/initializers/session_store.rb RAILS_ENV=production RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine"
else
echo 'Manual database configuration. Webserver will not be configured either.'
fi
@@ -84,9 +84,9 @@
if [ $withdb -eq 1 ]; then
savedir="`pwd`"
cd /usr/share/redmine
- rake -s db:migrate RAILS_ENV=production VERBOSE=false
- rake -s tmp:cache:clear RAILS_ENV=production
- rake -s tmp:sessions:clear RAILS_ENV=production
+ rake -s db:migrate RAILS_ENV=production VERBOSE=false RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine"
+ rake -s tmp:cache:clear RAILS_ENV=production RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine"
+ rake -s tmp:sessions:clear RAILS_ENV=production RAILS_ETC="/etc/redmine" RAILS_LOG="/var/log/redmine" RAILS_VAR="/var/log/redmine" RAILS_CACHE="/var/cache/redmine"
cd $savedir
echo "Please go to 'Admin -> Roles & permissions' to check/set permissions for the new features, if any."
fi
More information about the Pkg-ruby-extras-commits
mailing list