1 |
commit: 2bc877fbfd8ccad198fce3c2a0cdea16decdf94f |
2 |
Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Sep 28 08:44:59 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 28 20:51:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bc877fb |
7 |
|
8 |
www-apps/redmine: update to 4.1.4 |
9 |
|
10 |
Fixes security issues CVE-2021-31866, CVE-2021-31865, CVE-2021-31864, |
11 |
CVE-2021-31863 |
12 |
|
13 |
Bug: https://bugs.gentoo.org/786561 |
14 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
15 |
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com> |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
www-apps/redmine/Manifest | 1 + |
19 |
www-apps/redmine/redmine-4.1.4.ebuild | 233 ++++++++++++++++++++++++++++++++++ |
20 |
2 files changed, 234 insertions(+) |
21 |
|
22 |
diff --git a/www-apps/redmine/Manifest b/www-apps/redmine/Manifest |
23 |
index bc2967a7818..0cf7b4d475a 100644 |
24 |
--- a/www-apps/redmine/Manifest |
25 |
+++ b/www-apps/redmine/Manifest |
26 |
@@ -1 +1,2 @@ |
27 |
DIST redmine-4.1.2.tar.gz 2719030 BLAKE2B a169d024a76dc0b592a71da55e785152ba1cdb2203a864cff905571f1eae350d77e6955d819c660379e3e7b539664bf77a21f0f91ed5c4299f173221e763859c SHA512 a7ed547e8907d98c16c9d7c775fa3fcdb322d3e4494a1e5467cbc37c9710f04b9d5121fbdd9d8444b2028f7c8a842237ccc9d1b62c066c26bdc150cf408afb3b |
28 |
+DIST redmine-4.1.4.tar.gz 2720709 BLAKE2B 9e0c2b990248c9000fd6062e3928bf4bc8e8043e0d9ceff13d5000da824cde027090121ce3a8be2f5d92eedb97b91629fb8b681ae5e380459fdb97904abd9b98 SHA512 93e46f2ed220c05b83b7bab34327891a7f05a46a01c6cbfc1a5c9bf18613e308d94d84fc3158a8bb7af740b8792448d935bc9d29795ee341bca577c82ac0619b |
29 |
|
30 |
diff --git a/www-apps/redmine/redmine-4.1.4.ebuild b/www-apps/redmine/redmine-4.1.4.ebuild |
31 |
new file mode 100644 |
32 |
index 00000000000..f331ffe6d23 |
33 |
--- /dev/null |
34 |
+++ b/www-apps/redmine/redmine-4.1.4.ebuild |
35 |
@@ -0,0 +1,233 @@ |
36 |
+# Copyright 1999-2021 Gentoo Authors |
37 |
+# Distributed under the terms of the GNU General Public License v2 |
38 |
+ |
39 |
+EAPI=7 |
40 |
+ |
41 |
+USE_RUBY="ruby26" |
42 |
+inherit depend.apache ruby-ng |
43 |
+ |
44 |
+DESCRIPTION="Flexible project management web application using the Ruby on Rails framework" |
45 |
+HOMEPAGE="https://www.redmine.org/" |
46 |
+SRC_URI="https://www.redmine.org/releases/${P}.tar.gz" |
47 |
+ |
48 |
+KEYWORDS="~amd64" |
49 |
+LICENSE="GPL-2" |
50 |
+SLOT="0" |
51 |
+IUSE="imagemagick fastcgi ldap markdown mysql passenger postgres sqlite" |
52 |
+ |
53 |
+DEPS=" |
54 |
+ fastcgi? ( dev-ruby/fcgi ) |
55 |
+ imagemagick? ( dev-ruby/mini_magick ) |
56 |
+ ldap? ( dev-ruby/ruby-net-ldap ) |
57 |
+ markdown? ( >=dev-ruby/redcarpet-3.5.1 ) |
58 |
+ mysql? ( >=dev-ruby/mysql2-0.5.0:0.5 ) |
59 |
+ passenger? ( www-apache/passenger ) |
60 |
+ postgres? ( >=dev-ruby/pg-1.1.4:1 ) |
61 |
+ sqlite? ( >=dev-ruby/sqlite3-1.4.0 ) |
62 |
+ dev-ruby/actionpack-xml_parser:2 |
63 |
+ dev-ruby/csv:3 |
64 |
+ >=dev-ruby/i18n-1.6.0:1 |
65 |
+ >=dev-ruby/mail-2.7.1 |
66 |
+ dev-ruby/marcel |
67 |
+ dev-ruby/mimemagic |
68 |
+ >=dev-ruby/mini_mime-1.0.1 |
69 |
+ >=dev-ruby/nokogiri-1.11.1 |
70 |
+ dev-ruby/rails:5.2 |
71 |
+ >=dev-ruby/rbpdf-1.20.0 |
72 |
+ dev-ruby/request_store:0 |
73 |
+ >=dev-ruby/roadie-rails-2.1.0 |
74 |
+ >=dev-ruby/rouge-3.12.0 |
75 |
+ >=dev-ruby/ruby-openid-2.9.2 |
76 |
+ dev-ruby/rack-openid |
77 |
+" |
78 |
+ |
79 |
+ruby_add_bdepend "${DEPS}" |
80 |
+ |
81 |
+RDEPEND=" |
82 |
+ acct-group/redmine |
83 |
+ acct-user/redmine |
84 |
+" |
85 |
+ |
86 |
+REDMINE_DIR="/var/lib/${PN}" |
87 |
+ |
88 |
+all_ruby_prepare() { |
89 |
+ rm -fr log files/delete.me .github || die |
90 |
+ |
91 |
+ # bug #406605 |
92 |
+ rm .{git,hg}ignore || die |
93 |
+ |
94 |
+ # newenvd not working here |
95 |
+ cat > "${T}/50${PN}" <<-EOF || die |
96 |
+ CONFIG_PROTECT="${EROOT}/${REDMINE_DIR}/config" |
97 |
+ CONFIG_PROTECT_MASK="${EROOT}/${REDMINE_DIR}/config/locales ${EROOT}/${REDMINE_DIR}/config/settings.yml" |
98 |
+ EOF |
99 |
+ |
100 |
+ # Fixing versions in Gemfile |
101 |
+ sed -i -e "s/~>/>=/g" Gemfile || die |
102 |
+ |
103 |
+ # bug #724464 |
104 |
+ sed -i -e "s/gem 'rails',.*/gem 'rails', '~>5.2.6'/" Gemfile || die |
105 |
+ |
106 |
+ sed -i -e "/group :development do/,/end$/d" Gemfile || die |
107 |
+ sed -i -e "/group :test do/,/end$/d" Gemfile || die |
108 |
+ |
109 |
+ if ! use imagemagick ; then |
110 |
+ sed -i -e "/group :minimagick do/,/end$/d" Gemfile || die |
111 |
+ fi |
112 |
+ if ! use ldap ; then |
113 |
+ # remove ldap stuff module if disabled to avoid #413779 |
114 |
+ use ldap || rm app/models/auth_source_ldap.rb || die |
115 |
+ sed -i -e "/group :ldap do/,/end$/d" Gemfile || die |
116 |
+ fi |
117 |
+ if ! use markdown ; then |
118 |
+ sed -i -e "/group :markdown do/,/end$/d" Gemfile || die |
119 |
+ fi |
120 |
+ # Additional dependency for Gemfile (#657156) |
121 |
+ if use fastcgi; then |
122 |
+ echo "gem 'fcgi'" > Gemfile.local |
123 |
+ fi |
124 |
+} |
125 |
+ |
126 |
+all_ruby_install() { |
127 |
+ dodoc doc/* README.rdoc |
128 |
+ rm -r doc test appveyor.yml CONTRIBUTING.md README.rdoc || die |
129 |
+ |
130 |
+ keepdir /var/log/${PN} |
131 |
+ |
132 |
+ insinto "${REDMINE_DIR}" |
133 |
+ doins -r . |
134 |
+ insinto "${REDMINE_DIR}/config" |
135 |
+ doins "${FILESDIR}/additional_environment.rb" |
136 |
+ keepdir "${REDMINE_DIR}"/{app/views/previews,files,public/plugin_assets,vendor} |
137 |
+ keepdir "${REDMINE_DIR}"/tmp/{cache,imports,sessions,sockets} |
138 |
+ |
139 |
+ fowners -R redmine:redmine \ |
140 |
+ "${REDMINE_DIR}/config.ru" \ |
141 |
+ "${REDMINE_DIR}/config" \ |
142 |
+ "${REDMINE_DIR}/files" \ |
143 |
+ "${REDMINE_DIR}/public/plugin_assets" \ |
144 |
+ "${REDMINE_DIR}/tmp" \ |
145 |
+ /var/log/${PN} |
146 |
+ |
147 |
+ fowners redmine:redmine "${REDMINE_DIR}" |
148 |
+ |
149 |
+ # protect sensitive data, see bug #406605 |
150 |
+ fperms -R go-rwx \ |
151 |
+ "${REDMINE_DIR}/config" \ |
152 |
+ "${REDMINE_DIR}/files" \ |
153 |
+ "${REDMINE_DIR}/tmp" \ |
154 |
+ /var/log/${PN} |
155 |
+ |
156 |
+ if use passenger; then |
157 |
+ has_apache |
158 |
+ insinto "${APACHE_VHOSTS_CONFDIR}" |
159 |
+ doins "${FILESDIR}/10_redmine_vhost.conf" |
160 |
+ fi |
161 |
+ |
162 |
+ # logrotate |
163 |
+ insinto /etc/logrotate.d |
164 |
+ newins "${FILESDIR}"/redmine.logrotate redmine |
165 |
+ |
166 |
+ newconfd "${FILESDIR}/${PN}.confd" ${PN} |
167 |
+ newinitd "${FILESDIR}/${PN}-3.initd" ${PN} |
168 |
+ doenvd "${T}/50${PN}" |
169 |
+} |
170 |
+ |
171 |
+pkg_postinst() { |
172 |
+ if [[ -e "${EROOT}/${REDMINE_DIR}/config/initializers/session_store.rb" \ |
173 |
+ || -e "${EROOT}/${REDMINE_DIR}/config/initializers/secret_token.rb" ]] |
174 |
+ then |
175 |
+ elog "Execute the following command to upgrade environment:" |
176 |
+ elog |
177 |
+ elog "# emerge --config \"=${CATEGORY}/${PF}\"" |
178 |
+ elog |
179 |
+ elog "For upgrade instructions take a look at:" |
180 |
+ elog "http://www.redmine.org/wiki/redmine/RedmineUpgrade" |
181 |
+ else |
182 |
+ elog "Execute the following command to initialize environment:" |
183 |
+ elog |
184 |
+ elog "# cd ${EROOT}/${REDMINE_DIR}" |
185 |
+ elog "# cp config/database.yml.example config/database.yml" |
186 |
+ elog "# \${EDITOR} config/database.yml" |
187 |
+ elog "# chown redmine:redmine config/database.yml" |
188 |
+ elog "# emerge --config \"=${CATEGORY}/${PF}\"" |
189 |
+ elog |
190 |
+ elog "Installation notes are at official site" |
191 |
+ elog "http://www.redmine.org/wiki/redmine/RedmineInstall" |
192 |
+ fi |
193 |
+} |
194 |
+ |
195 |
+pkg_config() { |
196 |
+ # Remove old lock file |
197 |
+ rm -f "${EROOT}/${REDMINE_DIR}/Gemfile.lock" |
198 |
+ |
199 |
+ if [[ ! -e "${EROOT}/${REDMINE_DIR}/config/database.yml" ]]; then |
200 |
+ eerror "Copy ${EROOT}/${REDMINE_DIR}/config/database.yml.example to" |
201 |
+ eerror "${EROOT}/${REDMINE_DIR}/config/database.yml then edit this" |
202 |
+ eerror "file in order to configure your database settings for" |
203 |
+ eerror "\"production\" environment." |
204 |
+ die |
205 |
+ fi |
206 |
+ |
207 |
+ local RAILS_ENV=${RAILS_ENV:-production} |
208 |
+ if [[ ! -L /usr/bin/ruby ]]; then |
209 |
+ eerror "/usr/bin/ruby is not a valid symlink to any ruby implementation." |
210 |
+ eerror "Please update it via `eselect ruby`" |
211 |
+ die |
212 |
+ fi |
213 |
+ if [[ $RUBY_TARGETS != *$( eselect ruby show | awk 'NR==2' | tr -d ' ' )* ]] |
214 |
+ then |
215 |
+ eerror "/usr/bin/ruby is currently not included in redmine's ruby targets:" |
216 |
+ eerror "${RUBY_TARGETS}." |
217 |
+ eerror "Please update it via `eselect ruby`" |
218 |
+ die |
219 |
+ fi |
220 |
+ local RUBY=${RUBY:-ruby} |
221 |
+ |
222 |
+ cd "${EROOT}/${REDMINE_DIR}" || die |
223 |
+ if [[ -e "${EROOT}/${REDMINE_DIR}/config/initializers/session_store.rb" ]] |
224 |
+ then |
225 |
+ einfo |
226 |
+ einfo "Generating secret token." |
227 |
+ einfo |
228 |
+ rm config/initializers/session_store.rb || die |
229 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die |
230 |
+ fi |
231 |
+ if [[ -e "${EROOT}/${REDMINE_DIR}/config/initializers/secret_token.rb" ]] |
232 |
+ then |
233 |
+ einfo |
234 |
+ einfo "Upgrading database." |
235 |
+ einfo |
236 |
+ |
237 |
+ einfo "Generating secret token." |
238 |
+ # Migration from Redmine 2.x |
239 |
+ rm config/initializers/secret_token.rb || die |
240 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die |
241 |
+ |
242 |
+ einfo "Migrating database." |
243 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die |
244 |
+ einfo "Upgrading the plugin migrations." |
245 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:plugins:migrate || die |
246 |
+ einfo "Clear the cache." |
247 |
+ ${RUBY} -S rake tmp:cache:clear || die |
248 |
+ else |
249 |
+ einfo |
250 |
+ einfo "Initializing database." |
251 |
+ einfo |
252 |
+ |
253 |
+ einfo "Generating a session store secret." |
254 |
+ ${RUBY} -S rake generate_secret_token || die |
255 |
+ einfo "Creating the database structure." |
256 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die |
257 |
+ einfo "Populating database with default configuration data." |
258 |
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die |
259 |
+ chown redmine:redmine -R "${EROOT}//var/log/redmine/" || die |
260 |
+ einfo |
261 |
+ einfo "If you use sqlite3, please do not forget to change the ownership" |
262 |
+ einfo "of the sqlite files." |
263 |
+ einfo |
264 |
+ einfo "# cd \"${EROOT}/${REDMINE_DIR}\"" |
265 |
+ einfo "# chown redmine:redmine db/ db/*.sqlite3" |
266 |
+ einfo |
267 |
+ fi |
268 |
+} |