Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jul 2012 22:22:23 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r301292 - in head/www/redmine: . files
Message-ID:  <201207212222.q6LMMOvp092814@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sat Jul 21 22:22:23 2012
New Revision: 301292
URL: http://svn.freebsd.org/changeset/ports/301292

Log:
  - OPTIONSng.
  - Fix BROKEN.
  - Do not overwrite config/settings.yml.
  - Add missing empty directories in pkg-plist.

Added:
  head/www/redmine/files/patch-r8214   (contents, props changed)
Modified:
  head/www/redmine/Makefile
  head/www/redmine/pkg-plist

Modified: head/www/redmine/Makefile
==============================================================================
--- head/www/redmine/Makefile	Sat Jul 21 22:20:32 2012	(r301291)
+++ head/www/redmine/Makefile	Sat Jul 21 22:22:23 2012	(r301292)
@@ -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>

Added: head/www/redmine/files/patch-r8214
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/redmine/files/patch-r8214	Sat Jul 21 22:22:23 2012	(r301292)
@@ -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
+ 

Modified: head/www/redmine/pkg-plist
==============================================================================
--- head/www/redmine/pkg-plist	Sat Jul 21 22:20:32 2012	(r301291)
+++ head/www/redmine/pkg-plist	Sat Jul 21 22:22:23 2012	(r301292)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207212222.q6LMMOvp092814>