[PATCH] www/redmine: update to 2.3.4, add UNICORN and STAGE
Geoffroy Desvernay
dgeo at centrale-marseille.fr
Sun Dec 8 20:12:52 UTC 2013
>Submitter-Id: current-users
>Originator: Geoffroy Desvernay
>Organization: Ecole Centrale de Marseille
>Confidential: no
>Synopsis: [PATCH] www/redmine: update to 2.3.4, add UNICORN and STAGE
>Severity: non-critical
>Priority: low
>Category: ports
>Class: update
>Release: FreeBSD 10.0-BETA4 amd64
>Environment:
System: FreeBSD dgeo.sysadm.ec-m.fr 10.0-BETA4 FreeBSD 10.0-BETA4 #0: Mon Dec 2 18:21:18 CET
>Description:
- Update to 2.3.4
- Add UNICORN option (depend on unicorn and install example config)
see also ports/184592, this should permit a quick unicorn setup
- enable STAGE-ing
- move some chmod/chown to plist as suggested by https://wiki.freebsd.org/ports/StageDir
- use OPTIONSng helpers to simplify a bit
Port maintainer (ruby at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.99_11 (mode: update, diff: SVN)
>How-To-Repeat:
>Fix:
--- redmine-2.3.4.patch begins here ---
Index: Makefile
===================================================================
--- Makefile (revision 335926)
+++ Makefile (working copy)
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= redmine
-PORTVERSION= 2.3.3
-PORTREVISION= 2
+PORTVERSION= 2.3.4
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_RUBYFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -27,11 +26,12 @@
USE_RAKE= yes
NO_BUILD= yes
SUB_LIST+= RUBY_NAME=${RUBY_NAME}
+SUB_FILES= pkg-message
OPTIONS_DEFINE= MYSQL MYSQL2 POSTGRESQL RMAGIC WWWSERVER
OPTIONS_DEFAULT=MYSQL2 RMAGIC WWWSERVER THIN
OPTIONS_SINGLE= WWWSERVER
-OPTIONS_SINGLE_WWWSERVER= THIN PASSENGER
+OPTIONS_SINGLE_WWWSERVER= THIN PASSENGER UNICORN
POSTGRESQL_DESC=Enable PostgreSQL support
RMAGIC_DESC= Enable Gantt charts support
THIN_DESC= Use Thin WEB server
@@ -38,42 +38,39 @@
PASSENGER_DESC= Use Apache/Nginx WEB server
MYSQL2_DESC= MySQL database support (via mysql2 rubygem)
NO_OPTIONS_SORT=yes
+OPTIONS_SUB= yes
-NO_STAGE= yes
-.include <bsd.port.pre.mk>
+MYSQL_RUN_DEPENDS= rubygem-mysql>=2.8.1:${PORTSDIR}/databases/rubygem-mysql
+MYSQL2_RUN_DEPENDS= rubygem-mysql2>=0:${PORTSDIR}/databases/rubygem-mysql2
+POSTGRESQL_RUN_DEPENDS= rubygem-pg>=0:${PORTSDIR}/databases/rubygem-pg
+RMAGIC_RUN_DEPENDS= rubygem-rmagick>=2.0.0:${PORTSDIR}/graphics/rubygem-rmagick
-.if ${PORT_OPTIONS:MMYSQL}
-RUN_DEPENDS+= rubygem-mysql>=2.8.1:${PORTSDIR}/databases/rubygem-mysql
-.endif
+.include <bsd.port.options.mk>
-.if ${PORT_OPTIONS:MMYSQL2}
-RUN_DEPENDS+= rubygem-mysql2>=0:${PORTSDIR}/databases/rubygem-mysql2
-.endif
-
-.if ${PORT_OPTIONS:MPOSTGRESQL}
-RUN_DEPENDS+= rubygem-pg>=0:${PORTSDIR}/databases/rubygem-pg
-.endif
-
-.if ${PORT_OPTIONS:MRMAGIC}
-RUN_DEPENDS+= rubygem-rmagick>=2.0.0:${PORTSDIR}/graphics/rubygem-rmagick
-.else
-EXTRA_PATCHES+= ${FILESDIR}/extra-patch-Gemfile
-.endif
-
.if ${PORT_OPTIONS:MWWWSERVER}
-.if ${PORT_OPTIONS:MTHIN}
USERS= ${WWWOWN}
GROUPS= ${WWWGRP}
+SUB_LIST+= WWWSERVER="" WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
+PLIST_SUB+= WWWSERVER="" WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
+.if ${PORT_OPTIONS:MTHIN}
RUN_DEPENDS+= thin:${PORTSDIR}/www/rubygem-thin
USE_RC_SUBR= redmine
-SUB_LIST+= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
.endif
.if ${PORT_OPTIONS:MPASSENGER}
RUN_DEPENDS+= passenger-config:${PORTSDIR}/www/rubygem-passenger
.endif
+
+.if ${PORT_OPTIONS:MUNICORN}
+RUN_DEPENDS+= unicorn:${PORTSDIR}/www/rubygem-unicorn
+SUB_LIST+= UNICORN=""
+.else
+SUB_LIST+= UNICORN="@comment "
.endif
+.endif
+.include <bsd.port.pre.mk>
+
post-extract:
${MV} ${WRKSRC}/config/settings.yml ${WRKSRC}/config/settings.yml-dist
@@ -81,24 +78,22 @@
${MKDIR} ${WRKSRC}/public/plugin_assets
do-install:
- ${MKDIR} ${WWWDIR}
- ${MKDIR} ${WWWDIR}/tmp/pids
+ ${MKDIR} ${STAGEDIR}${WWWDIR}
+ ${MKDIR} ${STAGEDIR}${WWWDIR}/tmp/pids
+.if ${PORT_OPTIONS:MWWWSERVER}
+.if ${PORT_OPTIONS:MUNICORN}
+ ${CP} -p ${FILESDIR}/unicorn.config.rb.sample ${WRKSRC}/config/unicorn.config.rb.sample
+.endif
+.endif
+ ${TOUCH} ${WRKSRC}/Gemfile.lock
+ ${FIND} ${WRKSRC}/script -type f -print | ${XARGS} ${CHMOD} 755
cd ${WRKSRC} && \
- ${COPYTREE_SHARE} "*" ${WWWDIR} "! ( -name *\.orig -o -name *\.bak )"
- ${FIND} ${WRKSRC}/script -type f -print | ${XARGS} ${CHMOD} 755
+ ${COPYTREE_SHARE} "*" ${STAGEDIR}${WWWDIR} "! ( -name *\.orig -o -name *\.bak )"
post-install:
- ${TOUCH} ${WWWDIR}/Gemfile.lock
- ${CHOWN} ${WWWOWN}:${WWWGRP} ${WWWDIR}/Gemfile.lock
-
- if ! [ -r ${WWWDIR}/config/settings.yml ]; then \
- ${INSTALL_DATA} ${WWWDIR}/config/settings.yml-dist \
- ${WWWDIR}/config/settings.yml; \
- fi
- for subdir in files log tmp public/plugin_assets; do \
- ${CHOWN} -R :${WWWGRP} ${WWWDIR}/$$subdir; \
- ${CHMOD} -R g+w ${WWWDIR}/$$subdir; \
+ @for subdir in files log tmp public/plugin_assets; do \
+ ${CHOWN} -R :${WWWGRP} ${STAGEDIR}${WWWDIR}/$$subdir; \
+ ${CHMOD} -R g+w ${STAGEDIR}${WWWDIR}/$$subdir; \
done
- @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
Index: distinfo
===================================================================
--- distinfo (revision 335926)
+++ distinfo (working copy)
@@ -1,2 +1,2 @@
-SHA256 (redmine-2.3.3.tar.gz) = dbec7b62417b8cd36c02bf98f38d26429c27b67430217879ce8fe25af6add97b
-SIZE (redmine-2.3.3.tar.gz) = 3803852
+SHA256 (redmine-2.3.4.tar.gz) = 0b435f4b121baf4cea9f66dbf9558c9e3a8a3239f99ef1e46c9044b4d9d327c6
+SIZE (redmine-2.3.4.tar.gz) = 3810010
Index: files/extra-patch-Gemfile
===================================================================
--- files/extra-patch-Gemfile (revision 335926)
+++ files/extra-patch-Gemfile (working copy)
@@ -1,19 +0,0 @@
---- ./Gemfile.orig 2013-07-30 12:49:03.000000000 -0400
-+++ ./Gemfile 2013-07-30 12:49:13.000000000 -0400
-@@ -18,16 +18,6 @@
- gem "rack-openid"
- end
-
--# Optional gem for exporting the gantt to a PNG file, not supported with jruby
--platforms :mri, :mingw do
-- 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", ">= 2.0.0"
-- end
--end
--
- platforms :jruby do
- # jruby-openssl is bundled with JRuby 1.7.0
- gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
Index: files/patch-Gemfile
===================================================================
--- files/patch-Gemfile (revision 335926)
+++ files/patch-Gemfile (working copy)
@@ -1,59 +0,0 @@
---- Gemfile.orig 2013-09-14 06:48:49.000000000 +0000
-+++ Gemfile 2013-10-28 18:11:49.154289224 +0000
-@@ -1,11 +1,11 @@
- source 'https://rubygems.org'
-
--gem "rails", "3.2.13"
--gem "jquery-rails", "~> 2.0.2"
-+gem "rails", "3.2.15"
-+gem "jquery-rails", "~> 3.0"
- gem "i18n", "~> 0.6.0"
--gem "coderay", "~> 1.0.9"
-+gem "coderay", "~> 1.1.0"
- gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
--gem "builder", "3.0.0"
-+gem "builder", "~> 3.0.0"
-
- # Optional gem for LDAP authentication
- group :ldap do
-@@ -14,7 +14,7 @@
-
- # Optional gem for OpenID authentication
- group :openid do
-- gem "ruby-openid", "~> 2.2.3", :require => "openid"
-+ gem "ruby-openid", "~> 2.2", :require => "openid"
- gem "rack-openid"
- end
-
-@@ -46,10 +46,10 @@
- adapters.each do |adapter|
- case adapter
- when 'mysql2'
-- gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
-+ gem "mysql2", "~> 0.3", :platforms => [:mri, :mingw]
- gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
- when 'mysql'
-- gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
-+ gem "mysql", "~> 2.8", :platforms => [:mri, :mingw]
- gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
- when /postgresql/
- gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
-@@ -71,18 +71,6 @@
- warn("Please configure your config/database.yml first")
- end
-
--group :development do
-- gem "rdoc", ">= 2.4.2"
-- gem "yard"
--end
--
--group :test do
-- gem "shoulda", "~> 3.3.2"
-- gem "mocha", "~> 0.13.3"
-- gem 'capybara', '~> 2.0.0'
-- gem 'nokogiri', '< 1.6.0'
--end
--
- 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`
Index: files/pkg-message.in
===================================================================
--- files/pkg-message.in (revision 0)
+++ files/pkg-message.in (working copy)
@@ -0,0 +1,23 @@
+=============================================================================
+
+Redmine was installed.
+
+You now need to setup your Redmine installation so
+please have a look at the Installation Guide.
+
+http://www.redmine.org/wiki/redmine/RedmineInstall
+
+
+If you are upgrading please read the Upgrading Guide
+before starting the new version.
+
+http://www.redmine.org/wiki/redmine/RedmineUpgrade
+
+=============================================================================
+%%WWWSERVER%%%%UNICORN%%You configured redmine to work with unicorn:
+%%WWWSERVER%%%%UNICORN%%
+%%WWWSERVER%%%%UNICORN%% a sample unicorn config file was created to
+%%WWWSERVER%%%%UNICORN%% %%WWWDIR%%/config/unicorn.config.rb
+%%WWWSERVER%%%%UNICORN%%
+%%WWWSERVER%%%%UNICORN%%You still need to launch unicorn ...
+%%WWWSERVER%%%%UNICORN%%=============================================================================
Property changes on: files/pkg-message.in
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: files/unicorn.config.rb.sample
===================================================================
--- files/unicorn.config.rb.sample (revision 0)
+++ files/unicorn.config.rb.sample (working copy)
@@ -0,0 +1,37 @@
+worker_processes 2
+working_directory "/usr/local/www/redmine"
+
+#listen File.expand_path("tmp/unicorn.sock", ENV['RAILS_ROOT'])
+#listen "/var/tmp/unicorn_redmine.sock", :backlog => 64
+#listen 3030,tcp_nopush => true
+pid File.expand_path("tmp/unicorn.pid", ENV['RAILS_ROOT'])
+
+timeout 60
+
+preload_app true
+
+stdout_path File.expand_path("log/unicorn.stdout.log", ENV['RAILS_ROOT'])
+stderr_path File.expand_path("log/unicorn.stderr.log", ENV['RAILS_ROOT'])
+
+GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true
+
+check_client_connection false
+
+before_fork do |server, worker|
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!
+
+ old_pid = "#{server.config[:pid]}.oldbin"
+ if old_pid != server.pid
+ begin
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
+ Process.kill(sig, File.read(old_pid).to_i)
+ rescue Errno::ENOENT, Errno::ESRCH
+ end
+ end
+
+ sleep 1
+ end
+
+after_fork do |server, worker|
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
+end
Index: pkg-message
===================================================================
--- pkg-message (revision 335926)
+++ pkg-message (working copy)
@@ -1,16 +0,0 @@
-=============================================================================
-
-Redmine was installed.
-
-You now need to setup your Redmine installation so
-please have a look at the Installation Guide.
-
-http://www.redmine.org/wiki/redmine/RedmineInstall
-
-
-If you are upgrading please read the Upgrading Guide
-before starting the new version.
-
-http://www.redmine.org/wiki/redmine/RedmineUpgrade
-
-=============================================================================
Index: pkg-plist
===================================================================
--- pkg-plist (revision 335926)
+++ pkg-plist (working copy)
@@ -1,5 +1,4 @@
%%WWWDIR%%/Gemfile
-%%WWWDIR%%/Gemfile.lock
%%WWWDIR%%/README.rdoc
%%WWWDIR%%/Rakefile
%%WWWDIR%%/app/helpers/issue_statuses_helper.rb
@@ -575,8 +574,6 @@
%%WWWDIR%%/config/environment.rb
%%WWWDIR%%/config/application.rb
%%WWWDIR%%/config/preinitializer.rb
-%%WWWDIR%%/config/settings.yml-dist
-%%WWWDIR%%/config/settings.yml
%%WWWDIR%%/config.ru
%%WWWDIR%%/db/migrate/001_setup.rb
%%WWWDIR%%/db/migrate/20091017212644_add_missing_indexes_to_messages.rb
@@ -823,7 +820,6 @@
%%WWWDIR%%/extra/sample_plugin/config/routes.rb
%%WWWDIR%%/extra/sample_plugin/init.rb
%%WWWDIR%%/extra/mail_handler/rdm-mailhandler.rb
-%%WWWDIR%%/files/delete.me
%%WWWDIR%%/lib/redcloth3.rb
%%WWWDIR%%/lib/SVG/GPL.txt
%%WWWDIR%%/lib/SVG/LICENSE.txt
@@ -1147,7 +1143,6 @@
%%WWWDIR%%/lib/plugins/acts_as_versioned/init.rb
%%WWWDIR%%/lib/plugins/acts_as_versioned/MIT-LICENSE
%%WWWDIR%%/lib/plugins/acts_as_versioned/CHANGELOG
-%%WWWDIR%%/log/delete.me
%%WWWDIR%%/plugins/README
%%WWWDIR%%/public/404.html
%%WWWDIR%%/public/help/wiki_syntax.html
@@ -1413,8 +1408,6 @@
%%WWWDIR%%/public/javascripts/i18n/jquery.ui.datepicker-fi.js
%%WWWDIR%%/public/javascripts/select_list_move.js
%%WWWDIR%%/public/javascripts/raphael.js
-%%WWWDIR%%/script/about
-%%WWWDIR%%/script/rails
%%WWWDIR%%/test/mocks/open_id_authentication_mock.rb
%%WWWDIR%%/test/object_helpers.rb
%%WWWDIR%%/test/test_helper.rb
@@ -1773,9 +1766,24 @@
%%WWWDIR%%/test/extra/redmine_pm/repository_subversion_test.rb
%%WWWDIR%%/test/extra/redmine_pm/test_case.rb
%%WWWDIR%%/test/extra/redmine_pm/repository_git_test.rb
+ at unexec if cmp -s %D/%%WWWDIR%%/config/settings.yml %D/%%WWWDIR%%/config/settings.yml-dist ; then rm -f %D/%%WWWDIR%%/config/settings.yml; fi
+%%WWWDIR%%/config/settings.yml-dist
+ at exec if [ ! -f %D/%%WWWDIR%%/config/settings.yml ]; then cp -p %D/%%WWWDIR%%/config/settings.yml-dist %D/%%WWWDIR%%/config/settings.yml; fi
+%%WWWSERVER%%%%UNICORN%%@unexec if cmp -s %D/%%WWWDIR%%/config/unicorn.config.rb %D/%%WWWDIR%%/config/unicorn.config.rb.sample ; then rm -f %D/%%WWWDIR%%/config/unicorn.config.rb; fi
+%%WWWSERVER%%%%UNICORN%%%%WWWDIR%%/config/unicorn.config.rb.sample
+%%WWWSERVER%%%%UNICORN%%@exec if [ ! -f %D/%%WWWDIR%%/config/unicorn.config.rb ]; then cp -p %D/%%WWWDIR%%/config/unicorn.config.rb.sample %D/%%WWWDIR%%/config/unicorn.config.rb; fi
+ at mode 755
+%%WWWDIR%%/script/about
+%%WWWDIR%%/script/rails
+ at group %%WWWGRP%%
+ at mode g+w
+%%WWWDIR%%/files/delete.me
+%%WWWDIR%%/log/delete.me
%%WWWDIR%%/tmp/test/empty
%%WWWDIR%%/tmp/pdf/empty
%%WWWDIR%%/tmp/thumbnails/empty
+ at owner %%WWWOWN%%
+%%WWWDIR%%/Gemfile.lock
@dirrmtry %%WWWDIR%%/vendor
@dirrmtry %%WWWDIR%%/tmp/thumbnails
@dirrmtry %%WWWDIR%%/tmp/test
--- redmine-2.3.4.patch ends here ---
More information about the freebsd-ruby
mailing list