diff --git a/.gitignore b/.gitignore index e69de29..44ce7de 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/scoped_search-2.4.0.gem diff --git a/rubygem-scoped_search.spec b/rubygem-scoped_search.spec new file mode 100644 index 0000000..dd1c455 --- /dev/null +++ b/rubygem-scoped_search.spec @@ -0,0 +1,184 @@ +%global gem_name scoped_search +%if 0%{?rhel} == 6 +%global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) +%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} +%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem +%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec +%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} +%endif + +Summary: Easily search your ActiveRecord models +Name: rubygem-%{gem_name} + +Version: 2.4.0 +Release: 5%{?dist} +Group: Development/Languages +License: MIT +URL: http://github.com/wvanbergen/scoped_search/wiki +Source0: https://rubygems.org/downloads/%{gem_name}-%{version}.gem +Requires: rubygems +Requires: rubygem-activerecord >= 2.1.0 +BuildRequires: ruby +BuildRequires: rubygems +%if 0%{?rhel} == 6 || 0%{?fedora} < 17 +Requires: ruby(abi) = 1.8 +%else +Requires: ruby(abi) = 1.9.1 +%endif +%if 0%{?fedora} +BuildRequires: rubygems-devel +%endif +BuildArch: noarch +Provides: rubygem(scoped_search) = %{version} + +# for check section +%if 0%{?fedora} > 17 +BuildRequires: rubygem(rspec) +BuildRequires: rubygem(activerecord) +BuildRequires: rubygem(sqlite3) +%endif + +%description +Scoped search makes it easy to search your ActiveRecord-based models. It will +create a named scope :search_for that can be called with a query string. It +will build an SQL query using the provided query string and a definition that +specifies on what fields to search. Because the functionality is built on +named_scope, the result of the search_for call can be used like any other +named_scope, so it can be chained with another scope or combined with +will_paginate. Because it uses standard SQL, it does not require any setup, +indexers or daemons. This makes scoped_search suitable to quickly add basic +search functionality to your application with little hassle. On the other hand, +it may not be the best choice if it is going to be used on very large data sets +or by a large user base. + +%package doc +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +Summary: Documentation for rubygem-%{gem_name} + +%description doc +This package contains documentation for rubygem-%{gem_name}. + + +%prep +gem unpack %{SOURCE0} +%setup -q -D -T -n %{gem_name}-%{version} +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec + +%build +mkdir -p .%{gem_dir} + +# Create the gem as gem install only works on a gem file +gem build %{gem_name}.gemspec + +gem install -V \ + --local \ + --install-dir ./%{gem_dir} \ + --force \ + --rdoc \ + %{gem_name}-%{version}.gem + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ +rm -rf %{buildroot}%{gem_dir}/gems/%{gem_name}-%{version}/{.yardoc,.gitignore,.infinity_test,.travis.yml} +mv %{buildroot}%{gem_instdir}/{LICENSE,README.rdoc} ./ + +# https://github.com/wvanbergen/scoped_search/issues/26 +chmod a-x %{buildroot}%{gem_instdir}/lib/scoped_search.rb + +rm %{buildroot}%{gem_cache} + +%check +pushd .%{gem_instdir} +# Get rid of Bundler, not needed on Fedora. +sed -i "/require 'bundler\/setup'/ d" spec/spec_helper.rb +# sqlite3-ruby and sqlite3 are identical rubygems, where the former is +# older name for the gem. Would be nice if upstream support both +# reincarnations. +# do not test on postgresql and ruby +sed '5,15d' -i spec/database.ruby.yml +#test does not work right now +#https://github.com/wvanbergen/scoped_search/issues/34 +#or more precisly works only on F18+ +%if 0%{?fedora} > 17 +rspec spec +%endif +popd + +%files +%doc LICENSE +%dir %{gem_instdir} +%{gem_instdir}/lib +%{gem_instdir}/init.rb +%{gem_instdir}/tasks +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc README.rdoc +%{gem_instdir}/Rakefile +%{gem_instdir}/Gemfile* +%{gem_instdir}/spec +%{gem_instdir}/%{gem_name}.gemspec + +%changelog +* Mon Dec 03 2012 Miroslav Suchý 2.4.0-5 +- run test only on F18+ (msuchy@redhat.com) +- enable tests (msuchy@redhat.com) + +* Tue Oct 30 2012 Miroslav Suchý 2.4.0-4 +- do not run test on rhel6 at all due missing rspec (msuchy@redhat.com) + +* Tue Oct 30 2012 Miroslav Suchý 2.4.0-3 +- remove .travis.yml, add Gemfile.activerecord* (msuchy@redhat.com) + +* Mon Oct 29 2012 Miroslav Suchý 2.4.0-2 +- do not run test, because it is not working (msuchy@redhat.com) +- disable testing on other backend but sqllite (msuchy@redhat.com) +- update to recent scoped_search-2.4.0.gem (msuchy@redhat.com) + +* Tue Oct 16 2012 Miroslav Suchý 2.4.0-1 +- update to recent scoped_search-2.4.0.gem (msuchy@redhat.com) + +* Wed Aug 15 2012 Miroslav Suchý 2.3.7-10 +- 847504 - move gemspec to -doc subpackage (msuchy@redhat.com) + +* Wed Aug 15 2012 Miroslav Suchý 2.3.7-9 +- test suite is failing on F17 a lot - disable for now (msuchy@redhat.com) +- 847504 - use test suite (msuchy@redhat.com) +- 847504 - remove dot files in %%install section (msuchy@redhat.com) +- 847504 - use macro in SOURCE0 (msuchy@redhat.com) + +* Tue Aug 14 2012 Miroslav Suchý 2.3.7-8 +- 847504 - put in front of chmod link to github issue (msuchy@redhat.com) +- 847504 - fix typo in summary (msuchy@redhat.com) + +* Tue Aug 14 2012 Miroslav Suchý 2.3.7-7 +- 847504 - remove cached gem (msuchy@redhat.com) +- 847504 - correctly use dist tag (msuchy@redhat.com) +- 847504 - rewrap description (msuchy@redhat.com) + +* Sun Aug 12 2012 Miroslav Suchý 2.3.7-6 +- fix spelling error (msuchy@redhat.com) +- module scoped_search.rb should not be executable (msuchy@redhat.com) + +* Sun Aug 12 2012 Miroslav Suchý 2.3.7-5 +- buildroot is not needed (msuchy@redhat.com) +- change Group to valid item (msuchy@redhat.com) + +* Fri Aug 10 2012 Miroslav Suchý 2.3.7-4 +- there is no need to require rubygems in some version (msuchy@redhat.com) + +* Fri Aug 10 2012 Miroslav Suchý 2.3.7-3 +- there is no need to require rubygems in some version (msuchy@redhat.com) + +* Thu Aug 09 2012 Miroslav Suchý 2.3.7-2 +- fix filelist (msuchy@redhat.com) +- create doc subpackage (msuchy@redhat.com) +- fix requirements (msuchy@redhat.com) + +* Thu Aug 09 2012 Miroslav Suchý 2.3.7-1 +- edit rubygem-scoped_search.spec according guidelines (msuchy@redhat.com) +- import rubygem-scoped_search.spec from foreman-rpms (msuchy@redhat.com) + diff --git a/sources b/sources index e69de29..327d878 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +15f7df0de79e820addfbf5d6dd143026 scoped_search-2.4.0.gem