chiliproj/chiliproj.spec

changeset 764
b3f4be54aeb4
child 765
5be956b2db74
equal deleted inserted replaced
-1:000000000000 0:6ecad3d0d1cd
1 ##
2 ## chiliproj.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2013 Michael Schloh von Bennewitz <michael@schloh.com>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
23
24 # FIXME: GEM_HOME=$HOME/.gem RAILS_ENV=production PATH=$PATH:%{l_prefix}/lib/ruby/gems/1.9.1/bin bundle install --without test development mysql postgres rmagick
25 # FIXME: bundle exec rails s
26 # FIXME: w3m http://localhost:3000/
27 # FIXME: log in with Login: admin and Password: admin
28
29 # package version
30 %define V_pref 427
31 %define V_rake 10.0.4
32 %define V_activesupport 2.3.18
33 %define V_rack 1.1.6
34 %define V_actionpack 2.3.18
35 %define V_actionmailer 2.3.18
36 %define V_activerecord 2.3.18
37 %define V_activeresource 2.3.18
38 %define V_rails 2.3.18
39 %define V_actsastaggable 2.1.0
40 %define V_coderay 1.0.9
41 %define V_daemons 1.1.9
42 %define V_eventmachine 1.0.3
43 %define V_gravatarify 3.0.0
44 %define V_i18n 0.4.2
45 %define V_json 1.7.7
46 %define V_liquid 2.3.0
47 %define V_mysql2 0.2.18
48 %define V_netldap 0.3.1
49 %define V_rdoc 4.0.1
50 %define V_rubyopenid 2.1.8
51 %define V_rubytree 0.5.3
52 %define V_sqlite3 1.3.7
53 %define V_thin 1.5.1
54 %define V_tzinfo 0.3.37
55 %define V_bundler 1.3.4
56
57 # package information
58 Name: chiliproj
59 Summary: Comprehensive Rails-based Project Manager
60 URL: http://www.chiliproject.org/
61 Vendor: Felix Schaefer et al.
62 Packager: Michael Schloh von Bennewitz
63 Distribution: Europalab Networks Production
64 Class: EVAL
65 Group: Calendar
66 License: GPL
67 Version: 20130328
68 Release: 20120800
69
70 # list of sources
71 Source0: http://www.chiliproject.org/attachments/download/%{V_pref}/chiliproject-%{version}.tar.bz2
72 Source1: rc.chiliproj
73 Source2: Gemfile.lock
74 Source3: http://rubygems.org/downloads/rake-%{V_rake}.gem
75 Source4: http://rubygems.org/downloads/activesupport-%{V_activesupport}.gem
76 Source5: http://rubygems.org/downloads/rack-%{V_rack}.gem
77 Source6: http://rubygems.org/downloads/actionpack-%{V_actionpack}.gem
78 Source7: http://rubygems.org/downloads/actionmailer-%{V_actionmailer}.gem
79 Source8: http://rubygems.org/downloads/activerecord-%{V_activerecord}.gem
80 Source9: http://rubygems.org/downloads/activeresource-%{V_activeresource}.gem
81 Source10: http://rubygems.org/downloads/rails-%{V_rails}.gem
82 Source11: http://rubygems.org/downloads/acts-as-taggable-on-%{V_actsastaggable}.gem
83 Source12: http://rubygems.org/downloads/coderay-%{V_coderay}.gem
84 Source13: http://rubygems.org/downloads/daemons-%{V_daemons}.gem
85 Source14: http://rubygems.org/downloads/eventmachine-%{V_eventmachine}.gem
86 Source15: http://rubygems.org/downloads/gravatarify-%{V_gravatarify}.gem
87 Source16: http://rubygems.org/downloads/i18n-%{V_i18n}.gem
88 Source17: http://rubygems.org/downloads/json-%{V_json}.gem
89 Source18: http://rubygems.org/downloads/liquid-%{V_liquid}.gem
90 Source19: http://rubygems.org/downloads/mysql2-%{V_mysql2}.gem
91 Source20: http://rubygems.org/downloads/net-ldap-%{V_netldap}.gem
92 Source21: http://rubygems.org/downloads/rdoc-%{V_rdoc}.gem
93 Source22: http://rubygems.org/downloads/ruby-openid-%{V_rubyopenid}.gem
94 Source23: http://rubygems.org/downloads/rubytree-%{V_rubytree}.gem
95 Source24: http://rubygems.org/downloads/sqlite3-%{V_sqlite3}.gem
96 Source25: http://rubygems.org/downloads/thin-%{V_thin}.gem
97 Source26: http://rubygems.org/downloads/tzinfo-%{V_tzinfo}.gem
98 Source27: http://rubygems.org/downloads/bundler-%{V_bundler}.gem
99
100 # build information
101 BuildPreReq: OpenPKG, openpkg >= 20100101, ruby < 2.0.0, ruby-rails, ruby-thin
102 PreReq: OpenPKG, openpkg >= 20100101, ruby < 2.0.0, ruby-rails, ruby-thin
103
104 %description
105 ChiliProject is a web based project management system. It supports
106 your team throughout the complete project life cycle, from setting
107 up and discussing a project plan, over tracking issues and reporting
108 work progress to collaboratively sharing knowledge.
109
110 %track
111 prog chiliproj:chiliproj = {
112 version = %{version}
113 url = http://www.chiliproject.org/attachments/download/
114 regex = (\d+)
115 url = http://www.chiliproject.org/attachments/download/__NEWVER__/
116 regex = chiliproject-(__VER__)\.tar.bz2
117 }
118 prog chiliproj:rake = {
119 version = %{V_rake}
120 url = http://rubygems.org/gems/rake
121 regex = rake-(__VER__)\.gem
122 }
123 prog chiliproj:activesupport = {
124 version = %{V_activesupport}
125 url = http://rubygems.org/gems/activesupport
126 regex = activesupport-(__VER__)\.gem
127 }
128 prog chiliproj:rack = {
129 version = %{V_rack}
130 url = http://rubygems.org/gems/rack
131 regex = rack-(__VER__)\.gem
132 }
133 prog chiliproj:actionpack = {
134 version = %{V_actionpack}
135 url = http://rubygems.org/gems/actionpack
136 regex = actionpack-(__VER__)\.gem
137 }
138 prog chiliproj:actionmailer = {
139 version = %{V_actionmailer}
140 url = http://rubygems.org/gems/actionmailer
141 regex = actionmailer-(__VER__)\.gem
142 }
143 prog chiliproj:activerecord = {
144 version = %{V_activerecord}
145 url = http://rubygems.org/gems/activerecord
146 regex = activerecord-(__VER__)\.gem
147 }
148 prog chiliproj:activeresource = {
149 version = %{V_activeresource}
150 url = http://rubygems.org/gems/activeresource
151 regex = activeresource-(__VER__)\.gem
152 }
153 prog chiliproj:rails = {
154 version = %{V_rails}
155 url = http://rubygems.org/gems/rails
156 regex = rails-(__VER__)\.gem
157 }
158 prog chiliproj:actsastaggable = {
159 version = %{V_actsastaggable}
160 url = http://rubygems.org/gems/acts-as-taggable-on
161 regex = acts-as-taggable-on-(__VER__)\.gem
162 }
163 prog chiliproj:coderay = {
164 version = %{V_coderay}
165 url = http://rubygems.org/gems/coderay
166 regex = coderay-(__VER__)\.gem
167 }
168 prog chiliproj:daemons = {
169 version = %{V_daemons}
170 url = http://rubygems.org/gems/daemons
171 regex = daemons-(__VER__)\.gem
172 }
173 prog chiliproj:eventmachine = {
174 version = %{V_eventmachine}
175 url = http://rubygems.org/gems/eventmachine
176 regex = eventmachine-(__VER__)\.gem
177 }
178 prog chiliproj:gravatarify = {
179 version = %{V_gravatarify}
180 url = http://rubygems.org/gems/gravatarify
181 regex = gravatarify-(__VER__)\.gem
182 }
183 prog chiliproj:i18n = {
184 version = %{V_i18n}
185 url = http://rubygems.org/gems/i18n
186 regex = i18n-(__VER__)\.gem
187 }
188 prog chiliproj:json = {
189 version = %{V_json}
190 url = http://rubygems.org/gems/json
191 regex = json-(__VER__)\.gem
192 }
193 prog chiliproj:liquid = {
194 version = %{V_liquid}
195 url = http://rubygems.org/gems/liquid
196 regex = liquid-(__VER__)\.gem
197 }
198 prog chiliproj:mysql2 = {
199 version = %{V_mysql2}
200 url = http://rubygems.org/gems/mysql2
201 regex = mysql2-(__VER__)\.gem
202 }
203 prog chiliproj:netldap = {
204 version = %{V_netldap}
205 url = http://rubygems.org/gems/net-ldap
206 regex = net-ldap-(__VER__)\.gem
207 }
208 prog chiliproj:rdoc = {
209 version = %{V_rdoc}
210 url = http://rubygems.org/gems/rdoc
211 regex = rdoc-(__VER__)\.gem
212 }
213 prog chiliproj:rubyopenid = {
214 version = %{V_rubyopenid}
215 url = http://rubygems.org/gems/ruby-openid
216 regex = ruby-openid-(__VER__)\.gem
217 }
218 prog chiliproj:rubytree = {
219 version = %{V_rubytree}
220 url = http://rubygems.org/gems/rubytree
221 regex = rubytree-(__VER__)\.gem
222 }
223 prog chiliproj:sqlite3 = {
224 version = %{V_sqlite3}
225 url = http://rubygems.org/gems/sqlite3
226 regex = sqlite3-(__VER__)\.gem
227 }
228 prog chiliproj:thin = {
229 version = %{V_thin}
230 url = http://rubygems.org/gems/thin
231 regex = thin-(__VER__)\.gem
232 }
233 prog chiliproj:tzinfo = {
234 version = %{V_tzinfo}
235 url = http://rubygems.org/gems/tzinfo
236 regex = tzinfo-(__VER__)\.gem
237 }
238 prog chiliproj:bundler = {
239 version = %{V_bundler}
240 url = http://rubygems.org/gems/bundler
241 regex = bundler-(__VER__)\.gem
242 }
243
244 %prep
245 %setup -q -n chiliproject-%{version}
246 %{l_shtool} subst \
247 -e 's;# \(ENV\[.RAILS_ENV.\] ||= .production.\);\1;' \
248 config/environment.rb
249
250 %build
251
252 %install
253 RUBY_VERSION=`%{l_prefix}/bin/gem which rubygems | sed -e 's;.*/\([^/]*\)/rubygems\.rb$;\1;'`
254 export GEM_HOME=$RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION
255 %{l_shtool} mkdir -f -p -m 755 $GEM_HOME
256 %{l_shtool} mkdir -f -p public/plugin_assets
257 %{l_tar} cf - . | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj
258 %{l_prefix}/bin/gem install --local %{SOURCE3}
259 %{l_prefix}/bin/gem install --local %{SOURCE4}
260 %{l_prefix}/bin/gem install --local %{SOURCE5}
261 %{l_prefix}/bin/gem install --local %{SOURCE6}
262 %{l_prefix}/bin/gem install --local %{SOURCE7}
263 %{l_prefix}/bin/gem install --local %{SOURCE8}
264 %{l_prefix}/bin/gem install --local %{SOURCE9}
265 %{l_prefix}/bin/gem install --local %{SOURCE10}
266 %{l_prefix}/bin/gem install --local %{SOURCE11}
267 %{l_prefix}/bin/gem install --local %{SOURCE12}
268 %{l_prefix}/bin/gem install --local %{SOURCE13}
269 %{l_prefix}/bin/gem install --local %{SOURCE14}
270 %{l_prefix}/bin/gem install --local %{SOURCE15}
271 %{l_prefix}/bin/gem install --local %{SOURCE16}
272 %{l_prefix}/bin/gem install --local %{SOURCE17}
273 %{l_prefix}/bin/gem install --local %{SOURCE18}
274 %{l_prefix}/bin/gem install --local %{SOURCE19}
275 %{l_prefix}/bin/gem install --local %{SOURCE20}
276 %{l_prefix}/bin/gem install --local %{SOURCE21}
277 %{l_prefix}/bin/gem install --local %{SOURCE22}
278 %{l_prefix}/bin/gem install --local %{SOURCE23}
279 %{l_prefix}/bin/gem install --local %{SOURCE24}
280 %{l_prefix}/bin/gem install --local %{SOURCE25}
281 %{l_prefix}/bin/gem install --local %{SOURCE27}
282
283 # install configuration
284 ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj
285 %{l_shtool} mkdir -f -p -m 755 .bundle
286 cp %{SOURCE Gemfile.lock} .
287 echo 'gem "thin"' >>Gemfile
288 cp config/configuration.yml.example config/configuration.yml
289 cp config/additional_environment.rb.example config/additional_environment.rb
290 echo "ENV['GEM_PATH'] = '%{l_prefix}/lib/ruby/gems/$RUBY_VERSION:%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION'" >>config/additional_environment.rb
291 #echo 'config.action_controller.session = { :key => "_chiliproject_session", :secret => "54bbf51a99cbce2a8881af4fa0fa23895e071f8c8c4773e76b09388135bd9d3671534bf4db20c9f3" }' >>config/additional_environment.rb
292 cat >config/database.yml <<EOF
293 production:
294 adapter: sqlite3
295 database: db/prod.sqlite
296 EOF
297 # try this block with ---
298 cat >.bundle/config <<EOF
299 ---
300 BUNDLE_WITHOUT: test:de:development:postgres:mysql:rmagick
301 EOF
302 ) || exit $?
303
304 # install run command script
305 %{l_shtool} mkdir -f -p -m 755 \
306 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
307 %{l_shtool} install -c -m 755 %{l_value -s -a} \
308 -e 's;@l_gempath@;$RPM_BUILD_ROOT%{l_prefix}/lib/ruby/gems/$RUBY_VERSION;g' \
309 %{SOURCE rc.chiliproj} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
310
311 # clean up white spaces
312 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION/gems/rdoc-*/test
313
314 # problem with typical name 'files', existing in this case
315 %{l_rpmtool} files -v -oaltfiles -r$RPM_BUILD_ROOT \
316 %{l_files_std} \
317 '%config %{l_prefix}/lib/chiliproj/config/*'
318 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/files' \
319 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/files/*' \
320 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/log' \
321 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/log/*' \
322 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/tmp' \
323 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/tmp/*' \
324 #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/public/plugin_assets' \
325 #'%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/lib/chiliproj/public/plugin_assets/*'
326
327 %files -f altfiles
328 # problem with typical name 'files', existing in this case
329
330 %clean
331
332 %post
333 if [ $1 -eq 1 ]; then
334 RUBY_VERSION=`%{l_prefix}/bin/gem which rubygems | sed -e 's;.*/\([^/]*\)/rubygems\.rb$;\1;'`
335 ( cd $RPM_INSTALL_PREFIX/lib/chiliproj
336 # install session
337 $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \
338 exec rake generate_session_store
339 # create initial database
340 RAILS_ENV=production \
341 $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \
342 exec rake db:migrate
343 # insert default configuration into database
344 echo 'en' | \
345 RAILS_ENV=production \
346 $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \
347 exec rake redmine:load_default_data
348 ) || exit $?
349 fi
350 if [ $1 -eq 2 ]; then
351 # after upgrade
352 echo NOOP
353 fi
354

mercurial