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