%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gemname rack-mount %global geminstdir %{gemdir}/gems/%{gemname}-%{version} %global testdir %{_tmppath}/%{gemname}-%{version} Summary: Stackable dynamic tree based Rack router Name: rubygem-%{gemname} Version: 0.6.13 Release: 3%{?dist} Group: Development/Languages License: MIT URL: http://github.com/josh/%{gemname} Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem # git clone https://github.com/josh/regin.git && cd regin && git checkout v0.3.7 # tar czvf rack-mount-tests.tgz test/ Source1: %{gemname}-tests.tgz Requires: ruby(abi) = 1.8 Requires: rubygems Requires: rubygem(rack) Requires: rubygem(regin) Requires: rubygem(multimap) BuildRequires: rubygems BuildRequires(check): rubygem(rack) BuildRequires(check): rubygem(regin) BuildRequires(check): rubygem(multimap) BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description Stackable dynamic tree based Rack router. Supports Rack’s X-Cascade convention to continue trying routes if the response returns pass. This allows multiple routes to be nested or stacked on top of each other. Since the application endpoint can trigger the router to continue matching, middle-ware can be used to add arbitrary conditions to any route. This allows you to route based on other request attributes, session information, or even data dynamically pulled from a database. %package doc Summary: Documentation for %{name} Group: Documentation Requires:%{name} = %{version}-%{release} %description doc Documentation for %{name} %prep %build %install mkdir -p %{buildroot}%{gemdir} gem install --local --install-dir %{buildroot}%{gemdir} \ --force --rdoc %{SOURCE0} rm -rf %{buildroot}%{geminstdir}/lib/rack/mount/vendor %clean rm -rf %{buildroot} %check rm -rf %{testdir} mkdir %{testdir} tar xzvf %{SOURCE1} -C %{testdir} pushd %{testdir} ruby -I%{buildroot}%{geminstdir}/lib -I./test `which testrb` test/test_* popd rm -rf %{testdir} %files %defattr(-, root, root, -) %dir %{geminstdir} %{geminstdir}/lib %doc %{geminstdir}/LICENSE %doc %{geminstdir}/README.rdoc %{gemdir}/cache/%{gemname}-%{version}.gem %{gemdir}/specifications/%{gemname}-%{version}.gemspec %files doc %defattr(-, root, root, -) %doc %{gemdir}/doc/%{gemname}-%{version} %changelog * Wed Jan 26 2011 Vít Ondruch - 0.6.13-3 - Fixed vendor subdirectory removal - Added test dir cleanup on the beginning of %check section * Wed Jan 19 2011 Vít Ondruch - 0.6.13-2 - Added missing prep, build and clean sections - Added missing dependency on rubygem-rack - Removed unnecessary cleanup - Removed vendored Regin and Multimap gems - Added exection of test suite * Fri Jan 07 2011 Vít Ondruch - 0.6.13-1 - Initial package