aboutsummaryrefslogtreecommitdiff
path: root/www/redmine
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2012-07-21 22:22:23 +0000
committerHiroki Sato <hrs@FreeBSD.org>2012-07-21 22:22:23 +0000
commitd3a741c030ecb94294393c9974edd4ab4827bb72 (patch)
tree015502f362e2f4ccc20a6aff97956375ee177d87 /www/redmine
parentebd255b2f9926a50f5f3b62a928794c5d5eb02a9 (diff)
downloadports-d3a741c030ecb94294393c9974edd4ab4827bb72.tar.gz
ports-d3a741c030ecb94294393c9974edd4ab4827bb72.zip
Notes
Diffstat (limited to 'www/redmine')
-rw-r--r--www/redmine/Makefile50
-rw-r--r--www/redmine/files/patch-r8214255
-rw-r--r--www/redmine/pkg-plist13
3 files changed, 295 insertions, 23 deletions
diff --git a/www/redmine/Makefile b/www/redmine/Makefile
index 2fdcd533722e..72cd60c4a725 100644
--- a/www/redmine/Makefile
+++ b/www/redmine/Makefile
@@ -7,6 +7,7 @@
PORTNAME= redmine
PORTVERSION= 1.3.1
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_RUBYFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -29,29 +30,31 @@ USE_RAKE= yes
NO_BUILD= yes
SUB_LIST+= RUBY_NAME=${RUBY_NAME}
-BROKEN= Does not work with RubyGems 1.8
-
-OPTIONS= MYSQL "Enable MySQL support" on \
- POSTGRESQL "Enable PostgreSQL support" off \
- RMAGIC "Enable Gantt charts support" on \
- THIN "Use Thin WEB server" on \
- PASSENGER "Use Apache/Nginx WEB server" off
+OPTIONS_DEFINE= MYSQL POSTGRESQL RMAGIC WWWSERVER
+OPTIONS_DEFAULT=MYSQL RMAGIC WWWSERVER THIN
+OPTIONS_SINGLE= WWWSERVER
+OPTIONS_SINGLE_WWWSERVER= THIN PASSENGER
+POSTGRESQL_DESC=Enable PostgreSQL support
+RMAGIC_DESC= Enable Gantt charts support
+THIN_DESC= Use Thin WEB server
+PASSENGER_DESC= Use Apache/Nginx WEB server
+NO_OPTIONS_SORT=yes
.include <bsd.port.pre.mk>
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/mysql.so:${PORTSDIR}/databases/ruby-mysql
.endif
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPOSTGRESQL}
RUN_DEPENDS+= rubygem-pg>=0:${PORTSDIR}/databases/rubygem-pg
.endif
-.if defined(WITH_RMAGIC)
+.if ${PORT_OPTIONS:MRMAGIC}
RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/RMagick2.so:${PORTSDIR}/graphics/ruby-rmagick
.endif
-.if defined(WITH_THIN)
+.if ${PORT_OPTIONS:MTHIN}
USERS= ${WWWOWN}
GROUPS= ${WWWGRP}
RUN_DEPENDS+= thin:${PORTSDIR}/www/rubygem-thin
@@ -59,25 +62,28 @@ USE_RC_SUBR= redmine
SUB_LIST+= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
.endif
-.if defined(WITH_PASSENGER)
+.if ${PORT_OPTIONS:MPASSENGER}
RUN_DEPENDS+= passenger-config:${PORTSDIR}/www/rubygem-passenger
.endif
-.if !defined(WITH_THIN) && !defined(WITH_PASSENGER)
-IGNORE= either Thin or Apache/Nginx WEB server option required. \
- Please 'make config' again.
-.endif
+post-extract:
+ ${MV} ${WRKSRC}/config/settings.yml ${WRKSRC}/config/settings.yml-dist
+
+pre-install:
+ ${MKDIR} ${WRKSRC}/public/plugin_assets
do-install:
${MKDIR} ${WWWDIR}
- (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "*" ${WWWDIR} "! ( -name *\.orig -o -name *\.bak )")
-
- ${MKDIR} ${WWWDIR}/public/plugin_assets
- ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}
-
- ${FIND} ${WWWDIR}/script -type f -exec ${CHMOD} 755 {} \;
+ cd ${WRKSRC} && \
+ ${COPYTREE_SHARE} "*" ${WWWDIR} "! ( -name *\.orig -o -name *\.bak )"
+ ${FIND} ${WRKSRC}/script -type f -print | ${XARGS} ${CHMOD} 755
post-install:
+ if ! [ -r ${WWWDIR}/config/settings.yml ]; then \
+ ${INSTALL_DATA} ${WWWDIR}/config/settings.yml-dist \
+ ${WWWDIR}/config/settings.yml; \
+ fi
+ ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/www/redmine/files/patch-r8214 b/www/redmine/files/patch-r8214
new file mode 100644
index 000000000000..d96c23a5a9c5
--- /dev/null
+++ b/www/redmine/files/patch-r8214
@@ -0,0 +1,255 @@
+--- ./test/unit/lib/redmine/menu_manager/menu_item_test.rb.orig 2012-02-06 20:22:28.000000000 +0900
++++ ./test/unit/lib/redmine/menu_manager/menu_item_test.rb 2012-07-22 05:49:14.000000000 +0900
+@@ -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]
+--- ./config/environment.rb.orig 2012-02-06 20:22:35.000000000 +0900
++++ ./config/environment.rb 2012-07-22 05:49:14.000000000 +0900
+@@ -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
+--- ./lib/redmine/menu_manager.rb.orig 2012-02-06 20:22:35.000000000 +0900
++++ ./lib/redmine/menu_manager.rb 2012-07-22 05:49:14.000000000 +0900
+@@ -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/redmine/pkg-plist b/www/redmine/pkg-plist
index af30116d71ea..7d63c0b7e78e 100644
--- a/www/redmine/pkg-plist
+++ b/www/redmine/pkg-plist
@@ -510,7 +510,9 @@
%%WWWDIR%%/config/locales/zh-TW.yml
%%WWWDIR%%/config/locales/zh.yml
%%WWWDIR%%/config/routes.rb
-%%WWWDIR%%/config/settings.yml
+@unexec if cmp %D/%%WWWDIR%%/config/settings.yml-dist %D/%%WWWDIR%%/config/settings.yml; then rm -f %D/%%WWWDIR%%/config/settings.yml; fi
+%%WWWDIR%%/config/settings.yml-dist
+@exec if ! [ -r %D/%%WWWDIR%%/config/settings.yml ]; then cp %D/%%WWWDIR%%/config/settings.yml-dist %D/%%WWWDIR%%/config/settings.yml; fi
%%WWWDIR%%/db/migrate/001_setup.rb
%%WWWDIR%%/db/migrate/002_issue_move.rb
%%WWWDIR%%/db/migrate/003_issue_add_note.rb
@@ -3901,10 +3903,14 @@
@dirrm %%WWWDIR%%/vendor/gems
@dirrmtry %%WWWDIR%%/vendor
@dirrm %%WWWDIR%%/tmp/test
+@exec mkdir -p %D/%%WWWDIR%%/tmp/sockets
@dirrm %%WWWDIR%%/tmp/sockets
@dirrmtry %%WWWDIR%%/tmp/sessions
+@exec mkdir -p %D/%%WWWDIR%%/tmp/sessions
@dirrmtry %%WWWDIR%%/tmp/pids
+@exec mkdir -p %D/%%WWWDIR%%/tmp/pids
@dirrmtry %%WWWDIR%%/tmp/cache
+@exec mkdir -p %D/%%WWWDIR%%/tmp/cache
@dirrmtry %%WWWDIR%%/tmp
@dirrm %%WWWDIR%%/test/unit/lib/redmine/wiki_formatting
@dirrm %%WWWDIR%%/test/unit/lib/redmine/views/builders
@@ -3920,7 +3926,9 @@
@dirrm %%WWWDIR%%/test/unit/helpers
@dirrm %%WWWDIR%%/test/unit
@dirrm %%WWWDIR%%/test/mocks/test
+@exec mkdir -p %D/%%WWWDIR%%/test/mocks/test
@dirrm %%WWWDIR%%/test/mocks/development
+@exec mkdir -p %D/%%WWWDIR%%/test/mocks/development
@dirrm %%WWWDIR%%/test/mocks
@dirrm %%WWWDIR%%/test/integration/lib/redmine
@dirrm %%WWWDIR%%/test/integration/lib
@@ -3929,6 +3937,7 @@
@dirrm %%WWWDIR%%/test/functional
@dirrm %%WWWDIR%%/test/fixtures/repositories
@dirrm %%WWWDIR%%/test/fixtures/mailer
+@exec mkdir -p %D/%%WWWDIR%%/test/fixtures/mailer
@dirrm %%WWWDIR%%/test/fixtures/mail_handler
@dirrm %%WWWDIR%%/test/fixtures/ldap
@dirrm %%WWWDIR%%/test/fixtures/files
@@ -3977,6 +3986,7 @@
@dirrm %%WWWDIR%%/lib/redmine/activity
@dirrm %%WWWDIR%%/lib/redmine
@dirrm %%WWWDIR%%/lib/plugins
+@exec mkdir -p %D/%%WWWDIR%%/lib/plugins
@dirrm %%WWWDIR%%/lib/generators/redmine_plugin_model/templates
@dirrm %%WWWDIR%%/lib/generators/redmine_plugin_model
@dirrm %%WWWDIR%%/lib/generators/redmine_plugin_controller/templates
@@ -4065,6 +4075,7 @@
@dirrm %%WWWDIR%%/app/views/account
@dirrm %%WWWDIR%%/app/views
@dirrm %%WWWDIR%%/app/sweepers
+@exec mkdir -p %D/%%WWWDIR%%/app/sweepers
@dirrm %%WWWDIR%%/app/models/repository
@dirrm %%WWWDIR%%/app/models
@dirrm %%WWWDIR%%/app/helpers