diff --git a/www/redmine50/Makefile b/www/redmine50/Makefile new file mode 100644 index 000000000000..119d7416ae5d --- /dev/null +++ b/www/redmine50/Makefile @@ -0,0 +1,120 @@ +PORTNAME= redmine +PORTVERSION= 5.0.4 +CATEGORIES= www +MASTER_SITES= https://www.redmine.org/releases/ +PKGNAMESUFFIX= 50 + +MAINTAINER= mikael@FreeBSD.org +COMMENT= Flexible project management web application +WWW= https://www.redmine.org/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/doc/COPYING + +RUN_DEPENDS= rubygem-bundler>=1.12.0:sysutils/rubygem-bundler \ + rubygem-globalid-rails61>0:databases/rubygem-globalid-rails61 \ + rubygem-rails61>=6.1:www/rubygem-rails61 \ + rubygem-rouge>=3.28.0:textproc/rubygem-rouge \ + rubygem-request_store>=1.5.0:devel/rubygem-request_store \ + rubygem-mini_mime>=1.0.1:mail/rubygem-mini_mime \ + rubygem-actionpack-xml_parser-rails61>=0:textproc/rubygem-actionpack-xml_parser-rails61 \ + rubygem-roadie-rails-rails61>=3.0.0:mail/rubygem-roadie-rails-rails61 \ + rubygem-marcel>0:devel/rubygem-marcel \ + rubygem-mail>=2.7.1:mail/rubygem-mail \ + rubygem-csv>=3.2.0:devel/rubygem-csv \ + rubygem-nokogiri>=1.13.8:textproc/rubygem-nokogiri \ + rubygem-i18n>=1.10.0:devel/rubygem-i18n \ + rubygem-rbpdf>=1.20.0:print/rubygem-rbpdf \ + rubygem-addressable>0:www/rubygem-addressable \ + rubygem-rubyzip>0:archivers/rubygem-rubyzip \ + rubygem-net-smtp>0:mail/rubygem-net-smtp \ + rubygem-net-imap>0:mail/rubygem-net-imap \ + rubygem-net-pop>0:mail/rubygem-net-pop \ + rubygem-psych>0:textproc/rubygem-psych \ + rubygem-net-ldap>=0.17.0:net/rubygem-net-ldap \ + rubygem-rotp>=5.0.0:devel/rubygem-rotp \ + rubygem-rqrcode>0:www/rubygem-rqrcode \ + rubygem-erb>0:devel/rubygem-erb + +# Per https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264638#c9 +# to be removed if https://www.redmine.org/issues/37394 is fixed +RUN_DEPENDS+= rubygem-redcarpet>=3.5.1:textproc/rubygem-redcarpet \ + rubygem-html-pipeline>=2.13.2:textproc/rubygem-html-pipeline \ + rubygem-commonmarker>=0.23.6:textproc/rubygem-commonmarker \ + rubygem-sanitize>=6.0:textproc/rubygem-sanitize \ + rubygem-deckar01-task_list>=2.3.1:www/rubygem-deckar01-task_list + +USES= cpe +USE_RUBY= yes + +CONFLICTS_INSTALL= redmine42 + +NO_ARCH= yes +NO_BUILD= yes + +USERS= ${WWWOWN} +GROUPS= ${WWWGRP} +PLIST_SUB= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} +SUB_LIST= RUBY_SUFFIX=${RUBY_SUFFIX} + +OPTIONS_DEFINE= MYSQL POSTGRESQL MARKDOWN RMAGIC THIN +OPTIONS_DEFAULT=MYSQL MARKDOWN RMAGIC THIN +OPTIONS_SUB= yes +POSTGRESQL_DESC=Enable PostgreSQL support +MARKDOWN_DESC= Enable Markdown support +RMAGIC_DESC= Enable Gantt charts support +THIN_DESC= Use Thin WEB server +MYSQL_DESC= MySQL database support (via mysql2 rubygem) +NO_OPTIONS_SORT= yes +MYSQL_RUN_DEPENDS= rubygem-mysql2>=0.5.0:databases/rubygem-mysql2 +POSTGRESQL_RUN_DEPENDS= rubygem-pg>=1.2.2:databases/rubygem-pg +MARKDOWN_RUN_DEPENDS= rubygem-redcarpet>=3.5.1:textproc/rubygem-redcarpet +RMAGIC_RUN_DEPENDS= rubygem-mini_magick>=4.11.0:graphics/rubygem-mini_magick +THIN_RUN_DEPENDS= rubygem-thin>=1.6.2:www/rubygem-thin +THIN_SUB_LIST= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} +THIN_VARS= USE_RC_SUBR=redmine + +.include + +post-extract: + @${RM} -r ${WRKSRC}/.hgignore ${WRKSRC}/.gitignore ${WRKSRC}/.github \ + ${WRKSRC}/files/delete.me ${WRKSRC}/log/delete.me + @${MV} ${WRKSRC}/config/settings.yml ${WRKSRC}/config/settings.yml.sample + @${MV} ${WRKSRC}/config/database.yml.example ${WRKSRC}/config/database.yml.sample + +post-patch: + @${RM} ${WRKSRC}/Gemfile.orig + +do-install: + ${MKDIR} ${STAGEDIR}${WWWDIR} + ${MKDIR} ${STAGEDIR}${WWWDIR}/bundler.d + ${MKDIR} ${STAGEDIR}${WWWDIR}/log + ${MKDIR} ${STAGEDIR}${WWWDIR}/public/plugin_assets + ${MKDIR} ${STAGEDIR}${WWWDIR}/tmp + + # https://www.redmine.org/issues/37394 + ${CP} ${FILESDIR}/commonmark.rb ${STAGEDIR}${WWWDIR}/bundler.d + cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} + ${TOUCH} ${STAGEDIR}${WWWDIR}/Gemfile.lock + +do-install-MYSQL-on: + ${CP} ${FILESDIR}/mysql.rb ${STAGEDIR}${WWWDIR}/bundler.d + +do-install-POSTGRESQL-on: + ${CP} ${FILESDIR}/pg.rb ${STAGEDIR}${WWWDIR}/bundler.d + +do-install-MARKDOWN-on: + ${CP} ${FILESDIR}/markdown.rb ${STAGEDIR}${WWWDIR}/bundler.d + +do-install-RMAGIC-on: + ${CP} ${FILESDIR}/mini_magick.rb ${STAGEDIR}${WWWDIR}/bundler.d + +do-install-THIN-on: + ${CP} ${FILESDIR}/thin.rb ${STAGEDIR}${WWWDIR}/bundler.d + +post-install: + (cd ${STAGEDIR}${WWWDIR} && ${RM} Gemfile.lock && bundle install --local) + ${RM} ${STAGEDIR}${WWWDIR}/package.json \ + ${STAGEDIR}${WWWDIR}/yarn.lock + +.include diff --git a/www/redmine50/bsd.redmine.mk b/www/redmine50/bsd.redmine.mk new file mode 100644 index 000000000000..123cc7989126 --- /dev/null +++ b/www/redmine50/bsd.redmine.mk @@ -0,0 +1,78 @@ +# Module that simplifies installation of Redmine plugins. +# +# Date created: 2010-09-12 +# Whom: Eygene Ryabinkin +# +# We're assuming standard plugin installation sequence that is described +# in the https://www.redmine.org/projects/redmine/wiki/Plugins +# +# Basically, we need the following variables to be defined: +# - REDMINE_PLUGIN_NAME: the name of the plugin; +# - WWWDIR: the location of the Redmine installation; +# the default value is ${PREFIX}/www/redmine; +# the directory must lie under ${PREFIX} or such configuration +# will be IGNORE'd; +# - WRKSRC must be set to the root directory of the plugin contents: +# we will copy all objects in this directory to the plugin's +# destination directory, excluding all files named *.orig. +# +# PLIST will be generated automatically, there is no need to worry +# about it. But if you will need to use your own (even the standard +# packaging list in ${PORTDIR}/pkg-plist), set the variable PLIST +# pointing to that file. +# +# You can override the target 'do-build', but in this case, you should +# remember that the target named 'redmine-plugin-plist' does the +# automated generation of the PLIST: use it if you need. +# +# +# Here is an example of a simple Makefile for Redmine plugin: +# {{{ +# PORTNAME= me-the-plugin +# PORTVERSION= 1.0 +# CATEGORIES= www +# MASTER_SITES= http://cool.org.name/some/path/ +# +# MAINTAINER= you@your.org +# COMMENT= Another cool plugin for Redmine +# +# REDMINE_PLUGIN_NAME= redmine_http_auth +# +# .include "${.CURDIR}/../../www/redmine/bsd.redmine.mk" +# }}} + +PKGNAMEPREFIX?= redmine50- + +RUN_DEPENDS+= redmine50>=4.2:www/redmine50 + +USE_RUBY= yes +.if !defined(PLIST) +PLIST= ${WRKDIR}/PLIST +_GEN_PLIST= YesPlease +.endif + +WWWDIR?= ${PREFIX}/www/redmine +WWWDIR_REL= ${WWWDIR:S|^${PREFIX}/||} + +.if ${WWWDIR_REL} == ${WWWDIR} +IGNORE= WWWDIR is not a child of PREFIX (${PREFIX}) +.endif + +.if !defined(do-build) +do-build: redmine-plugin-plist + @${DO_NADA} +.endif + +redmine-plugin-plist: +.if defined(_GEN_PLIST) + cd ${WRKSRC} && ${FIND} . -type f | ${GREP} -v '\.orig$$' | ${SED} -e's|^\.|${WWWDIR_REL}/plugins/${REDMINE_PLUGIN_NAME}|' >> ${PLIST} + cd ${WRKSRC} && ${FIND} -d . -empty -type d | ${SED} -e's|^\.|@dir ${WWWDIR_REL}/plugins/${REDMINE_PLUGIN_NAME}|' >> ${PLIST} +.else + @${DO_NADA} +.endif + +do-install: + ${MKDIR} "${STAGEDIR}${WWWDIR}/plugins/${REDMINE_PLUGIN_NAME}" + ${TAR} -C "${WRKSRC}" -cf - --exclude '*.orig' . | ${TAR} -C "${STAGEDIR}${WWWDIR}/plugins/${REDMINE_PLUGIN_NAME}" -xf - + +.include diff --git a/www/redmine50/distinfo b/www/redmine50/distinfo new file mode 100644 index 000000000000..478f04c3e901 --- /dev/null +++ b/www/redmine50/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1671100842 +SHA256 (redmine-5.0.4.tar.gz) = 39436f5f8d26f5b7ce17e79903a3112e556e924da4f51c05b57f5defbe6f2924 +SIZE (redmine-5.0.4.tar.gz) = 3114593 diff --git a/www/redmine50/files/markdown.rb b/www/redmine50/files/markdown.rb new file mode 100644 index 000000000000..28c24b81233f --- /dev/null +++ b/www/redmine50/files/markdown.rb @@ -0,0 +1 @@ +gem "redcarpet", ">= 3.5.1" diff --git a/www/redmine50/files/mini_magick.rb b/www/redmine50/files/mini_magick.rb new file mode 100644 index 000000000000..9c50142a47be --- /dev/null +++ b/www/redmine50/files/mini_magick.rb @@ -0,0 +1 @@ +gem "mini_magick", ">= 4.11.0" diff --git a/www/redmine50/files/mysql.rb b/www/redmine50/files/mysql.rb new file mode 100644 index 000000000000..178b6b3faa35 --- /dev/null +++ b/www/redmine50/files/mysql.rb @@ -0,0 +1 @@ +gem "mysql2", "~> 0.5.0" diff --git a/www/redmine50/files/patch-Gemfile b/www/redmine50/files/patch-Gemfile new file mode 100644 index 000000000000..aec3b49777de --- /dev/null +++ b/www/redmine50/files/patch-Gemfile @@ -0,0 +1,116 @@ +--- Gemfile.orig 2022-12-15 17:48:38.146246000 +0100 ++++ Gemfile 2022-12-15 18:00:02.071136000 +0100 +@@ -3,9 +3,9 @@ gem 'bundler', '>= 1.12.0' + ruby '>= 2.5.0', '< 3.2.0' + gem 'bundler', '>= 1.12.0' + +-gem 'rails', '6.1.7' ++gem 'rails', '>=6.1.6' + gem 'globalid', '~> 0.4.2' if Gem.ruby_version < Gem::Version.new('2.6.0') +-gem 'rouge', '~> 3.28.0' ++gem 'rouge', '>= 3.28.0' + gem 'request_store', '~> 1.5.0' + gem 'mini_mime', '~> 1.1.0' + gem "actionpack-xml_parser" +@@ -15,12 +15,12 @@ gem "rexml", require: false if Gem.ruby_version >= Gem + gem 'csv', '~> 3.2.0' + gem 'nokogiri', (Gem.ruby_version < Gem::Version.new('2.6.0') ? '~> 1.12.5' : '~> 1.13.4') + gem "rexml", require: false if Gem.ruby_version >= Gem::Version.new('3.0') +-gem 'i18n', '~> 1.10.0' ++gem 'i18n', '>= 1.10.0' + gem "rbpdf", "~> 1.20.0" + gem 'addressable' + gem 'rubyzip', '~> 2.3.0' + gem 'net-smtp', '~> 0.3.0' +-gem 'net-imap', '~> 0.2.2' ++gem 'net-imap', '>= 0.2.2' + gem 'net-pop', '~> 0.1.1' + # Rails 6.1.6.1 does not work with Pysch 3.0.2, which is installed by default with Ruby 2.5. See https://github.com/rails/rails/issues/45590 + gem 'psych', '>= 3.1.0' if Gem.ruby_version < Gem::Version.new('2.6.0') +@@ -37,77 +37,6 @@ end + gem 'net-ldap', '~> 0.17.0' + end + +-# Optional gem for exporting the gantt to a PNG file +-group :minimagick do +- gem 'mini_magick', '~> 4.11.0' +-end +- +-# Optional Markdown support, not for JRuby +-# ToDo: Remove common_mark group when common_mark is decoupled from markdown. See defect (#36892) for more details. +-gem 'redcarpet', '~> 3.5.1', groups: [:markdown, :common_mark] +- +-# Optional CommonMark support, not for JRuby +-group :common_mark do +- gem "html-pipeline", "~> 2.13.2" +- gem "commonmarker", (Gem.ruby_version < Gem::Version.new('2.6.0') ? '0.21.0' : '~> 0.23.6') +- gem "sanitize", "~> 6.0" +- gem 'deckar01-task_list', '2.3.2' +-end +- +-# Include database gems for the adapters found in the database +-# configuration file +-require 'erb' +-require 'yaml' +-database_file = File.join(File.dirname(__FILE__), "config/database.yml") +-if File.exist?(database_file) +- yaml_config = ERB.new(IO.read(database_file)).result +- database_config = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml_config) : YAML.load(yaml_config) +- adapters = database_config.values.map {|c| c['adapter']}.compact.uniq +- if adapters.any? +- adapters.each do |adapter| +- case adapter +- when 'mysql2' +- gem "mysql2", "~> 0.5.0", :platforms => [:mri, :mingw, :x64_mingw] +- when /postgresql/ +- gem "pg", "~> 1.2.2", :platforms => [:mri, :mingw, :x64_mingw] +- when /sqlite3/ +- gem "sqlite3", "~> 1.4.0", :platforms => [:mri, :mingw, :x64_mingw] +- when /sqlserver/ +- gem "tiny_tds", "~> 2.1.2", :platforms => [:mri, :mingw, :x64_mingw] +- gem "activerecord-sqlserver-adapter", "~> 6.1.0", :platforms => [:mri, :mingw, :x64_mingw] +- else +- warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems") +- end +- end +- else +- warn("No adapter found in config/database.yml, please configure it first") +- end +-else +- warn("Please configure your config/database.yml first") +-end +- +-group :development do +- gem 'listen', '~> 3.3' +- gem "yard" +-end +- +-group :test do +- gem "rails-dom-testing" +- gem 'mocha', (Gem.ruby_version < Gem::Version.new('2.7.0') ? ['>= 1.4.0', '< 2.0.0'] : '>= 1.4.0') +- gem 'simplecov', '~> 0.21.2', :require => false +- gem "ffi", platforms: [:mingw, :x64_mingw, :mswin] +- # For running system tests +- # TODO: Remove version specification once Capybara supports Puma 6 +- gem 'puma', '< 6.0.0' +- gem 'capybara', (Gem.ruby_version < Gem::Version.new('2.6.0') ? '~> 3.35.3' : '~> 3.36.0') +- gem "selenium-webdriver", "~> 3.142.7" +- gem 'webdrivers', '4.6.1', require: false +- # RuboCop +- gem 'rubocop', '~> 1.26.0' +- gem 'rubocop-performance', '~> 1.13.0' +- gem 'rubocop-rails', '~> 2.14.0' +-end +- + local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") + if File.exist?(local_gemfile) + eval_gemfile local_gemfile +@@ -116,4 +45,8 @@ Dir.glob File.expand_path("../plugins/*/{Gemfile,Plugi + # Load plugins' Gemfiles + Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", __FILE__) do |file| + eval_gemfile file ++end ++ ++Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle| ++ self.instance_eval(Bundler.read_file(bundle)) + end diff --git a/www/redmine50/files/pg.rb b/www/redmine50/files/pg.rb new file mode 100644 index 000000000000..3008b2863867 --- /dev/null +++ b/www/redmine50/files/pg.rb @@ -0,0 +1 @@ +gem "pg", "> 1.2.2" diff --git a/www/redmine50/files/redmine.in b/www/redmine50/files/redmine.in new file mode 100644 index 000000000000..9e3c6d276b3c --- /dev/null +++ b/www/redmine50/files/redmine.in @@ -0,0 +1,38 @@ +#!/bin/sh + +# PROVIDE: redmine +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf[.local] to enable redmine +# +# redmine_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable redmine. +# redmine_flags (str): Custom additional arguments to be passed +# to redmine. +# redmine_user (str): User account to run thin with. (default: %%WWWOWN%%) +# redmine_group (str): Group to run thin with. (default: %%WWWGRP%%) + +. /etc/rc.subr + +name="redmine" +rcvar=redmine_enable +command=ruby%%RUBY_SUFFIX%% + +pidfile="%%WWWDIR%%/tmp/pids/thin.pid" + +load_rc_config $name + +# add /usr/local/bin to path +export PATH=$PATH:%%PREFIX%%/bin + +# set defaults +: ${redmine_enable="NO"} +: ${redmine_flags="-a 0.0.0.0 -p 3000 -e production"} +: ${redmine_user="%%WWWOWN%%"} +: ${redmine_group="%%WWWGRP%%"} + +command_args="-d -D -c %%WWWDIR%% -u ${redmine_user} -g ${redmine_group}" +start_cmd="%%PREFIX%%/bin/thin ${command_args} ${redmine_flags} start" + +run_rc_command "$1" diff --git a/www/redmine50/files/thin.rb b/www/redmine50/files/thin.rb new file mode 100644 index 000000000000..40b0486c1de4 --- /dev/null +++ b/www/redmine50/files/thin.rb @@ -0,0 +1 @@ +gem "thin", ">= 1.6.2" diff --git a/www/redmine50/pkg-descr b/www/redmine50/pkg-descr new file mode 100644 index 000000000000..05b0f6fb97a9 --- /dev/null +++ b/www/redmine50/pkg-descr @@ -0,0 +1,21 @@ +Redmine is a flexible project management web application +written using Ruby on Rails framework, it is cross-platform +and cross-database. + +Feature Overview: +* Multiple projects support +* Flexible role based access control +* Flexible issue tracking system +* Gantt chart and calendar +* News, documents & files management +* Feeds & email notifications +* Per project wiki +* Per project forums +* Time tracking +* Custom fields for issues, time-entries, projects and users +* SCM integration (SVN, CVS, Git, Mercurial, Bazaar and Darcs) +* Issue creation via email +* Multiple LDAP authentication support +* User self-registration support +* Multilanguage support +* Multiple databases support diff --git a/www/redmine50/pkg-message b/www/redmine50/pkg-message new file mode 100644 index 000000000000..41fa7641633e --- /dev/null +++ b/www/redmine50/pkg-message @@ -0,0 +1,18 @@ +[ +{ type: install + message: <