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