From 156439cd26fdf72d850b27a39602a3872ce642b6 Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Fri, 11 Dec 2015 17:28:01 +0000 Subject: [PATCH] www/redmine: change how optional gems are included - patch Gemfile to pull in files in bundler.d/ o eases including optional features without regenerating extra patches with each update o convert thin and imagemagick options to use bundler.d o this does not fix PR 201112, but eases future updates which will fix it implicitly - while here, use @sample --- www/redmine/Makefile | 17 ++++++++------ www/redmine/files/extra-patch-Gemfile | 17 -------------- www/redmine/files/extra-patch-thin-Gemfile | 12 ---------- www/redmine/files/patch-Gemfile | 26 +++++++++++++++++++--- www/redmine/files/rmagic.rb | 1 + www/redmine/files/thin.rb | 1 + www/redmine/pkg-plist | 7 +++--- 7 files changed, 38 insertions(+), 43 deletions(-) delete mode 100644 www/redmine/files/extra-patch-Gemfile delete mode 100644 www/redmine/files/extra-patch-thin-Gemfile create mode 100644 www/redmine/files/rmagic.rb create mode 100644 www/redmine/files/thin.rb diff --git a/www/redmine/Makefile b/www/redmine/Makefile index ea1e8bd3c367..8a1a29e8a909 100644 --- a/www/redmine/Makefile +++ b/www/redmine/Makefile @@ -3,6 +3,7 @@ PORTNAME= redmine PORTVERSION= 2.6.9 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://www.redmine.org/releases/ @@ -42,6 +43,7 @@ OPTIONS_DEFINE= MYSQL MYSQL2 POSTGRESQL RMAGIC OPTIONS_DEFAULT=MYSQL2 RMAGIC THIN OPTIONS_SINGLE= WWWSERVER OPTIONS_SINGLE_WWWSERVER= THIN PASSENGER +OPTIONS_SUB= yes POSTGRESQL_DESC=Enable PostgreSQL support RMAGIC_DESC= Enable Gantt charts support THIN_DESC= Use Thin WEB server @@ -53,16 +55,14 @@ MYSQL_RUN_DEPENDS= rubygem-mysql>=2.8.1:${PORTSDIR}/databases/rubygem-mysql MYSQL2_RUN_DEPENDS= rubygem-mysql2>=0:${PORTSDIR}/databases/rubygem-mysql2 PASSENGER_RUN_DEPENDS= passenger-config:${PORTSDIR}/www/rubygem-passenger POSTGRESQL_RUN_DEPENDS= rubygem-pg>=0:${PORTSDIR}/databases/rubygem-pg -RMAGIC_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-patch-Gemfile RMAGIC_RUN_DEPENDS= rubygem-rmagick>=2.13.4:${PORTSDIR}/graphics/rubygem-rmagick -THIN_EXTRA_PATCHES= ${FILESDIR}/extra-patch-thin-Gemfile THIN_RUN_DEPENDS= thin:${PORTSDIR}/www/rubygem-thin THIN_SUB_LIST= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} THIN_VARS= USE_RC_SUBR=redmine post-extract: @${RM} ${WRKSRC}/.hgignore ${WRKSRC}/.travis.yml - @${MV} ${WRKSRC}/config/settings.yml ${WRKSRC}/config/settings.yml-dist + @${MV} ${WRKSRC}/config/settings.yml ${WRKSRC}/config/settings.yml.sample post-patch: @${FIND} ${WRKSRC} -name '*.bak' -o -name '*.orig' -delete @@ -73,13 +73,16 @@ pre-install: do-install: ${MKDIR} ${STAGEDIR}${WWWDIR} ${MKDIR} ${STAGEDIR}${WWWDIR}/tmp/pids + ${MKDIR} ${STAGEDIR}${WWWDIR}/bundler.d cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} +do-install-RMAGIC-on: + ${CP} ${FILESDIR}/rmagic.rb ${STAGEDIR}${WWWDIR}/bundler.d + +do-install-THIN-on: + ${CP} ${FILESDIR}/thin.rb ${STAGEDIR}${WWWDIR}/bundler.d + post-install: ${TOUCH} ${STAGEDIR}${WWWDIR}/Gemfile.lock - if ! [ -r ${STAGEDIR}${WWWDIR}/config/settings.yml ]; then \ - ${INSTALL_DATA} ${STAGEDIR}${WWWDIR}/config/settings.yml-dist \ - ${STAGEDIR}${WWWDIR}/config/settings.yml; \ - fi .include diff --git a/www/redmine/files/extra-patch-Gemfile b/www/redmine/files/extra-patch-Gemfile deleted file mode 100644 index e58e3f355051..000000000000 --- a/www/redmine/files/extra-patch-Gemfile +++ /dev/null @@ -1,17 +0,0 @@ ---- Gemfile.orig 2014-03-30 21:39:22.047223369 +0000 -+++ Gemfile 2014-03-30 21:39:43.309222769 +0000 -@@ -25,14 +25,6 @@ - end - - platforms :mri, :mingw do -- # Optional gem for exporting the gantt to a PNG file, not supported with jruby -- group :rmagick do -- # RMagick 2 supports ruby 1.9 -- # RMagick 1 would be fine for ruby 1.8 but Bundler does not support -- # different requirements for the same gem on different platforms -- gem "rmagick", (RUBY_VERSION < "1.9" ? "2.13.3" : "~> 2.13.4") -- end -- - # Optional Markdown support, not for JRuby - group :markdown do - gem "redcarpet", (RUBY_VERSION < "1.9" ? "~> 2.3.0" : "~> 3.3.2") diff --git a/www/redmine/files/extra-patch-thin-Gemfile b/www/redmine/files/extra-patch-thin-Gemfile deleted file mode 100644 index 486b355864e3..000000000000 --- a/www/redmine/files/extra-patch-thin-Gemfile +++ /dev/null @@ -1,12 +0,0 @@ ---- Gemfile.orig 2015-04-02 19:40:25.929698000 +0000 -+++ Gemfile 2015-04-02 19:41:11.539003000 +0000 -@@ -44,6 +44,9 @@ - gem "activerecord-jdbc-adapter", "~> 1.3.2" - end - -+# Thin webserver -+gem "thin", "~> 1.6.2" -+ - # Include database gems for the adapters found in the database - # configuration file - require 'erb' diff --git a/www/redmine/files/patch-Gemfile b/www/redmine/files/patch-Gemfile index ea9c99100e10..db4fed010525 100644 --- a/www/redmine/files/patch-Gemfile +++ b/www/redmine/files/patch-Gemfile @@ -1,6 +1,6 @@ ---- Gemfile.orig 2015-12-09 20:52:29 UTC +--- Gemfile.orig 2015-12-09 23:40:39 UTC +++ Gemfile -@@ -1,25 +1,25 @@ +@@ -1,37 +1,29 @@ source 'https://rubygems.org' -gem "rails", "3.2.22" @@ -32,7 +32,19 @@ gem "rack-openid" end -@@ -82,23 +82,6 @@ else + platforms :mri, :mingw do +- # Optional gem for exporting the gantt to a PNG file, not supported with jruby +- group :rmagick do +- # RMagick 2 supports ruby 1.9 +- # RMagick 1 would be fine for ruby 1.8 but Bundler does not support +- # different requirements for the same gem on different platforms +- gem "rmagick", (RUBY_VERSION < "1.9" ? "2.13.3" : "~> 2.13.4") +- end +- + # Optional Markdown support, not for JRuby + group :markdown do + gem "redcarpet", (RUBY_VERSION < "1.9" ? "~> 2.3.0" : "~> 3.3.2") +@@ -82,23 +74,6 @@ else warn("Please configure your config/database.yml first") end @@ -56,3 +68,11 @@ local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") if File.exists?(local_gemfile) puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v` +@@ -111,3 +86,7 @@ Dir.glob File.expand_path("../plugins/*/ + #TODO: switch to "eval_gemfile file" when bundler >= 1.2.0 will be required (rails 4) + instance_eval File.read(file), file + end ++ ++Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle| ++ self.instance_eval(Bundler.read_file(bundle)) ++end diff --git a/www/redmine/files/rmagic.rb b/www/redmine/files/rmagic.rb new file mode 100644 index 000000000000..f9849be1b155 --- /dev/null +++ b/www/redmine/files/rmagic.rb @@ -0,0 +1 @@ +gem "rmagick", ">= 2.13.4" diff --git a/www/redmine/files/thin.rb b/www/redmine/files/thin.rb new file mode 100644 index 000000000000..40b0486c1de4 --- /dev/null +++ b/www/redmine/files/thin.rb @@ -0,0 +1 @@ +gem "thin", ">= 1.6.2" diff --git a/www/redmine/pkg-plist b/www/redmine/pkg-plist index d0cbb4faebd8..053d59efc628 100644 --- a/www/redmine/pkg-plist +++ b/www/redmine/pkg-plist @@ -2,8 +2,6 @@ @owner %%WWWOWN%% @group %%WWWGRP%% %%WWWDIR%%/Gemfile -@owner %%WWWOWN%% -@group %%WWWGRP%% %%WWWDIR%%/Gemfile.lock @owner @group @@ -592,8 +590,6 @@ %%WWWDIR%%/config/locales/zh.yml %%WWWDIR%%/config/preinitializer.rb %%WWWDIR%%/config/routes.rb -%%WWWDIR%%/config/settings.yml -%%WWWDIR%%/config/settings.yml-dist %%WWWDIR%%/db/migrate/001_setup.rb %%WWWDIR%%/db/migrate/002_issue_move.rb %%WWWDIR%%/db/migrate/003_issue_add_note.rb @@ -1842,6 +1838,9 @@ %%WWWDIR%%/test/unit/wiki_test.rb %%WWWDIR%%/test/unit/workflow_test.rb %%WWWDIR%%/test/unit/workflow_transition_test.rb +%%RMAGIC%%%%WWWDIR%%/bundler.d/rmagic.rb +%%THIN%%%%WWWDIR%%/bundler.d/thin.rb +@sample %%WWWDIR%%/config/settings.yml.sample @(%%WWWOWN%%,%%WWWGRP%%,) %%WWWDIR%%/tmp/pdf/empty @(%%WWWOWN%%,%%WWWGRP%%,) %%WWWDIR%%/tmp/test/empty @(%%WWWOWN%%,%%WWWGRP%%,) %%WWWDIR%%/tmp/thumbnails/empty