diff options
-rw-r--r-- | www-apps/redmine/ChangeLog | 10 | ||||
-rw-r--r-- | www-apps/redmine/files/redmine-rubytree-r8214.patch | 261 | ||||
-rw-r--r-- | www-apps/redmine/metadata.xml | 3 | ||||
-rw-r--r-- | www-apps/redmine/redmine-1.1.3.ebuild | 154 | ||||
-rw-r--r-- | www-apps/redmine/redmine-1.3.1.ebuild (renamed from www-apps/redmine/redmine-1.2.3.ebuild) | 33 |
5 files changed, 291 insertions, 170 deletions
diff --git a/www-apps/redmine/ChangeLog b/www-apps/redmine/ChangeLog index dfd33d1065b8..adaa125227b2 100644 --- a/www-apps/redmine/ChangeLog +++ b/www-apps/redmine/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for www-apps/redmine # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/ChangeLog,v 1.27 2012/01/11 15:56:00 matsuu Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/ChangeLog,v 1.28 2012/02/26 13:58:17 matsuu Exp $ + +*redmine-1.3.1 (26 Feb 2012) + + 26 Feb 2012; MATSUU Takuto <matsuu@gentoo.org> + +files/redmine-rubytree-r8214.patch, -redmine-1.1.3.ebuild, + -redmine-1.2.3.ebuild, +redmine-1.3.1.ebuild: + Version bumped, bug #404245. Added einfo about sqlite3, bug #401087. Removed + rubytree, bug #399503. Removed old versions. 11 Jan 2012; MATSUU Takuto <matsuu@gentoo.org> -redmine-1.2.1-r1.ebuild, -redmine-1.2.2.ebuild, redmine-1.3.0.ebuild: 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 000000000000..af325ec63390 --- /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/metadata.xml b/www-apps/redmine/metadata.xml index 89f6f7588169..7dbf569a0d17 100644 --- a/www-apps/redmine/metadata.xml +++ b/www-apps/redmine/metadata.xml @@ -7,9 +7,6 @@ <longdescription lang="en"> </longdescription> <use> - <flag name='darcs'>Enable support for <pkg>dev-vcs/darcs</pkg></flag> - <flag name='git'>Enable support for <pkg>dev-vcs/git</pkg></flag> - <flag name='mercurial'>Enable support for <pkg>dev-vcs/mercurial</pkg></flag> <flag name='openid'>Enable support for OpenID</flag> <flag name='passenger'>Enable support for <pkg>www-apache/passenger</pkg></flag> </use> diff --git a/www-apps/redmine/redmine-1.1.3.ebuild b/www-apps/redmine/redmine-1.1.3.ebuild deleted file mode 100644 index 7bec1ac3d151..000000000000 --- a/www-apps/redmine/redmine-1.1.3.ebuild +++ /dev/null @@ -1,154 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/redmine-1.1.3.ebuild,v 1.2 2011/12/09 11:57:12 flameeyes Exp $ - -EAPI="3" -USE_RUBY="ruby18" -inherit eutils depend.apache ruby-ng - -DESCRIPTION="Redmine is a flexible project management web application written using Ruby on Rails framework" -HOMEPAGE="http://www.redmine.org/" -SRC_URI="mirror://rubyforge/${PN}/${P}.tar.gz" - -KEYWORDS="~amd64 ~x86" -LICENSE="GPL-2" -SLOT="0" -IUSE="cvs darcs fastcgi git imagemagick mercurial openid passenger subversion" - -ruby_add_rdepend "virtual/rubygems - =dev-ruby/coderay-0.9* - >=dev-ruby/ruby-net-ldap-0.0.4 - ~dev-ruby/i18n-0.4.2 - ~dev-ruby/rack-1.0.1 - dev-ruby/rake - fastcgi? ( dev-ruby/ruby-fcgi ) - imagemagick? ( dev-ruby/rmagick ) - openid? ( dev-ruby/ruby-openid ) - passenger? ( www-apache/passenger )" -#ruby_add_rdepend ~dev-ruby/rails-2.3.5:2.3 -#ruby_add_rdepend "dev-ruby/activerecord:2.3[mysql?,postgres?,sqlite3?]" - -RDEPEND="${RDEPEND} - cvs? ( >=dev-vcs/cvs-1.12 ) - darcs? ( dev-vcs/darcs ) - git? ( dev-vcs/git ) - mercurial? ( dev-vcs/mercurial ) - subversion? ( >=dev-vcs/subversion-1.3 )" - -REDMINE_DIR="/var/lib/${PN}" - -pkg_setup() { - enewgroup redmine - # home directory is required for SCM. - enewuser redmine -1 -1 "${REDMINE_DIR}" redmine -} - -all_ruby_prepare() { - rm -r log files/delete.me || die - rm -r vendor/gems/coderay-0.9.7 || die - rm -r vendor/plugins/ruby-net-ldap-0.0.4 || die - #rm -fr vendor/rails || die - echo "CONFIG_PROTECT=\"${REDMINE_DIR}/config\"" > "${T}/50${PN}" - echo "CONFIG_PROTECT_MASK=\"${REDMINE_DIR}/config/locales ${REDMINE_DIR}/config/settings.yml\"" >> "${T}/50${PN}" -} - -all_ruby_install() { - dodoc doc/{CHANGELOG,INSTALL,README_FOR_APP,RUNNING_TESTS,UPGRADING} || die - rm -fr doc || die - - keepdir /var/log/${PN} || die - dosym /var/log/${PN}/ "${REDMINE_DIR}/log" || die - - insinto "${REDMINE_DIR}" - doins -r . || die - keepdir "${REDMINE_DIR}/files" || die - keepdir "${REDMINE_DIR}/public/plugin_assets" || die - - fowners -R redmine:redmine \ - "${REDMINE_DIR}/config/environment.rb" \ - "${REDMINE_DIR}/files" \ - "${REDMINE_DIR}/public/plugin_assets" \ - "${REDMINE_DIR}/tmp" \ - /var/log/${PN} || die - # for SCM - fowners redmine:redmine "${REDMINE_DIR}" || die - - if use passenger ; then - has_apache - insinto "${APACHE_VHOSTS_CONFDIR}" - doins "${FILESDIR}/10_redmine_vhost.conf" || die - else - newconfd "${FILESDIR}/${PN}.confd" ${PN} || die - newinitd "${FILESDIR}/${PN}.initd" ${PN} || die - keepdir /var/run/${PN} || die - fowners -R redmine:redmine /var/run/${PN} || die - dosym /var/run/${PN}/ "${REDMINE_DIR}/tmp/pids" || die - fi - doenvd "${T}/50${PN}" || die -} - -pkg_postinst() { - einfo - if [ -e "${ROOT}${REDMINE_DIR}/config/initializers/session_store.rb" ] ; then - elog "Execute the following command to upgrade environment:" - elog - elog "# emerge --config \"=${CATEGORY}/${PF}\"" - elog - elog "For upgrade instructions take a look at:" - elog "http://www.redmine.org/wiki/redmine/RedmineUpgrade" - else - elog "Execute the following command to initlize environment:" - elog - elog "# cd ${REDMINE_DIR}" - elog "# cp config/database.yml.example config/database.yml" - elog "# \${EDITOR} config/database.yml" - elog "# emerge --config \"=${CATEGORY}/${PF}\"" - elog - elog "Installation notes are at official site" - elog "http://www.redmine.org/wiki/redmine/RedmineInstall" - fi - einfo -} - -pkg_config() { - if [ ! -e "${REDMINE_DIR}/config/database.yml" ] ; then - eerror "Copy ${REDMINE_DIR}/config/database.yml.example to ${REDMINE_DIR}/config/database.yml and edit this file in order to configure your database settings for \"production\" environment." - die - fi - - local RAILS_ENV=${RAILS_ENV:-production} - local RUBY=${RUBY:-ruby18} - - cd "${REDMINE_DIR}" - if [ -e "${REDMINE_DIR}/config/initializers/session_store.rb" ] ; then - einfo - einfo "Upgrade database." - einfo - - einfo "Migrate database." - RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die - einfo "Upgrade the plugin migrations." - RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate:upgrade_plugin_migrations # || die - RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate_plugins || die - einfo "Clear the cache and the existing sessions." - ${RUBY} -S rake tmp:cache:clear || die - ${RUBY} -S rake tmp:sessions:clear || die - else - einfo - einfo "Initialize database." - einfo - - einfo "Generate a session store secret." - ${RUBY} -S rake config/initializers/session_store.rb || die - einfo "Create the database structure." - RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die - einfo "Insert default configuration data in database." - RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die - fi - - if [ ! -e "${REDMINE_DIR}/config/email.yml" ] ; then - ewarn - ewarn "Copy ${REDMINE_DIR}/config/email.yml.example to ${REDMINE_DIR}/config/email.yml and edit this file to adjust your SMTP settings." - ewarn - fi -} diff --git a/www-apps/redmine/redmine-1.2.3.ebuild b/www-apps/redmine/redmine-1.3.1.ebuild index 7b3a423298e5..29fd43c8ed73 100644 --- a/www-apps/redmine/redmine-1.2.3.ebuild +++ b/www-apps/redmine/redmine-1.3.1.ebuild @@ -1,8 +1,12 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/redmine-1.2.3.ebuild,v 1.1 2011/12/12 16:39:48 matsuu Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-apps/redmine/redmine-1.3.1.ebuild,v 1.1 2012/02/26 13:58:17 matsuu Exp $ EAPI="3" +# ruby19: dev-ruby/rack has no ruby19 +# jruby: dev-ruby/rails has no jruby +# rbx: dev-ruby/rails has no rbx +#USE_RUBY="ruby18 ree18" USE_RUBY="ruby18" inherit eutils depend.apache ruby-ng @@ -20,12 +24,12 @@ RDEPEND="$(ruby_implementation_depend ruby18 '>=' -1.8.6)[ssl]" ruby_add_rdepend "virtual/ruby-ssl virtual/rubygems - =dev-ruby/coderay-0.9* + >=dev-ruby/coderay-1 >=dev-ruby/ruby-net-ldap-0.0.4 ~dev-ruby/i18n-0.4.2 - ~dev-ruby/rack-1.1.0 + >=dev-ruby/rack-1.1:0 dev-ruby/rake - dev-ruby/rails:2.3 + >=dev-ruby/rails-2.3.14:2.3 dev-ruby/activerecord:2.3 fastcgi? ( dev-ruby/ruby-fcgi ) imagemagick? ( dev-ruby/rmagick ) @@ -50,9 +54,14 @@ pkg_setup() { all_ruby_prepare() { rm -r log files/delete.me || die - rm -r vendor/gems/coderay-0.9.7 || die + rm -r vendor/gems/coderay-1.0.0 || die rm -r vendor/plugins/ruby-net-ldap-0.0.4 || die rm -fr vendor/rails || die + + # bug #399503 + rm -r vendor/gems/rubytree-0.5.2 || die + epatch "${FILESDIR}/${PN}-rubytree-r8214.patch" + echo "CONFIG_PROTECT=\"${EPREFIX}${REDMINE_DIR}/config\"" > "${T}/50${PN}" echo "CONFIG_PROTECT_MASK=\"${EPREFIX}${REDMINE_DIR}/config/locales ${EPREFIX}${REDMINE_DIR}/config/settings.yml\"" >> "${T}/50${PN}" sed -i -e "/RAILS_GEM_VERSION/s/'.*'/'$(best_version dev-ruby/rails:2.3|cut -d- -f3)'/" config/environment.rb || die @@ -150,11 +159,11 @@ pkg_config() { RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die einfo "Insert default configuration data in database." RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die - fi - - if [ ! -e "${EPREFIX}${REDMINE_DIR}/config/email.yml" ] ; then - ewarn - ewarn "Copy ${EPREFIX}${REDMINE_DIR}/config/email.yml.example to ${EPREFIX}${REDMINE_DIR}/config/email.yml and edit this file to adjust your SMTP settings." - ewarn + einfo + einfo "If you use sqlite3. please do not forget to change the ownership of the sqlite files." + einfo + einfo "# cd \"${EPREFIX}${REDMINE_DIR}\"" + einfo "# chown redmine db/ db/*.sqlite3" + einfo fi } |