%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gemname recaptcha %global geminstdir %{gemdir}/gems/%{gemname}-%{version} %global rubyabi 1.8 Summary: Helpers for the reCAPTCHA API Name: rubygem-%{gemname} Version: 0.3.1 Release: 1%{?dist} Group: Development/Languages License: MIT URL: http://rubygems.org/gems/%{gemname} Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem Requires: ruby(abi) = %{rubyabi} Requires: rubygems Requires: rubygem(mocha) Requires: rubygem(activesupport) BuildRequires: rubygems ruby BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description This plug-in adds helpers for the reCAPTCHA API. In your views you can use the recaptcha_tags method to embed the needed JavaScript, and you can validate in your controllers with verify_recaptcha. Beforehand you need to configure Recaptcha with your custom private and public key. You may find detailed examples below. Exceptions will be raised if you call these methods and the keys can’t be found. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} %description doc This package contains the documentation files for %{name}. %prep %build %install mkdir -p %{buildroot}%{gemdir} gem install --local --install-dir %{buildroot}%{gemdir} \ --force --rdoc %{SOURCE0} %files %defattr(-, root, root, -) %dir %{geminstdir} %doc %{geminstdir}/[A-Z]* %exclude %{geminstdir}/Rakefile %exclude %{geminstdir}/%{gemname}.gemspec %exclude %{geminstdir}/tasks %exclude %{geminstdir}/test %{geminstdir}/[a-l]* %{gemdir}/cache/%{gemname}-%{version}.gem %{gemdir}/specifications/%{gemname}-%{version}.gemspec %files doc %defattr(-, root, root, -) %doc %{geminstdir}/[A-Z]* %{geminstdir}/%{gemname}.gemspec %{geminstdir}/tasks %{geminstdir}/test %{gemdir}/doc/%{gemname}-%{version} %changelog * Tue Apr 19 2011 Akira TAGOH - 0.3.1-1 - Initial package