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']")
Chris Lalancette 8f44cf9
%global rubyabi 1.8
1b29e6e
1b29e6e
Summary: A thin and fast web server
1b29e6e
Name: rubygem-%{gemname}
Michal Fojtik 63b03ef
Version: 1.2.11
Chris Lalancette b43612c
Release: 10%{?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
Chris Lalancette 7c85dd7
Patch1: rubygem-thin-fix-parser-load-path.patch
Chris Lalancette 8f44cf9
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
Chris Lalancette 8f44cf9
BuildRequires: ruby(abi) = %{rubyabi}
1b29e6e
BuildRequires: ruby-devel
Chris Lalancette 8f44cf9
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
Chris Lalancette 8f44cf9
Thin is a Ruby web server that glues together three of the best Ruby
Chris Lalancette 8f44cf9
libraries in web history.
Chris Lalancette 8f44cf9
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
Chris Lalancette 8f44cf9
%setup -q -c -T
1b29e6e
mkdir -p ./%{gemdir}
1b29e6e
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
Chris Lalancette 8f44cf9
gem install --local --install-dir ./%{gemdir} -V --force %{SOURCE0}
1b29e6e
Chris Lalancette 7c85dd7
pushd .%{geminstdir}
Chris Lalancette 7c85dd7
%patch1
Chris Lalancette 7c85dd7
1b29e6e
%build
1b29e6e
1b29e6e
%install
1b29e6e
rm -rf %{buildroot}
1b29e6e
mkdir -p %{buildroot}%{ruby_sitearch}/%{gemname}
1b29e6e
mkdir -p %{buildroot}%{gemdir}
Chris Lalancette 8f44cf9
mkdir -p %{buildroot}%{_prefix}
1b29e6e
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
1b29e6e
mv -f %{buildroot}%{geminstdir}/lib/*.so %{buildroot}%{ruby_sitearch}/
Chris Lalancette 8f44cf9
mv -f %{buildroot}%{gemdir}/bin %{buildroot}%{_prefix}
1b29e6e
for f in $(find %{buildroot}%{geminstdir} -name \*.rb); do
Chris Lalancette 8f44cf9
  sed -i -e '/^#!/d' $f
Chris Lalancette 8f44cf9
  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
Chris Lalancette 8f44cf9
rm -rf %{buildroot}%{geminstdir}/{ext,tmp}/
Chris Lalancette 8f44cf9
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=
Chris Lalancette 7c85dd7
RUBYOPT="rubygems I%{buildroot}%{geminstdir}/lib I%{buildroot}%{ruby_sitearch} 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
)
Chris Lalancette 8f44cf9
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
%files
Chris Lalancette 8f44cf9
%{_bindir}/%{gemname}
Chris Lalancette 8f44cf9
%{ruby_sitearch}/thin_parser.so
Chris Lalancette 8f44cf9
%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/
Chris Lalancette 8f44cf9
%{gemdir}/cache/%{gemname}-%{version}.gem
Chris Lalancette 8f44cf9
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
Chris Lalancette 8286c79
# BSD
Chris Lalancette 8286c79
%{geminstdir}/lib/thin/stats.html.erb
Michal Fojtik 9cc9e7d
Michal Fojtik 9cc9e7d
%files doc
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
1b29e6e
%changelog
Chris Lalancette b43612c
* Tue Sep 06 2011 Chris Lalancette <clalance@redhat.com> - 1.2.11-10
Chris Lalancette b43612c
- Bump the release so upgrades from F-16 work
Chris Lalancette b43612c
Chris Lalancette 8286c79
* Mon Jul 25 2011 Chris Lalancette <clalance@redhat.com> - 1.2.11-3
Chris Lalancette 8286c79
- Move stats.html.erb to the main package (it is a runtime requirement)
Chris Lalancette 8286c79
Chris Lalancette 7c85dd7
* Fri Jul 22 2011 Chris Lalancette <clalance@redhat.com> - 1.2.11-2
Chris Lalancette 7c85dd7
- Fix the load path for thin_parser
Chris Lalancette 7c85dd7
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