summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzamat H. Hackimov <azamat.hackimov@gmail.com>2018-01-26 00:43:08 +0100
committerThomas Deutschmann <whissi@gentoo.org>2018-01-26 01:19:49 +0100
commit2e1acd2130ed4110cbe04a30050023a9eb44a51e (patch)
treea661764bb968328fbb1d3a7eacae6b3ad48f80ca /www-apps/redmine
parentx11-misc/kaqaz: add missing USE dependency (diff)
downloadgentoo-2e1acd2130ed4110cbe04a30050023a9eb44a51e.tar.gz
gentoo-2e1acd2130ed4110cbe04a30050023a9eb44a51e.tar.bz2
gentoo-2e1acd2130ed4110cbe04a30050023a9eb44a51e.zip
www-apps/redmine: strict certain versions for deps
Modified *_requires.patch to strict rails to 4.2 and actionpack-xml_parser to 1.0 during configuration and execution. Bug: https://bugs.gentoo.org/636210 Package-Manager: Portage-2.3.13, Repoman-2.3.3
Diffstat (limited to 'www-apps/redmine')
-rw-r--r--www-apps/redmine/files/redmine-3.3.4_requires.patch60
-rw-r--r--www-apps/redmine/files/redmine-3.4.3_requires.patch73
-rw-r--r--www-apps/redmine/redmine-3.2.8.ebuild106
-rw-r--r--www-apps/redmine/redmine-3.3.5.ebuild2
-rw-r--r--www-apps/redmine/redmine-3.4.3.ebuild4
5 files changed, 133 insertions, 112 deletions
diff --git a/www-apps/redmine/files/redmine-3.3.4_requires.patch b/www-apps/redmine/files/redmine-3.3.4_requires.patch
deleted file mode 100644
index e4510839cf48..000000000000
--- a/www-apps/redmine/files/redmine-3.3.4_requires.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -Nuar redmine-3.3.3-orig/app/controllers/application_controller.rb redmine-3.3.3/app/controllers/application_controller.rb
---- redmine-3.3.3-orig/app/controllers/application_controller.rb 2017-05-24 21:05:03.515966923 +0500
-+++ redmine-3.3.3/app/controllers/application_controller.rb 2017-05-24 21:07:22.629960174 +0500
-@@ -15,6 +15,7 @@
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-+require 'request_store'
- require 'uri'
- require 'cgi'
-
-diff -Nuar redmine-3.3.3-orig/app/controllers/welcome_controller.rb redmine-3.3.3/app/controllers/welcome_controller.rb
---- redmine-3.3.3-orig/app/controllers/welcome_controller.rb 2017-05-24 21:05:03.514966923 +0500
-+++ redmine-3.3.3/app/controllers/welcome_controller.rb 2017-05-24 21:08:14.895957638 +0500
-@@ -15,6 +15,9 @@
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-+require 'action_controller'
-+require 'action_controller/action_caching'
-+
- class WelcomeController < ApplicationController
- caches_action :robots
-
-diff -Nuar redmine-3.3.3-orig/app/models/custom_field.rb redmine-3.3.3/app/models/custom_field.rb
---- redmine-3.3.3-orig/app/models/custom_field.rb 2017-05-24 21:05:03.513966923 +0500
-+++ redmine-3.3.3/app/models/custom_field.rb 2017-05-24 21:08:32.223956797 +0500
-@@ -15,6 +15,8 @@
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-+require 'protected_attributes'
-+
- class CustomField < ActiveRecord::Base
- include Redmine::SubclassFactory
-
-diff -Nuar redmine-3.3.3-orig/app/models/mailer.rb redmine-3.3.3/app/models/mailer.rb
---- redmine-3.3.3-orig/app/models/mailer.rb 2017-05-24 21:05:03.514966923 +0500
-+++ redmine-3.3.3/app/models/mailer.rb 2017-05-24 21:05:47.039964812 +0500
-@@ -16,6 +16,7 @@
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- require 'roadie'
-+require 'roadie-rails'
-
- class Mailer < ActionMailer::Base
- layout 'mailer'
-diff -Nuar redmine-3.3.3-orig/config/application.rb redmine-3.3.3/config/application.rb
---- redmine-3.3.3-orig/config/application.rb 2017-05-24 21:05:03.689966915 +0500
-+++ redmine-3.3.3/config/application.rb 2017-05-24 21:05:35.723965361 +0500
-@@ -1,8 +1,8 @@
- require File.expand_path('../boot', __FILE__)
-
- require 'rails/all'
-+require 'action_dispatch/xml_params_parser'
-
--Bundler.require(*Rails.groups)
-
- module RedmineApp
- class Application < Rails::Application
diff --git a/www-apps/redmine/files/redmine-3.4.3_requires.patch b/www-apps/redmine/files/redmine-3.4.3_requires.patch
new file mode 100644
index 000000000000..338f627adb1b
--- /dev/null
+++ b/www-apps/redmine/files/redmine-3.4.3_requires.patch
@@ -0,0 +1,73 @@
+diff -Nuar redmine-3.4.3-orig/app/controllers/application_controller.rb redmine-3.4.3/app/controllers/application_controller.rb
+--- redmine-3.4.3-orig/app/controllers/application_controller.rb 2017-12-11 20:55:04.942299001 +0500
++++ redmine-3.4.3/app/controllers/application_controller.rb 2017-12-11 20:55:17.285298402 +0500
+@@ -15,6 +15,7 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
++require 'request_store'
+ require 'uri'
+ require 'cgi'
+
+diff -Nuar redmine-3.4.3-orig/app/controllers/welcome_controller.rb redmine-3.4.3/app/controllers/welcome_controller.rb
+--- redmine-3.4.3-orig/app/controllers/welcome_controller.rb 2017-12-11 20:55:04.942299001 +0500
++++ redmine-3.4.3/app/controllers/welcome_controller.rb 2017-12-11 20:55:17.286298402 +0500
+@@ -15,6 +15,9 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
++require 'action_controller'
++require 'action_controller/action_caching'
++
+ class WelcomeController < ApplicationController
+ self.main_menu = false
+
+diff -Nuar redmine-3.4.3-orig/app/models/custom_field.rb redmine-3.4.3/app/models/custom_field.rb
+--- redmine-3.4.3-orig/app/models/custom_field.rb 2017-12-11 20:55:04.926299002 +0500
++++ redmine-3.4.3/app/models/custom_field.rb 2017-12-11 20:55:17.286298402 +0500
+@@ -15,6 +15,8 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
++require 'protected_attributes'
++
+ class CustomField < ActiveRecord::Base
+ include Redmine::SafeAttributes
+ include Redmine::SubclassFactory
+diff -Nuar redmine-3.4.3-orig/app/models/mailer.rb redmine-3.4.3/app/models/mailer.rb
+--- redmine-3.4.3-orig/app/models/mailer.rb 2017-12-11 20:55:04.926299002 +0500
++++ redmine-3.4.3/app/models/mailer.rb 2017-12-11 20:55:17.286298402 +0500
+@@ -16,6 +16,7 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ require 'roadie'
++require 'roadie-rails'
+
+ class Mailer < ActionMailer::Base
+ layout 'mailer'
+diff -Nuar redmine-3.4.3-orig/bin/rails redmine-3.4.3/bin/rails
+--- redmine-3.4.3-orig/bin/rails 2017-12-11 20:55:04.986298999 +0500
++++ redmine-3.4.3/bin/rails 2017-12-11 20:58:40.247288555 +0500
+@@ -1,4 +1,6 @@
+ #!/usr/bin/env ruby
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
+ require_relative '../config/boot'
++
++gem 'rails', '~> 4.2'
+ require 'rails/commands'
+diff -Nuar redmine-3.4.3-orig/config/application.rb redmine-3.4.3/config/application.rb
+--- redmine-3.4.3-orig/config/application.rb 2017-12-11 20:55:04.971298999 +0500
++++ redmine-3.4.3/config/application.rb 2017-12-11 20:58:20.477289514 +0500
+@@ -1,8 +1,11 @@
+ require File.expand_path('../boot', __FILE__)
+
++gem 'rails', '~> 4.2'
++gem 'actionpack-xml_parser', '~> 1.0'
++
+ require 'rails/all'
++require 'action_dispatch/xml_params_parser'
+
+-Bundler.require(*Rails.groups)
+
+ module RedmineApp
+ class Application < Rails::Application
diff --git a/www-apps/redmine/redmine-3.2.8.ebuild b/www-apps/redmine/redmine-3.2.8.ebuild
index c0bd7c7e880f..951845e783fb 100644
--- a/www-apps/redmine/redmine-3.2.8.ebuild
+++ b/www-apps/redmine/redmine-3.2.8.ebuild
@@ -2,6 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=6
+# ruby24 don't have required deps
USE_RUBY="ruby22 ruby23"
inherit eutils depend.apache ruby-ng user
@@ -15,42 +16,41 @@ SLOT="0"
# All db-related USEs are ineffective since we depend on rails
# which depends on activerecord which depends on all ruby's db bindings
#IUSE="ldap openid imagemagick postgres sqlite mysql fastcgi passenger"
-IUSE="ldap fastcgi passenger imagemagick"
+IUSE="imagemagick fastcgi ldap markdown passenger"
ruby_add_rdepend "
- dev-ruby/rubygems
- >=dev-ruby/rails-4.2.5.2:4.2
- >=dev-ruby/jquery-rails-3.1.4:3
- >=dev-ruby/coderay-1.1.0
- >=dev-ruby/builder-3.0.4:*
- >=dev-ruby/roadie-rails-1.1.0
- dev-ruby/mime-types:*
- =dev-ruby/request_store-1.0.5
- >=dev-ruby/rbpdf-1.19.0
dev-ruby/actionpack-action_caching
dev-ruby/actionpack-xml_parser:0
+ >=dev-ruby/builder-3.2.2:3.2
+ >=dev-ruby/coderay-1.1.0
+ dev-ruby/i18n:0.7
+ >=dev-ruby/jquery-rails-3.1.4:3
+ dev-ruby/loofah
+ dev-ruby/mime-types:*
+ dev-ruby/mimemagic
+ >=dev-ruby/nokogiri-1.6.8
dev-ruby/protected_attributes
- >=dev-ruby/redcarpet-3.3.2
- >=dev-ruby/nokogiri-1.6.7.2
- ldap? ( >=dev-ruby/ruby-net-ldap-0.12.0 )
- >=dev-ruby/ruby-openid-2.3.0
>=dev-ruby/rack-openid-0.2.1
+ >=dev-ruby/rails-4.2.5.2:4.2
+ >=dev-ruby/rails-html-sanitizer-1.0.3
+ dev-ruby/request_store:1.0.5
+ >=dev-ruby/roadie-rails-1.1.0
+ >=dev-ruby/rbpdf-1.19.2
+ >=dev-ruby/ruby-openid-2.3.0
+ dev-ruby/rubygems
fastcgi? ( dev-ruby/fcgi )
+ imagemagick? ( >=dev-ruby/rmagick-2.14.0 )
+ ldap? ( >=dev-ruby/ruby-net-ldap-0.12.0 )
+ markdown? ( >=dev-ruby/redcarpet-3.3.2 )
passenger? ( www-apache/passenger )
- imagemagick? ( >=dev-ruby/rmagick-2.14.0 )"
- # ruby_targets_ruby19? (
-# postgres? ( >=dev-ruby/pg-0.11 )
-# sqlite3? ( dev-ruby/sqlite3 )
-# mysql? ( dev-ruby/mysql2:0.3 )
-# )
-
+ "
+# TODO add USE doc and test
#ruby_add_bdepend ">=dev-ruby/rdoc-2.4.2
# dev-ruby/yard
# test? (
# >=dev-ruby/shoulda-3.3.2
# >=dev-ruby/mocha-0.13.3
# >=dev-ruby/capybara-2.0.0
-# <dev-ruby/nokogiri-1.6.0
# )"
REDMINE_DIR="/var/lib/${PN}"
@@ -66,26 +66,20 @@ all_ruby_prepare() {
# bug #406605
rm .{git,hg}ignore || die
- 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}"
+ cat > "${T}/50${PN}" <<-EOF || die
+ CONFIG_PROTECT="${EROOT%/}${REDMINE_DIR}/config"
+ CONFIG_PROTECT_MASK="${EROOT%/}${REDMINE_DIR}/config/locales ${EROOT%/}${REDMINE_DIR}/config/settings.yml"
+ EOF
# remove ldap staff module if disabled to avoid #413779
use ldap || rm app/models/auth_source_ldap.rb || die
- # Make it work
- sed -i -e "1irequire 'request_store'" app/controllers/application_controller.rb || die
- sed -i -e "18irequire 'action_controller'" -e "19irequire 'action_controller/action_caching'"\
- app/controllers/welcome_controller.rb || die
- sed -i -e "4irequire 'action_dispatch/xml_params_parser'" -e "/Bundler/d" config/application.rb || die
- sed -i -e "18irequire 'protected_attributes'" app/models/custom_field.rb || die
- sed -i -e "19irequire 'roadie-rails'" app/models/mailer.rb || die
+ eapply "${FILESDIR}/${PN}-3.4.3_requires.patch"
}
all_ruby_install() {
- dodoc doc/{CHANGELOG,INSTALL,README_FOR_APP,RUNNING_TESTS,UPGRADING}
- rm -r doc || die
- dodoc README.rdoc
- rm README.rdoc || die
+ dodoc doc/* README.rdoc
+ rm -r doc appveyor.yml CONTRIBUTING.md README.rdoc || die
keepdir /var/log/${PN}
@@ -128,7 +122,9 @@ all_ruby_install() {
}
pkg_postinst() {
- if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/session_store.rb" -o -e "${EPREFIX}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then
+ if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" \
+ || -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]
+ then
elog "Execute the following command to upgrade environment:"
elog
elog "# emerge --config \"=${CATEGORY}/${PF}\""
@@ -138,7 +134,7 @@ pkg_postinst() {
else
elog "Execute the following command to initialize environment:"
elog
- elog "# cd ${EPREFIX}${REDMINE_DIR}"
+ elog "# cd ${EROOT%/}${REDMINE_DIR}"
elog "# cp config/database.yml.example config/database.yml"
elog "# \${EDITOR} config/database.yml"
elog "# chown redmine:redmine config/database.yml"
@@ -150,38 +146,49 @@ pkg_postinst() {
}
pkg_config() {
- if [ ! -e "${EPREFIX}${REDMINE_DIR}/config/database.yml" ]; then
- eerror "Copy ${EPREFIX}${REDMINE_DIR}/config/database.yml.example to ${EPREFIX}${REDMINE_DIR}/config/database.yml"
- eerror "then edit this file in order to configure your database settings for \"production\" environment."
+ if [[ ! -e "${EROOT%/}${REDMINE_DIR}/config/database.yml" ]]; then
+ eerror "Copy ${EROOT%/}${REDMINE_DIR}/config/database.yml.example to"
+ eerror "${EROOT%/}${REDMINE_DIR}/config/database.yml then edit this"
+ eerror "file in order to configure your database settings for"
+ eerror "\"production\" environment."
die
fi
local RAILS_ENV=${RAILS_ENV:-production}
- if [ ! -L /usr/bin/ruby ]; then
+ if [[ ! -L /usr/bin/ruby ]]; then
eerror "/usr/bin/ruby is not a valid symlink to any ruby implementation."
eerror "Please update it via `eselect ruby`"
die
fi
- if [[ $RUBY_TARGETS != *$( eselect ruby show | awk 'NR==2' | tr -d ' ' )* ]]; then
- eerror "/usr/bin/ruby is currently not included in redmine's ruby targets: ${RUBY_TARGETS}."
+ if [[ $RUBY_TARGETS != *$( eselect ruby show | awk 'NR==2' | tr -d ' ' )* ]]
+ then
+ eerror "/usr/bin/ruby is currently not included in redmine's ruby targets:"
+ eerror "${RUBY_TARGETS}."
eerror "Please update it via `eselect ruby`"
die
fi
local RUBY=${RUBY:-ruby}
- cd "${EPREFIX}${REDMINE_DIR}" || die
- if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/session_store.rb" ]; then
+ cd "${EROOT%/}${REDMINE_DIR}" || die
+ if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" ]]
+ then
einfo
einfo "Generating secret token."
einfo
rm config/initializers/session_store.rb || die
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die
fi
- if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then
+ if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]
+ then
einfo
einfo "Upgrading database."
einfo
+ einfo "Generating secret token."
+ # Migration from Redmine 2.x
+ rm config/initializers/secret_token.rb || die
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die
+
einfo "Migrating database."
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
einfo "Upgrading the plugin migrations."
@@ -200,11 +207,12 @@ pkg_config() {
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
einfo "Populating database with default configuration data."
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die
- chown redmine:redmine "${EPREFIX}${REDMINE_DIR}"/log/production.log
+ chown redmine:redmine "${EROOT%/}var/log/redmine/*.log" || die
einfo
- einfo "If you use sqlite3, please do not forget to change the ownership of the sqlite files."
+ einfo "If you use sqlite3, please do not forget to change the ownership"
+ einfo "of the sqlite files."
einfo
- einfo "# cd \"${EPREFIX}${REDMINE_DIR}\""
+ einfo "# cd \"${EROOT%/}${REDMINE_DIR}\""
einfo "# chown redmine:redmine db/ db/*.sqlite3"
einfo
fi
diff --git a/www-apps/redmine/redmine-3.3.5.ebuild b/www-apps/redmine/redmine-3.3.5.ebuild
index 80dcfc032480..951845e783fb 100644
--- a/www-apps/redmine/redmine-3.3.5.ebuild
+++ b/www-apps/redmine/redmine-3.3.5.ebuild
@@ -74,7 +74,7 @@ all_ruby_prepare() {
# remove ldap staff module if disabled to avoid #413779
use ldap || rm app/models/auth_source_ldap.rb || die
- eapply "${FILESDIR}/${P}_requires.patch"
+ eapply "${FILESDIR}/${PN}-3.4.3_requires.patch"
}
all_ruby_install() {
diff --git a/www-apps/redmine/redmine-3.4.3.ebuild b/www-apps/redmine/redmine-3.4.3.ebuild
index d2e874a23beb..80dcfc032480 100644
--- a/www-apps/redmine/redmine-3.4.3.ebuild
+++ b/www-apps/redmine/redmine-3.4.3.ebuild
@@ -20,7 +20,7 @@ IUSE="imagemagick fastcgi ldap markdown passenger"
ruby_add_rdepend "
dev-ruby/actionpack-action_caching
- dev-ruby/actionpack-xml_parser:*
+ dev-ruby/actionpack-xml_parser:0
>=dev-ruby/builder-3.2.2:3.2
>=dev-ruby/coderay-1.1.0
dev-ruby/i18n:0.7
@@ -74,7 +74,7 @@ all_ruby_prepare() {
# remove ldap staff module if disabled to avoid #413779
use ldap || rm app/models/auth_source_ldap.rb || die
- eapply "${FILESDIR}/${PN}-3.3.4_requires.patch"
+ eapply "${FILESDIR}/${P}_requires.patch"
}
all_ruby_install() {