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