Blob Blame History Raw
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global gemname thin
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%global rubyabi 1.8 

Summary: A thin and fast web server
Name: rubygem-%{gemname}
Version: 1.2.7
Release: 1%{?dist}
Group: Development/Languages
License: (GPLv2 or Ruby) and BSD and MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby(abi) = %{rubyabi} 
Requires: rubygems
Requires: rubygem(rack) >= 1.0.0
Requires: rubygem(eventmachine) >= 0.12.6
Requires: rubygem(daemons) >= 1.0.9
BuildRequires: ruby(abi) = %{rubyabi} 
BuildRequires: ruby-devel
BuildRequires: ruby(rubygems) 
BuildRequires: rubygem(rake)
BuildRequires: rubygem(rake-compiler)
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(eventmachine) >= 0.12.6
BuildRequires: rubygem(daemons) >= 1.0.9
BuildRequires: rubygem(rack) >= 1.0.0
Provides: rubygem(%{gemname}) = %{version}

Thin is a Ruby web server that glues together three of the best Ruby 
libraries in web history. 
The Mongrel parser, the root of Mongrel speed and security, 
Event Machine, a network I/O library with extremely high scalability and
Rack, a minimal interface between webservers and Ruby frameworks.

%setup -q -c -T 
mkdir -p ./%{gemdir}
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
gem install \
	--local \
	--install-dir ./%{gemdir} \
	-V --force \


rm -rf %{buildroot}
mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname}
mkdir -p %{buildroot}%{gemdir}
mkdir -p %{buildroot}%{_prefix} 
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
mv -f %{buildroot}%{geminstdir}/lib/*.so %{buildroot}%{ruby_sitearch}/
mv -f %{buildroot}%{gemdir}/bin %{buildroot}%{_prefix} 
for f in $(find %{buildroot}%{geminstdir} -name \*.rb); do
  sed -i -e '/^#!/d' $f 
  chmod 0644 $f 
find %{buildroot}%{geminstdir} -type f -exec sed -i 's/^#!\/usr\/local\/bin\/ruby/#!\/usr\/bin\/ruby/g' {} \;
rm -f %{buildroot}/spec/request/processing_spec.rb
rm -rf %{buildroot}%{geminstdir}/{ext,tmp}/ 
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths} 

%ifarch ppc64
exit 0
pushd ./%{geminstdir}
rake spec2 --trace

rm -rf %{buildroot}

%defattr(-, root, root, -)
%dir %{geminstdir}/ 
%dir %{geminstdir}/lib
%dir %{geminstdir}/lib/thin/
%doc %{geminstdir}/benchmark/
%doc %{geminstdir}/tasks/
%doc %{geminstdir}/example/
%doc %{geminstdir}/CHANGELOG
%doc %{geminstdir}/README
%doc %{geminstdir}/Rakefile
%dir %{geminstdir}/spec/
%doc %{geminstdir}/spec/backends/
%doc %{geminstdir}/spec/*.rb
%doc %{geminstdir}/spec/configs/
%doc %{geminstdir}/spec/controllers/
%doc %{geminstdir}/spec/perf/
%doc %{geminstdir}/spec/rack/
%doc %{geminstdir}/spec/request/
%doc %{geminstdir}/spec/server/
%dir %{geminstdir}/spec/rails_app/
%doc %{geminstdir}/spec/rails_app/app/
%doc %{geminstdir}/spec/rails_app/config/
%doc %{geminstdir}/spec/rails_app/script/
%doc %{geminstdir}/COPYING

* Wed Sep 08 2010 Michal Fojtik <> - 1.2.7-1
- Updated to upstream version

* Tue Feb 04 2010 Michal Fojtik <> - 1.2.5-5
- Excluded ppc64 in tests (566401)
- Fixed Licensing

* Tue Feb 03 2010 Michal Fojtik <> - 1.2.5-4
- Added rspec tests
- Fixed unwanted recompilation
- Fixed licensing

* Tue Feb 02 2010 Michal Fojtik <> - 1.2.5-3
- Fixed description

* Tue Feb 02 2010 Michal Fojtik <> - 1.2.5-2
- Build fixed
- Licence corrected
- Added missing requires
- Marked relevant files as documentation

* Tue Feb 02 2010 Michal Fojtik <> - 1.2.5-1
- Initial package