summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/redmine/files')
-rw-r--r--www-apps/redmine/files/10_redmine_vhost.conf12
-rw-r--r--www-apps/redmine/files/redmine-1.4.1-bundler.patch15
-rw-r--r--www-apps/redmine/files/redmine-2.initd45
-rw-r--r--www-apps/redmine/files/redmine-rubytree-r8214.patch261
-rw-r--r--www-apps/redmine/files/redmine.confd13
-rw-r--r--www-apps/redmine/files/redmine.initd45
6 files changed, 391 insertions, 0 deletions
diff --git a/www-apps/redmine/files/10_redmine_vhost.conf b/www-apps/redmine/files/10_redmine_vhost.conf
new file mode 100644
index 0000000..33a117a
--- /dev/null
+++ b/www-apps/redmine/files/10_redmine_vhost.conf
@@ -0,0 +1,12 @@
+<IfModule passenger_module>
+Listen 3000
+<VirtualHost *:3000>
+ DocumentRoot /var/lib/redmine/public
+# RailsEnv production
+ <Directory "/var/lib/redmine/public">
+ Options FollowSymLinks
+ Order allow,deny
+ Allow from all
+ </Directory>
+</VirtualHost>
+</IfModule>
diff --git a/www-apps/redmine/files/redmine-1.4.1-bundler.patch b/www-apps/redmine/files/redmine-1.4.1-bundler.patch
new file mode 100644
index 0000000..adef29a
--- /dev/null
+++ b/www-apps/redmine/files/redmine-1.4.1-bundler.patch
@@ -0,0 +1,15 @@
+diff -Naurb redmine-1.4.1.orig/config/boot.rb redmine-1.4.1/config/boot.rb
+--- redmine-1.4.1.orig/config/boot.rb 2012-04-20 19:01:56.000000000 +0900
++++ redmine-1.4.1/config/boot.rb 2012-04-25 13:00:01.702911764 +0900
+@@ -41,11 +41,6 @@
+ class Boot
+ def run
+ load_initializer
+- Rails::Initializer.class_eval do
+- def load_gems
+- @bundler_loaded ||= Bundler.require :default, Rails.env
+- end
+- end
+ Rails::Initializer.run(:set_load_path)
+ end
+ end
diff --git a/www-apps/redmine/files/redmine-2.initd b/www-apps/redmine/files/redmine-2.initd
new file mode 100644
index 0000000..e4aece8
--- /dev/null
+++ b/www-apps/redmine/files/redmine-2.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/files/redmine-2.initd,v 1.1 2013/01/07 13:39:26 matsuu Exp $
+
+RAILS_ENV=${RAILS_ENV:-production}
+REDMINE_DIR=${REDMINE_DIR:-/var/lib/redmine}
+REDMINE_ADDRESS=${REDMINE_ADDRESS:-localhost}
+REDMINE_PORT=${REDMINE_PORT:-3000}
+REDMINE_USER=${REDMINE_USER:-redmine}
+REDMINE_GROUP=${REDMINE_GROUP:-redmine}
+REDMINE_PIDFILE="${REDMINE_DIR}/tmp/pids/server.pid"
+
+depend() {
+ use apache2 git-daemon mysql net postgresql svnserve
+}
+
+start_pre() {
+ if [ ! -e "${REDMINE_DIR}/config/initializers/secret_token.rb" ] ; then
+ eerror "Execute the following command to initlize environment:"
+ eerror
+ eerror "# emerge --config www-apps/redmine"
+ eerror
+ return 1
+ fi
+}
+
+start() {
+ ebegin "Starting redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --start --quiet --user ${REDMINE_USER}:${REDMINE_GROUP} \
+ --pidfile "${REDMINE_PIDFILE}" \
+ --exec /usr/bin/ruby "${REDMINE_DIR}"/script/rails server -- \
+ --daemon --environment=${RAILS_ENV} \
+ --binding=${REDMINE_ADDRESS} --port=${REDMINE_PORT} \
+ ${REDMINE_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --signal INT --quiet --pidfile "${REDMINE_PIDFILE}"
+ eend $?
+}
diff --git a/www-apps/redmine/files/redmine-rubytree-r8214.patch b/www-apps/redmine/files/redmine-rubytree-r8214.patch
new file mode 100644
index 0000000..af325ec
--- /dev/null
+++ b/www-apps/redmine/files/redmine-rubytree-r8214.patch
@@ -0,0 +1,261 @@
+Index: test/unit/lib/redmine/menu_manager/menu_item_test.rb
+===================================================================
+--- test/unit/lib/redmine/menu_manager/menu_item_test.rb (リビジョン 8213)
++++ test/unit/lib/redmine/menu_manager/menu_item_test.rb (リビジョン 8214)
+@@ -114,7 +114,7 @@
+
+ def test_has_children
+ parent_item = get_menu_item(:test_menu, :parent)
+- assert parent_item.hasChildren?
++ assert parent_item.children.present?
+ assert_equal 2, parent_item.children.size
+ assert_equal get_menu_item(:test_menu, :child_menu), parent_item.children[0]
+ assert_equal get_menu_item(:test_menu, :child2_menu), parent_item.children[1]
+Index: config/environment.rb
+===================================================================
+--- config/environment.rb (リビジョン 8213)
++++ config/environment.rb (リビジョン 8214)
+@@ -54,7 +54,6 @@
+ # It will automatically turn deliveries on
+ config.action_mailer.perform_deliveries = false
+
+- config.gem 'rubytree', :lib => 'tree'
+ config.gem 'coderay', :version => '~>1.0.0'
+
+ # Load any local configuration that is kept out of source control
+Index: lib/redmine/menu_manager.rb
+===================================================================
+--- lib/redmine/menu_manager.rb (リビジョン 8213)
++++ lib/redmine/menu_manager.rb (リビジョン 8214)
+@@ -15,93 +15,6 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+-require 'tree' # gem install rubytree
+-
+-# Monkey patch the TreeNode to add on a few more methods :nodoc:
+-module TreeNodePatch
+- def self.included(base)
+- base.class_eval do
+- attr_reader :last_items_count
+-
+- alias :old_initilize :initialize
+- def initialize(name, content = nil)
+- old_initilize(name, content)
+- @childrenHash ||= {}
+- @last_items_count = 0
+- extend(InstanceMethods)
+- end
+- end
+- end
+-
+- module InstanceMethods
+- # Adds the specified child node to the receiver node. The child node's
+- # parent is set to be the receiver. The child is added as the first child in
+- # the current list of children for the receiver node.
+- def prepend(child)
+- raise "Child already added" if @childrenHash.has_key?(child.name)
+-
+- @childrenHash[child.name] = child
+- @children = [child] + @children
+- child.parent = self
+- return child
+-
+- end
+-
+- # Adds the specified child node to the receiver node. The child node's
+- # parent is set to be the receiver. The child is added at the position
+- # into the current list of children for the receiver node.
+- def add_at(child, position)
+- raise "Child already added" if @childrenHash.has_key?(child.name)
+-
+- @childrenHash[child.name] = child
+- @children = @children.insert(position, child)
+- child.parent = self
+- return child
+-
+- end
+-
+- def add_last(child)
+- raise "Child already added" if @childrenHash.has_key?(child.name)
+-
+- @childrenHash[child.name] = child
+- @children << child
+- @last_items_count += 1
+- child.parent = self
+- return child
+-
+- end
+-
+- # Adds the specified child node to the receiver node. The child node's
+- # parent is set to be the receiver. The child is added as the last child in
+- # the current list of children for the receiver node.
+- def add(child)
+- raise "Child already added" if @childrenHash.has_key?(child.name)
+-
+- @childrenHash[child.name] = child
+- position = @children.size - @last_items_count
+- @children.insert(position, child)
+- child.parent = self
+- return child
+-
+- end
+-
+- # Wrapp remove! making sure to decrement the last_items counter if
+- # the removed child was a last item
+- def remove!(child)
+- @last_items_count -= +1 if child && child.last
+- super
+- end
+-
+-
+- # Will return the position (zero-based) of the current child in
+- # it's parent
+- def position
+- self.parent.children.index(self)
+- end
+- end
+-end
+-Tree::TreeNode.send(:include, TreeNodePatch)
+-
+ module Redmine
+ module MenuManager
+ class MenuError < StandardError #:nodoc:
+@@ -169,7 +82,7 @@
+
+ def display_main_menu?(project)
+ menu_name = project && !project.new_record? ? :project_menu : :application_menu
+- Redmine::MenuManager.items(menu_name).size > 1 # 1 element is the root
++ Redmine::MenuManager.items(menu_name).children.present?
+ end
+
+ def render_menu(menu, project=nil)
+@@ -181,7 +94,7 @@
+ end
+
+ def render_menu_node(node, project=nil)
+- if node.hasChildren? || !node.child_menus.nil?
++ if node.children.present? || !node.child_menus.nil?
+ return render_menu_node_with_children(node, project)
+ else
+ caption, url, selected = extract_node_details(node, project)
+@@ -306,13 +219,13 @@
+ end
+
+ def items(menu_name)
+- @items[menu_name.to_sym] || Tree::TreeNode.new(:root, {})
++ @items[menu_name.to_sym] || MenuNode.new(:root, {})
+ end
+ end
+
+ class Mapper
+ def initialize(menu, items)
+- items[menu] ||= Tree::TreeNode.new(:root, {})
++ items[menu] ||= MenuNode.new(:root, {})
+ @menu = menu
+ @menu_items = items[menu]
+ end
+@@ -398,7 +311,102 @@
+ end
+ end
+
+- class MenuItem < Tree::TreeNode
++ class MenuNode
++ include Enumerable
++ attr_accessor :parent
++ attr_reader :last_items_count, :name
++
++ def initialize(name, content = nil)
++ @name = name
++ @childrenHash ||= {}
++ @children = []
++ @last_items_count = 0
++ end
++
++ def children
++ if block_given?
++ @children.each {|child| yield child}
++ else
++ @children
++ end
++ end
++
++ # Returns the number of descendants + 1
++ def size
++ @children.inject(1) {|sum, node| sum + node.size}
++ end
++
++ def each &block
++ yield self
++ children { |child| child.each(&block) }
++ end
++
++ # Adds a child at first position
++ def prepend(child)
++ raise "Child already added" if @childrenHash.has_key?(child.name)
++
++ @childrenHash[child.name] = child
++ @children = [child] + @children
++ child.parent = self
++ return child
++ end
++
++ # Adds a child at given position
++ def add_at(child, position)
++ raise "Child already added" if @childrenHash.has_key?(child.name)
++
++ @childrenHash[child.name] = child
++ @children = @children.insert(position, child)
++ child.parent = self
++ return child
++ end
++
++ # Adds a child as last child
++ def add_last(child)
++ raise "Child already added" if @childrenHash.has_key?(child.name)
++
++ @childrenHash[child.name] = child
++ @children << child
++ @last_items_count += 1
++ child.parent = self
++ return child
++ end
++
++ # Adds a child
++ def add(child)
++ raise "Child already added" if @childrenHash.has_key?(child.name)
++
++ @childrenHash[child.name] = child
++ position = @children.size - @last_items_count
++ @children.insert(position, child)
++ child.parent = self
++ return child
++ end
++ alias :<< :add
++
++ # Removes a child
++ def remove!(child)
++ @childrenHash.delete(child.name)
++ @children.delete(child)
++ @last_items_count -= +1 if child && child.last
++ child.parent = nil
++ child
++ end
++
++ # Returns the position for this node in it's parent
++ def position
++ self.parent.children.index(self)
++ end
++
++ # Returns the root for this node
++ def root
++ root = self
++ root = root.parent while root.parent
++ root
++ end
++ end
++
++ class MenuItem < MenuNode
+ include Redmine::I18n
+ attr_reader :name, :url, :param, :condition, :parent, :child_menus, :last
+
diff --git a/www-apps/redmine/files/redmine.confd b/www-apps/redmine/files/redmine.confd
new file mode 100644
index 0000000..1c3830a
--- /dev/null
+++ b/www-apps/redmine/files/redmine.confd
@@ -0,0 +1,13 @@
+# /etc/conf.d/redmine: config file for /etc/init.d/redmine
+# Bind to specified address
+# You can set to 0.0.0.0 to accept requests anywhere
+#REDMINE_ADDRESS="localhost"
+
+# Port
+#REDMINE_PORT=3000
+
+# RAILS_ENV
+#RAILS_ENV=production
+
+# additional opts
+#REDMINE_OPTS=""
diff --git a/www-apps/redmine/files/redmine.initd b/www-apps/redmine/files/redmine.initd
new file mode 100644
index 0000000..1368da6
--- /dev/null
+++ b/www-apps/redmine/files/redmine.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/files/redmine.initd,v 1.4 2012/03/12 16:41:05 matsuu Exp $
+
+RAILS_ENV=${RAILS_ENV:-production}
+REDMINE_DIR=${REDMINE_DIR:-/var/lib/redmine}
+REDMINE_ADDRESS=${REDMINE_ADDRESS:-localhost}
+REDMINE_PORT=${REDMINE_PORT:-3000}
+REDMINE_USER=${REDMINE_USER:-redmine}
+REDMINE_GROUP=${REDMINE_GROUP:-redmine}
+REDMINE_PIDFILE="${REDMINE_DIR}/tmp/pids/server.pid"
+
+depend() {
+ use apache2 git-daemon mysql net postgresql svnserve
+}
+
+start_pre() {
+ if [ ! -e "${REDMINE_DIR}/config/initializers/session_store.rb" ] ; then
+ eerror "Execute the following command to initlize environment:"
+ eerror
+ eerror "# emerge --config www-apps/redmine"
+ eerror
+ return 1
+ fi
+}
+
+start() {
+ ebegin "Starting redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --start --quiet --user ${REDMINE_USER}:${REDMINE_GROUP} \
+ --pidfile "${REDMINE_PIDFILE}" \
+ --exec /usr/bin/ruby "${REDMINE_DIR}"/script/server -- \
+ --daemon --environment=${RAILS_ENV} \
+ --binding=${REDMINE_ADDRESS} --port=${REDMINE_PORT} \
+ ${REDMINE_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --signal INT --quiet --pidfile "${REDMINE_PIDFILE}"
+ eend $?
+}