Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/redmine/
Date: Mon, 31 Oct 2022 11:50:24
Message-Id: 1667217015.41cd33d1de845eab7962fc9f2a5c38d142712fef.juippis@gentoo
1 commit: 41cd33d1de845eab7962fc9f2a5c38d142712fef
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Sun Jul 17 10:16:25 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 11:50:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41cd33d1
7
8 www-apps/redmine: add 5.0.2
9
10 Closes: https://bugs.gentoo.org/858212
11 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 www-apps/redmine/Manifest | 1 +
15 www-apps/redmine/redmine-5.0.2.ebuild | 258 ++++++++++++++++++++++++++++++++++
16 2 files changed, 259 insertions(+)
17
18 diff --git a/www-apps/redmine/Manifest b/www-apps/redmine/Manifest
19 index c2f6e6741f09..b187c20d30d6 100644
20 --- a/www-apps/redmine/Manifest
21 +++ b/www-apps/redmine/Manifest
22 @@ -1 +1,2 @@
23 DIST redmine-4.2.7.tar.gz 3042676 BLAKE2B 023448a6b1ea20ef0d924def19f661a6d1099f3ab6fe0c887e4e8782773bcc63488075d86f3dc70d8ebf87d44e6b6b242be4a1fb4b5cce5cc361f6f39e99e6d4 SHA512 6654aec3981de8b26de416d253c22c91d881dd7df54192ce41e6e99213c6f4b0947ce213fe484c18117f8701d0528ebb23fe3acf335f84638eeddd972b601be9
24 +DIST redmine-5.0.2.tar.gz 3104135 BLAKE2B abc0f2dfe8f3eacc134172c0d740cc17f269371a90027d87b0329d03fafb1dc17532fc55343dbac9e07e0a195acc67cc133be92eae2b48e0ad9f4afce876afd1 SHA512 aeb0486b2193b0c622f878b67089f9628a59c28bc7a6d3660756dd8047e13b199198d2b7cf42d04c1235f06567e4c4f572d529f964edb862fcd19e2ce7febbdc
25
26 diff --git a/www-apps/redmine/redmine-5.0.2.ebuild b/www-apps/redmine/redmine-5.0.2.ebuild
27 new file mode 100644
28 index 000000000000..8b1b55111a6c
29 --- /dev/null
30 +++ b/www-apps/redmine/redmine-5.0.2.ebuild
31 @@ -0,0 +1,258 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +USE_RUBY="ruby27"
38 +inherit depend.apache ruby-ng
39 +
40 +DESCRIPTION="Flexible project management web application using the Ruby on Rails framework"
41 +HOMEPAGE="https://www.redmine.org/"
42 +SRC_URI="https://www.redmine.org/releases/${P}.tar.gz"
43 +
44 +KEYWORDS="~amd64"
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +IUSE="fastcgi imagemagick ldap markdown +minimagick mysql passenger pdf postgres sqlite"
48 +
49 +ruby_add_bdepend "
50 + fastcgi? ( dev-ruby/fcgi )
51 + ldap? ( >=dev-ruby/ruby-net-ldap-0.17.0 )
52 + minimagick? ( >=dev-ruby/mini_magick-4.11.0 )
53 + markdown? ( >=dev-ruby/redcarpet-3.5.1 )
54 + mysql? ( >=dev-ruby/mysql2-0.5.0:0.5 )
55 + passenger? ( www-apache/passenger )
56 + postgres? ( >=dev-ruby/pg-1.2.2:1 )
57 + sqlite? ( >=dev-ruby/sqlite3-1.4.0 )
58 + dev-ruby/actionpack-xml_parser:2
59 + dev-ruby/addressable
60 + >=dev-ruby/commonmarker-0.23.4
61 + dev-ruby/csv:3
62 + >=dev-ruby/deckar01-task_list-2.3.2
63 + >=dev-ruby/html-pipeline-2.13.2
64 + >=dev-ruby/i18n-1.10.0:1
65 + >=dev-ruby/mail-2.7.1
66 + dev-ruby/marcel
67 + >=dev-ruby/mini_mime-1.1.0
68 + >=dev-ruby/net-imap-0.2.2
69 + >=dev-ruby/net-pop-0.1.1
70 + >=dev-ruby/net-smtp-0.3.0
71 + >=dev-ruby/nokogiri-1.13.0
72 + >=dev-ruby/rails-6.1.6:6.1
73 + >=dev-ruby/rbpdf-1.20.0
74 + >=dev-ruby/request_store-1.5.0:0
75 + dev-ruby/rexml
76 + >=dev-ruby/roadie-rails-3.0.0:3
77 + >=dev-ruby/rotp-5.0.0
78 + >=dev-ruby/rouge-3.28.0
79 + dev-ruby/rqrcode
80 + >=dev-ruby/rubyzip-2.3.0:2
81 + >=dev-ruby/sanitize-6.0:6
82 +"
83 +
84 +RDEPEND="
85 + acct-group/redmine
86 + acct-user/redmine
87 + imagemagick? ( media-gfx/imagemagick )
88 + pdf? (
89 + app-text/ghostscript-gpl
90 + media-gfx/imagemagick
91 + )
92 +"
93 +
94 +PATCHES=(
95 + "${FILESDIR}/redmine-4.2.7-rails-yaml-safe_load.patch"
96 +)
97 +
98 +REDMINE_DIR="/var/lib/${PN}"
99 +
100 +all_ruby_prepare() {
101 + rm -fr log files/delete.me .github || die
102 +
103 + # bug #406605
104 + rm .{git,hg}ignore || die
105 +
106 + # newenvd not working here
107 + cat > "${T}/50${PN}" <<-EOF || die
108 + CONFIG_PROTECT="${EROOT}/${REDMINE_DIR}/config"
109 + CONFIG_PROTECT_MASK="${EROOT}/${REDMINE_DIR}/config/locales ${EROOT}/${REDMINE_DIR}/config/settings.yml"
110 + EOF
111 +
112 + # Fixing versions in Gemfile
113 + sed -i -e "s/~>/>=/g" Gemfile || die
114 +
115 + # bug #724464
116 + sed -i -e "s/gem 'rails',.*/gem 'rails', '~>6.1.6'/" Gemfile || die
117 +
118 + # Commonmark
119 + sed -i -e "s/'0.23.4'/'>=0.23.4'/" -e "s/'2.3.2'/'>=2.3.2'/" Gemfile
120 +
121 + sed -i -e "/group :development do/,/end$/d" Gemfile || die
122 + sed -i -e "/group :test do/,/end$/d" Gemfile || die
123 +
124 + if ! use imagemagick ; then
125 + sed -i -e "/group :minimagick do/,/end$/d" Gemfile || die
126 + fi
127 + if ! use ldap ; then
128 + # remove ldap stuff module if disabled to avoid #413779
129 + use ldap || rm app/models/auth_source_ldap.rb || die
130 + sed -i -e "/group :ldap do/,/end$/d" Gemfile || die
131 + fi
132 + if ! use markdown ; then
133 + sed -i -e "/group :markdown do/,/end$/d" Gemfile || die
134 + fi
135 + # Additional dependency for Gemfile (#657156)
136 + if use fastcgi; then
137 + echo "gem 'fcgi'" > Gemfile.local
138 + fi
139 +}
140 +
141 +all_ruby_install() {
142 + dodoc doc/* README.rdoc
143 + rm -r doc test appveyor.yml CONTRIBUTING.md README.rdoc || die
144 +
145 + keepdir /var/log/${PN}
146 +
147 + insinto "${REDMINE_DIR}"
148 + doins -r .
149 + insinto "${REDMINE_DIR}/config"
150 + doins "${FILESDIR}/additional_environment.rb"
151 + keepdir "${REDMINE_DIR}"/{app/views/previews,files,public/plugin_assets,vendor}
152 + keepdir "${REDMINE_DIR}"/tmp/{cache,imports,sessions,sockets}
153 +
154 + fowners -R redmine:redmine \
155 + "${REDMINE_DIR}/config.ru" \
156 + "${REDMINE_DIR}/config" \
157 + "${REDMINE_DIR}/files" \
158 + "${REDMINE_DIR}/public/plugin_assets" \
159 + "${REDMINE_DIR}/tmp" \
160 + /var/log/${PN}
161 +
162 + fowners redmine:redmine "${REDMINE_DIR}"
163 +
164 + # protect sensitive data, see bug #406605
165 + fperms -R go-rwx \
166 + "${REDMINE_DIR}/config" \
167 + "${REDMINE_DIR}/files" \
168 + "${REDMINE_DIR}/tmp" \
169 + /var/log/${PN}
170 +
171 + if use passenger; then
172 + has_apache
173 + insinto "${APACHE_VHOSTS_CONFDIR}"
174 + doins "${FILESDIR}/10_redmine_vhost.conf"
175 + fi
176 +
177 + # logrotate
178 + insinto /etc/logrotate.d
179 + newins "${FILESDIR}"/redmine.logrotate redmine
180 +
181 + newconfd "${FILESDIR}/${PN}.confd" ${PN}
182 + newinitd "${FILESDIR}/${PN}-3.initd" ${PN}
183 + doenvd "${T}/50${PN}"
184 +}
185 +
186 +pkg_postinst() {
187 + if [[ -e "${EROOT}${REDMINE_DIR}/config/initializers/session_store.rb" \
188 + || -e "${EROOT}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]
189 + then
190 + elog "Execute the following command to upgrade environment:"
191 + elog
192 + elog "# emerge --config \"=${CATEGORY}/${PF}\""
193 + elog
194 + elog "For upgrade instructions take a look at:"
195 + elog "http://www.redmine.org/wiki/redmine/RedmineUpgrade"
196 + else
197 + elog "Execute the following command to initialize environment:"
198 + elog
199 + elog "# cd ${EROOT}${REDMINE_DIR}"
200 + elog "# cp config/database.yml.example config/database.yml"
201 + elog "# \${EDITOR} config/database.yml"
202 + elog "# chown redmine:redmine config/database.yml"
203 + elog "# emerge --config \"=${CATEGORY}/${PF}\""
204 + elog
205 + elog "Installation notes are at official site"
206 + elog "http://www.redmine.org/wiki/redmine/RedmineInstall"
207 + fi
208 +
209 + elog
210 + elog "OpenID support was removed in Redmine 5.0. If you are using OpenID"
211 + elog "authentication, you should switch back to Redmine 4.2 or install and"
212 + elog "enable an OpenID plugin. See https://redmine.org/issues/35755."
213 + elog
214 +}
215 +
216 +pkg_config() {
217 + # Remove old lock file
218 + rm -f "${EROOT}${REDMINE_DIR}/Gemfile.lock"
219 +
220 + if [[ ! -e "${EROOT}${REDMINE_DIR}/config/database.yml" ]]; then
221 + eerror "Copy ${EROOT}${REDMINE_DIR}/config/database.yml.example to"
222 + eerror "${EROOT}${REDMINE_DIR}/config/database.yml then edit this"
223 + eerror "file in order to configure your database settings for"
224 + eerror "\"production\" environment."
225 + die
226 + fi
227 +
228 + local RAILS_ENV=${RAILS_ENV:-production}
229 + if [[ ! -L /usr/bin/ruby ]]; then
230 + eerror "/usr/bin/ruby is not a valid symlink to any ruby implementation."
231 + eerror "Please update it via `eselect ruby`"
232 + die
233 + fi
234 + if [[ $RUBY_TARGETS != *$( eselect ruby show | awk 'NR==2' | tr -d ' ' )* ]]
235 + then
236 + eerror "/usr/bin/ruby is currently not included in redmine's ruby targets:"
237 + eerror "${RUBY_TARGETS}."
238 + eerror "Please update it via `eselect ruby`"
239 + die
240 + fi
241 + local RUBY=${RUBY:-ruby}
242 +
243 + cd "${EROOT}${REDMINE_DIR}" || die
244 + if [[ -e "${EROOT}${REDMINE_DIR}/config/initializers/session_store.rb" ]]
245 + then
246 + einfo
247 + einfo "Generating secret token."
248 + einfo
249 + rm config/initializers/session_store.rb || die
250 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die
251 + fi
252 + if [[ -e "${EROOT}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]
253 + then
254 + einfo
255 + einfo "Upgrading database."
256 + einfo
257 +
258 + einfo "Generating secret token."
259 + # Migration from Redmine 2.x
260 + rm config/initializers/secret_token.rb || die
261 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die
262 +
263 + einfo "Migrating database."
264 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
265 + einfo "Upgrading the plugin migrations."
266 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:plugins:migrate || die
267 + einfo "Clear the cache."
268 + ${RUBY} -S rake tmp:cache:clear || die
269 + else
270 + einfo
271 + einfo "Initializing database."
272 + einfo
273 +
274 + einfo "Generating a session store secret."
275 + ${RUBY} -S rake generate_secret_token || die
276 + einfo "Creating the database structure."
277 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
278 + einfo "Populating database with default configuration data."
279 + RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die
280 + chown redmine:redmine -R "${EROOT}/var/log/redmine/" || die
281 + einfo
282 + einfo "If you use sqlite3, please do not forget to change the ownership"
283 + einfo "of the sqlite files."
284 + einfo
285 + einfo "# cd \"${EROOT}${REDMINE_DIR}\""
286 + einfo "# chown redmine:redmine db/ db/*.sqlite3"
287 + einfo
288 + fi
289 +}