1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/chiliproj/chiliproj.spec Sun Mar 31 17:55:10 2013 +0200 1.3 @@ -0,0 +1,354 @@ 1.4 +## 1.5 +## chiliproj.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2013 Michael Schloh von Bennewitz <michael@schloh.com> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# 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 1.28 +# FIXME: bundle exec rails s 1.29 +# FIXME: w3m http://localhost:3000/ 1.30 +# FIXME: log in with Login: admin and Password: admin 1.31 + 1.32 +# package version 1.33 +%define V_pref 427 1.34 +%define V_rake 10.0.4 1.35 +%define V_activesupport 2.3.18 1.36 +%define V_rack 1.1.6 1.37 +%define V_actionpack 2.3.18 1.38 +%define V_actionmailer 2.3.18 1.39 +%define V_activerecord 2.3.18 1.40 +%define V_activeresource 2.3.18 1.41 +%define V_rails 2.3.18 1.42 +%define V_actsastaggable 2.1.0 1.43 +%define V_coderay 1.0.9 1.44 +%define V_daemons 1.1.9 1.45 +%define V_eventmachine 1.0.3 1.46 +%define V_gravatarify 3.0.0 1.47 +%define V_i18n 0.4.2 1.48 +%define V_json 1.7.7 1.49 +%define V_liquid 2.3.0 1.50 +%define V_mysql2 0.2.18 1.51 +%define V_netldap 0.3.1 1.52 +%define V_rdoc 4.0.1 1.53 +%define V_rubyopenid 2.1.8 1.54 +%define V_rubytree 0.5.3 1.55 +%define V_sqlite3 1.3.7 1.56 +%define V_thin 1.5.1 1.57 +%define V_tzinfo 0.3.37 1.58 +%define V_bundler 1.3.4 1.59 + 1.60 +# package information 1.61 +Name: chiliproj 1.62 +Summary: Comprehensive Rails-based Project Manager 1.63 +URL: http://www.chiliproject.org/ 1.64 +Vendor: Felix Schaefer et al. 1.65 +Packager: Michael Schloh von Bennewitz 1.66 +Distribution: Europalab Networks Production 1.67 +Class: EVAL 1.68 +Group: Calendar 1.69 +License: GPL 1.70 +Version: 20130328 1.71 +Release: 20120800 1.72 + 1.73 +# list of sources 1.74 +Source0: http://www.chiliproject.org/attachments/download/%{V_pref}/chiliproject-%{version}.tar.bz2 1.75 +Source1: rc.chiliproj 1.76 +Source2: Gemfile.lock 1.77 +Source3: http://rubygems.org/downloads/rake-%{V_rake}.gem 1.78 +Source4: http://rubygems.org/downloads/activesupport-%{V_activesupport}.gem 1.79 +Source5: http://rubygems.org/downloads/rack-%{V_rack}.gem 1.80 +Source6: http://rubygems.org/downloads/actionpack-%{V_actionpack}.gem 1.81 +Source7: http://rubygems.org/downloads/actionmailer-%{V_actionmailer}.gem 1.82 +Source8: http://rubygems.org/downloads/activerecord-%{V_activerecord}.gem 1.83 +Source9: http://rubygems.org/downloads/activeresource-%{V_activeresource}.gem 1.84 +Source10: http://rubygems.org/downloads/rails-%{V_rails}.gem 1.85 +Source11: http://rubygems.org/downloads/acts-as-taggable-on-%{V_actsastaggable}.gem 1.86 +Source12: http://rubygems.org/downloads/coderay-%{V_coderay}.gem 1.87 +Source13: http://rubygems.org/downloads/daemons-%{V_daemons}.gem 1.88 +Source14: http://rubygems.org/downloads/eventmachine-%{V_eventmachine}.gem 1.89 +Source15: http://rubygems.org/downloads/gravatarify-%{V_gravatarify}.gem 1.90 +Source16: http://rubygems.org/downloads/i18n-%{V_i18n}.gem 1.91 +Source17: http://rubygems.org/downloads/json-%{V_json}.gem 1.92 +Source18: http://rubygems.org/downloads/liquid-%{V_liquid}.gem 1.93 +Source19: http://rubygems.org/downloads/mysql2-%{V_mysql2}.gem 1.94 +Source20: http://rubygems.org/downloads/net-ldap-%{V_netldap}.gem 1.95 +Source21: http://rubygems.org/downloads/rdoc-%{V_rdoc}.gem 1.96 +Source22: http://rubygems.org/downloads/ruby-openid-%{V_rubyopenid}.gem 1.97 +Source23: http://rubygems.org/downloads/rubytree-%{V_rubytree}.gem 1.98 +Source24: http://rubygems.org/downloads/sqlite3-%{V_sqlite3}.gem 1.99 +Source25: http://rubygems.org/downloads/thin-%{V_thin}.gem 1.100 +Source26: http://rubygems.org/downloads/tzinfo-%{V_tzinfo}.gem 1.101 +Source27: http://rubygems.org/downloads/bundler-%{V_bundler}.gem 1.102 + 1.103 +# build information 1.104 +BuildPreReq: OpenPKG, openpkg >= 20100101, ruby < 2.0.0, ruby-rails, ruby-thin 1.105 +PreReq: OpenPKG, openpkg >= 20100101, ruby < 2.0.0, ruby-rails, ruby-thin 1.106 + 1.107 +%description 1.108 + ChiliProject is a web based project management system. It supports 1.109 + your team throughout the complete project life cycle, from setting 1.110 + up and discussing a project plan, over tracking issues and reporting 1.111 + work progress to collaboratively sharing knowledge. 1.112 + 1.113 +%track 1.114 + prog chiliproj:chiliproj = { 1.115 + version = %{version} 1.116 + url = http://www.chiliproject.org/attachments/download/ 1.117 + regex = (\d+) 1.118 + url = http://www.chiliproject.org/attachments/download/__NEWVER__/ 1.119 + regex = chiliproject-(__VER__)\.tar.bz2 1.120 + } 1.121 + prog chiliproj:rake = { 1.122 + version = %{V_rake} 1.123 + url = http://rubygems.org/gems/rake 1.124 + regex = rake-(__VER__)\.gem 1.125 + } 1.126 + prog chiliproj:activesupport = { 1.127 + version = %{V_activesupport} 1.128 + url = http://rubygems.org/gems/activesupport 1.129 + regex = activesupport-(__VER__)\.gem 1.130 + } 1.131 + prog chiliproj:rack = { 1.132 + version = %{V_rack} 1.133 + url = http://rubygems.org/gems/rack 1.134 + regex = rack-(__VER__)\.gem 1.135 + } 1.136 + prog chiliproj:actionpack = { 1.137 + version = %{V_actionpack} 1.138 + url = http://rubygems.org/gems/actionpack 1.139 + regex = actionpack-(__VER__)\.gem 1.140 + } 1.141 + prog chiliproj:actionmailer = { 1.142 + version = %{V_actionmailer} 1.143 + url = http://rubygems.org/gems/actionmailer 1.144 + regex = actionmailer-(__VER__)\.gem 1.145 + } 1.146 + prog chiliproj:activerecord = { 1.147 + version = %{V_activerecord} 1.148 + url = http://rubygems.org/gems/activerecord 1.149 + regex = activerecord-(__VER__)\.gem 1.150 + } 1.151 + prog chiliproj:activeresource = { 1.152 + version = %{V_activeresource} 1.153 + url = http://rubygems.org/gems/activeresource 1.154 + regex = activeresource-(__VER__)\.gem 1.155 + } 1.156 + prog chiliproj:rails = { 1.157 + version = %{V_rails} 1.158 + url = http://rubygems.org/gems/rails 1.159 + regex = rails-(__VER__)\.gem 1.160 + } 1.161 + prog chiliproj:actsastaggable = { 1.162 + version = %{V_actsastaggable} 1.163 + url = http://rubygems.org/gems/acts-as-taggable-on 1.164 + regex = acts-as-taggable-on-(__VER__)\.gem 1.165 + } 1.166 + prog chiliproj:coderay = { 1.167 + version = %{V_coderay} 1.168 + url = http://rubygems.org/gems/coderay 1.169 + regex = coderay-(__VER__)\.gem 1.170 + } 1.171 + prog chiliproj:daemons = { 1.172 + version = %{V_daemons} 1.173 + url = http://rubygems.org/gems/daemons 1.174 + regex = daemons-(__VER__)\.gem 1.175 + } 1.176 + prog chiliproj:eventmachine = { 1.177 + version = %{V_eventmachine} 1.178 + url = http://rubygems.org/gems/eventmachine 1.179 + regex = eventmachine-(__VER__)\.gem 1.180 + } 1.181 + prog chiliproj:gravatarify = { 1.182 + version = %{V_gravatarify} 1.183 + url = http://rubygems.org/gems/gravatarify 1.184 + regex = gravatarify-(__VER__)\.gem 1.185 + } 1.186 + prog chiliproj:i18n = { 1.187 + version = %{V_i18n} 1.188 + url = http://rubygems.org/gems/i18n 1.189 + regex = i18n-(__VER__)\.gem 1.190 + } 1.191 + prog chiliproj:json = { 1.192 + version = %{V_json} 1.193 + url = http://rubygems.org/gems/json 1.194 + regex = json-(__VER__)\.gem 1.195 + } 1.196 + prog chiliproj:liquid = { 1.197 + version = %{V_liquid} 1.198 + url = http://rubygems.org/gems/liquid 1.199 + regex = liquid-(__VER__)\.gem 1.200 + } 1.201 + prog chiliproj:mysql2 = { 1.202 + version = %{V_mysql2} 1.203 + url = http://rubygems.org/gems/mysql2 1.204 + regex = mysql2-(__VER__)\.gem 1.205 + } 1.206 + prog chiliproj:netldap = { 1.207 + version = %{V_netldap} 1.208 + url = http://rubygems.org/gems/net-ldap 1.209 + regex = net-ldap-(__VER__)\.gem 1.210 + } 1.211 + prog chiliproj:rdoc = { 1.212 + version = %{V_rdoc} 1.213 + url = http://rubygems.org/gems/rdoc 1.214 + regex = rdoc-(__VER__)\.gem 1.215 + } 1.216 + prog chiliproj:rubyopenid = { 1.217 + version = %{V_rubyopenid} 1.218 + url = http://rubygems.org/gems/ruby-openid 1.219 + regex = ruby-openid-(__VER__)\.gem 1.220 + } 1.221 + prog chiliproj:rubytree = { 1.222 + version = %{V_rubytree} 1.223 + url = http://rubygems.org/gems/rubytree 1.224 + regex = rubytree-(__VER__)\.gem 1.225 + } 1.226 + prog chiliproj:sqlite3 = { 1.227 + version = %{V_sqlite3} 1.228 + url = http://rubygems.org/gems/sqlite3 1.229 + regex = sqlite3-(__VER__)\.gem 1.230 + } 1.231 + prog chiliproj:thin = { 1.232 + version = %{V_thin} 1.233 + url = http://rubygems.org/gems/thin 1.234 + regex = thin-(__VER__)\.gem 1.235 + } 1.236 + prog chiliproj:tzinfo = { 1.237 + version = %{V_tzinfo} 1.238 + url = http://rubygems.org/gems/tzinfo 1.239 + regex = tzinfo-(__VER__)\.gem 1.240 + } 1.241 + prog chiliproj:bundler = { 1.242 + version = %{V_bundler} 1.243 + url = http://rubygems.org/gems/bundler 1.244 + regex = bundler-(__VER__)\.gem 1.245 + } 1.246 + 1.247 +%prep 1.248 + %setup -q -n chiliproject-%{version} 1.249 + %{l_shtool} subst \ 1.250 + -e 's;# \(ENV\[.RAILS_ENV.\] ||= .production.\);\1;' \ 1.251 + config/environment.rb 1.252 + 1.253 +%build 1.254 + 1.255 +%install 1.256 + RUBY_VERSION=`%{l_prefix}/bin/gem which rubygems | sed -e 's;.*/\([^/]*\)/rubygems\.rb$;\1;'` 1.257 + export GEM_HOME=$RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION 1.258 + %{l_shtool} mkdir -f -p -m 755 $GEM_HOME 1.259 + %{l_shtool} mkdir -f -p public/plugin_assets 1.260 + %{l_tar} cf - . | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj 1.261 + %{l_prefix}/bin/gem install --local %{SOURCE3} 1.262 + %{l_prefix}/bin/gem install --local %{SOURCE4} 1.263 + %{l_prefix}/bin/gem install --local %{SOURCE5} 1.264 + %{l_prefix}/bin/gem install --local %{SOURCE6} 1.265 + %{l_prefix}/bin/gem install --local %{SOURCE7} 1.266 + %{l_prefix}/bin/gem install --local %{SOURCE8} 1.267 + %{l_prefix}/bin/gem install --local %{SOURCE9} 1.268 + %{l_prefix}/bin/gem install --local %{SOURCE10} 1.269 + %{l_prefix}/bin/gem install --local %{SOURCE11} 1.270 + %{l_prefix}/bin/gem install --local %{SOURCE12} 1.271 + %{l_prefix}/bin/gem install --local %{SOURCE13} 1.272 + %{l_prefix}/bin/gem install --local %{SOURCE14} 1.273 + %{l_prefix}/bin/gem install --local %{SOURCE15} 1.274 + %{l_prefix}/bin/gem install --local %{SOURCE16} 1.275 + %{l_prefix}/bin/gem install --local %{SOURCE17} 1.276 + %{l_prefix}/bin/gem install --local %{SOURCE18} 1.277 + %{l_prefix}/bin/gem install --local %{SOURCE19} 1.278 + %{l_prefix}/bin/gem install --local %{SOURCE20} 1.279 + %{l_prefix}/bin/gem install --local %{SOURCE21} 1.280 + %{l_prefix}/bin/gem install --local %{SOURCE22} 1.281 + %{l_prefix}/bin/gem install --local %{SOURCE23} 1.282 + %{l_prefix}/bin/gem install --local %{SOURCE24} 1.283 + %{l_prefix}/bin/gem install --local %{SOURCE25} 1.284 + %{l_prefix}/bin/gem install --local %{SOURCE27} 1.285 + 1.286 + # install configuration 1.287 + ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj 1.288 + %{l_shtool} mkdir -f -p -m 755 .bundle 1.289 + cp %{SOURCE Gemfile.lock} . 1.290 + echo 'gem "thin"' >>Gemfile 1.291 + cp config/configuration.yml.example config/configuration.yml 1.292 + cp config/additional_environment.rb.example config/additional_environment.rb 1.293 + echo "ENV['GEM_PATH'] = '%{l_prefix}/lib/ruby/gems/$RUBY_VERSION:%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION'" >>config/additional_environment.rb 1.294 + #echo 'config.action_controller.session = { :key => "_chiliproject_session", :secret => "54bbf51a99cbce2a8881af4fa0fa23895e071f8c8c4773e76b09388135bd9d3671534bf4db20c9f3" }' >>config/additional_environment.rb 1.295 + cat >config/database.yml <<EOF 1.296 +production: 1.297 + adapter: sqlite3 1.298 + database: db/prod.sqlite 1.299 +EOF 1.300 + # try this block with --- 1.301 + cat >.bundle/config <<EOF 1.302 +--- 1.303 +BUNDLE_WITHOUT: test:de:development:postgres:mysql:rmagick 1.304 +EOF 1.305 + ) || exit $? 1.306 + 1.307 + # install run command script 1.308 + %{l_shtool} mkdir -f -p -m 755 \ 1.309 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 1.310 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.311 + -e 's;@l_gempath@;$RPM_BUILD_ROOT%{l_prefix}/lib/ruby/gems/$RUBY_VERSION;g' \ 1.312 + %{SOURCE rc.chiliproj} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 1.313 + 1.314 + # clean up white spaces 1.315 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/chiliproj/gems/$RUBY_VERSION/gems/rdoc-*/test 1.316 + 1.317 + # problem with typical name 'files', existing in this case 1.318 + %{l_rpmtool} files -v -oaltfiles -r$RPM_BUILD_ROOT \ 1.319 + %{l_files_std} \ 1.320 + '%config %{l_prefix}/lib/chiliproj/config/*' 1.321 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/files' \ 1.322 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/files/*' \ 1.323 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/log' \ 1.324 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/log/*' \ 1.325 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/tmp' \ 1.326 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/tmp/*' \ 1.327 + #'%attr(775,%{l_nusr},%{l_mgrp}) %{l_prefix}/lib/chiliproj/public/plugin_assets' \ 1.328 + #'%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/lib/chiliproj/public/plugin_assets/*' 1.329 + 1.330 +%files -f altfiles 1.331 + # problem with typical name 'files', existing in this case 1.332 + 1.333 +%clean 1.334 + 1.335 +%post 1.336 + if [ $1 -eq 1 ]; then 1.337 + RUBY_VERSION=`%{l_prefix}/bin/gem which rubygems | sed -e 's;.*/\([^/]*\)/rubygems\.rb$;\1;'` 1.338 + ( cd $RPM_INSTALL_PREFIX/lib/chiliproj 1.339 + # install session 1.340 + $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \ 1.341 + exec rake generate_session_store 1.342 + # create initial database 1.343 + RAILS_ENV=production \ 1.344 + $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \ 1.345 + exec rake db:migrate 1.346 + # insert default configuration into database 1.347 + echo 'en' | \ 1.348 + RAILS_ENV=production \ 1.349 + $RPM_INSTALL_PREFIX/lib/ruby/gems/$RUBY_VERSION/bin/bundle \ 1.350 + exec rake redmine:load_default_data 1.351 + ) || exit $? 1.352 + fi 1.353 + if [ $1 -eq 2 ]; then 1.354 + # after upgrade 1.355 + echo NOOP 1.356 + fi 1.357 +