1b29e6e
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
1b29e6e
%global gemname thin
1b29e6e
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
1b29e6e
%global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')
1b29e6e
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
1b29e6e
%global rubyabi 1.8 
1b29e6e
1b29e6e
Summary: A thin and fast web server
1b29e6e
Name: rubygem-%{gemname}
Michal Fojtik 63b03ef
Version: 1.2.11
Michal Fojtik 63b03ef
Release: 1%{?dist}
1b29e6e
Group: Development/Languages
1b29e6e
License: (GPLv2 or Ruby) and BSD and MIT
1b29e6e
URL: http://code.macournoyer.com/thin/
1b29e6e
Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
1b29e6e
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1b29e6e
Requires: ruby(abi) = %{rubyabi} 
1b29e6e
Requires: rubygems
1b29e6e
Requires: rubygem(rack) >= 1.0.0
1b29e6e
Requires: rubygem(eventmachine) >= 0.12.6
1b29e6e
Requires: rubygem(daemons) >= 1.0.9
Michal Fojtik 9cc9e7d
Requires: curl
1b29e6e
BuildRequires: ruby(abi) = %{rubyabi} 
1b29e6e
BuildRequires: ruby-devel
1b29e6e
BuildRequires: ruby(rubygems) 
Michal Fojtik 9cc9e7d
BuildRequires: curl
Michal Fojtik 9cc9e7d
BuildRequires: libcurl-devel
1b29e6e
BuildRequires: rubygem(rake-compiler)
Michal Fojtik 15831f1
BuildRequires: rubygem(rspec)
Michal Fojtik 63b03ef
BuildRequires: rubygem(rspec-core)
1b29e6e
BuildRequires: rubygem(eventmachine) >= 0.12.6
1b29e6e
BuildRequires: rubygem(daemons) >= 1.0.9
1b29e6e
BuildRequires: rubygem(rack) >= 1.0.0
1b29e6e
Provides: rubygem(%{gemname}) = %{version}
1b29e6e
1b29e6e
%description
1b29e6e
Thin is a Ruby web server that glues together three of the best Ruby 
1b29e6e
libraries in web history. 
1b29e6e
The Mongrel parser, the root of Mongrel speed and security, 
1b29e6e
Event Machine, a network I/O library with extremely high scalability and
1b29e6e
Rack, a minimal interface between webservers and Ruby frameworks.
1b29e6e
Michal Fojtik 9cc9e7d
%package doc
Michal Fojtik 9cc9e7d
Summary: Documentation for %{name}
Michal Fojtik 9cc9e7d
Group: Documentation
Michal Fojtik 9cc9e7d
Requires:%{name} = %{version}-%{release}
Michal Fojtik 9cc9e7d
Michal Fojtik 9cc9e7d
%description doc
Michal Fojtik 9cc9e7d
Documentation for %{name}
Michal Fojtik 9cc9e7d
1b29e6e
%prep
1b29e6e
%setup -q -c -T 
1b29e6e
mkdir -p ./%{gemdir}
1b29e6e
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
1b29e6e
gem install \
1b29e6e
	--local \
1b29e6e
	--install-dir ./%{gemdir} \
1b29e6e
	-V --force \
1b29e6e
	%{SOURCE0}
1b29e6e
1b29e6e
%build
1b29e6e
1b29e6e
%install
1b29e6e
rm -rf %{buildroot}
1b29e6e
mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname}
1b29e6e
mkdir -p %{buildroot}%{gemdir}
1b29e6e
mkdir -p %{buildroot}%{_prefix} 
1b29e6e
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
1b29e6e
mv -f %{buildroot}%{geminstdir}/lib/*.so %{buildroot}%{ruby_sitearch}/
1b29e6e
mv -f %{buildroot}%{gemdir}/bin %{buildroot}%{_prefix} 
1b29e6e
for f in $(find %{buildroot}%{geminstdir} -name \*.rb); do
1b29e6e
  sed -i -e '/^#!/d' $f 
1b29e6e
  chmod 0644 $f 
1b29e6e
done
1b29e6e
find %{buildroot}%{geminstdir} -type f -exec sed -i 's/^#!\/usr\/local\/bin\/ruby/#!\/usr\/bin\/ruby/g' {} \;
Michal Fojtik 9cc9e7d
chmod +x %{buildroot}%{geminstdir}/lib/thin/controllers/service.sh.erb
1b29e6e
rm -rf %{buildroot}%{geminstdir}/{ext,tmp}/ 
1b29e6e
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths} 
1b29e6e
1b29e6e
%check
1b29e6e
# https://bugzilla.redhat.com/show_bug.cgi?id=566401
1b29e6e
%ifarch ppc64
1b29e6e
exit 0
1b29e6e
%endif
1b29e6e
pushd ./%{geminstdir}
Michal Fojtik 839eb49
SPECS=
Michal Fojtik 839eb49
RUBYOPT="rubygems I%{buildroot}%{geminstdir}/lib Ispec Ibenchmark_unit" spec -b `echo "
Michal Fojtik 845b94e
PERF_SPECS = Dir['spec/perf/*_spec.rb'] + [ 'spec/server/pipelining_spec.rb' ]
Michal Fojtik 839eb49
WIN_SPECS = %w(
Michal Fojtik 839eb49
spec/backends/unix_server_spec.rb
Michal Fojtik 839eb49
spec/controllers/service_spec.rb
Michal Fojtik 839eb49
spec/daemonizing_spec.rb
Michal Fojtik 839eb49
spec/server/unix_socket_spec.rb
Michal Fojtik 839eb49
spec/server/swiftiply_spec.rb
Michal Fojtik 839eb49
)
Michal Fojtik 839eb49
SPECS2     = %w(spec/server/threaded_spec.rb spec/server/tcp_spec.rb)  
Michal Fojtik 845b94e
puts Dir['spec/**/*_spec.rb'] - PERF_SPECS - WIN_SPECS - SPECS2
Michal Fojtik 839eb49
" | ruby`
1b29e6e
popd
1b29e6e
1b29e6e
%clean
1b29e6e
rm -rf %{buildroot}
1b29e6e
1b29e6e
%files
1b29e6e
%defattr(-, root, root, -)
1b29e6e
%{_bindir}/%{gemname} 
1b29e6e
%{ruby_sitearch}/thin_parser.so 
1b29e6e
%dir %{geminstdir}/ 
1b29e6e
%{geminstdir}/bin/
1b29e6e
%dir %{geminstdir}/lib
1b29e6e
%{geminstdir}/lib/thin.rb
1b29e6e
%{geminstdir}/lib/rack/
1b29e6e
%dir %{geminstdir}/lib/thin/
1b29e6e
%{geminstdir}/lib/thin/*.rb
1b29e6e
%{geminstdir}/lib/thin/backends/
1b29e6e
%{geminstdir}/lib/thin/controllers/
1b29e6e
%{gemdir}/cache/%{gemname}-%{version}.gem 
1b29e6e
%{gemdir}/specifications/%{gemname}-%{version}.gemspec 
Michal Fojtik 9cc9e7d
Michal Fojtik 9cc9e7d
%files doc
Michal Fojtik 9cc9e7d
%defattr(-, root, root, -)
Michal Fojtik 5bfd367
%{gemdir}/doc/%{gemname}-%{version}
Michal Fojtik 9cc9e7d
%{geminstdir}/benchmark/
Michal Fojtik 9cc9e7d
%{geminstdir}/tasks/
Michal Fojtik 9cc9e7d
%{geminstdir}/example/
Michal Fojtik 9cc9e7d
%{geminstdir}/CHANGELOG
Michal Fojtik 9cc9e7d
%{geminstdir}/README
Michal Fojtik 9cc9e7d
%{geminstdir}/Rakefile
1b29e6e
%dir %{geminstdir}/spec/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/backends/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/*.rb
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/configs/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/controllers/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/perf/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/rack/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/request/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/server/
1b29e6e
%dir %{geminstdir}/spec/rails_app/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/rails_app/app/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/rails_app/config/
Michal Fojtik 9cc9e7d
%{geminstdir}/spec/rails_app/script/
1b29e6e
# MIT
1b29e6e
%doc %{geminstdir}/COPYING
1b29e6e
%{geminstdir}/spec/rails_app/public/
1b29e6e
# BSD
1b29e6e
%{geminstdir}/lib/thin/stats.html.erb
1b29e6e
1b29e6e
%changelog
Michal Fojtik 63b03ef
* Tue Mar 01 2011 Michal Fojtik <mfojtik@redhat.com> - 1.2.11-1
Michal Fojtik 63b03ef
- Version bump
Michal Fojtik 63b03ef
Michal Fojtik 5785e01
* Tue Mar 01 2011 Michal Fojtik <mfojtik@redhat.com> - 1.2.8-3
Michal Fojtik 5785e01
- Removed Rake dependency completely
Michal Fojtik 5785e01
Michal Fojtik e6a74af
* Tue Mar 01 2011 Michal Fojtik <mfojtik@redhat.com> - 1.2.8-2
Michal Fojtik e6a74af
- Fixed RSpec tests
Michal Fojtik e6a74af
Michal Fojtik 9cc9e7d
* Tue Mar 01 2011 Michal Fojtik <mfojtik@redhat.com> - 1.2.8-1
Michal Fojtik 9cc9e7d
- Updated to upstream version
Michal Fojtik 9cc9e7d
339c9a7
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-2
339c9a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
339c9a7
Michal Fojtik b3f35a4
* Wed Sep 08 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.7-1
Michal Fojtik b3f35a4
- Updated to upstream version
Michal Fojtik b3f35a4
1b29e6e
* Tue Feb 04 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.5-5
1b29e6e
- Excluded ppc64 in tests (566401)
1b29e6e
- Fixed Licensing
1b29e6e
1b29e6e
* Tue Feb 03 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.5-4
1b29e6e
- Added rspec tests
1b29e6e
- Fixed unwanted recompilation
1b29e6e
- Fixed licensing
1b29e6e
1b29e6e
* Tue Feb 02 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.5-3
1b29e6e
- Fixed description
1b29e6e
1b29e6e
* Tue Feb 02 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.5-2
1b29e6e
- Build fixed
1b29e6e
- Licence corrected
1b29e6e
- Added missing requires
1b29e6e
- Marked relevant files as documentation
1b29e6e
1b29e6e
* Tue Feb 02 2010 Michal Fojtik <mfojtik@redhat.com> - 1.2.5-1
1b29e6e
- Initial package
1b29e6e
1b29e6e