Josef Stribny c6b2cf6
# Generated from acts_as_list-0.4.0.gem by gem2rpm -*- rpm-spec -*-
Josef Stribny c6b2cf6
%global gem_name acts_as_list
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
Name: rubygem-%{gem_name}
Josef Stribny c6b2cf6
Version: 0.4.0
Josef Stribny c6b2cf6
Release: 1%{?dist}
Josef Stribny c6b2cf6
Summary: A gem allowing a active_record model to act_as_list
Josef Stribny c6b2cf6
Group: Development/Languages
Josef Stribny c6b2cf6
License: MIT
Josef Stribny c6b2cf6
URL: http://github.com/swanandp/acts_as_list
Josef Stribny c6b2cf6
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Josef Stribny c6b2cf6
BuildRequires: rubygems-devel 
Josef Stribny c6b2cf6
BuildRequires: rubygem(activerecord)
Josef Stribny c6b2cf6
BuildRequires: rubygem(sqlite3)
Josef Stribny c6b2cf6
BuildArch: noarch
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%description
Josef Stribny c6b2cf6
This "acts_as" extension provides the capabilities for sorting and reordering
Josef Stribny c6b2cf6
a number of objects in a list. The class that has this specified needs to have
Josef Stribny c6b2cf6
a "position" column defined as an integer on the mapped database table.
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%package doc
Josef Stribny c6b2cf6
Summary: Documentation for %{name}
Josef Stribny c6b2cf6
Group: Documentation
Josef Stribny c6b2cf6
Requires: %{name} = %{version}-%{release}
Josef Stribny c6b2cf6
BuildArch: noarch
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%description doc
Josef Stribny c6b2cf6
Documentation for %{name}.
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%prep
Josef Stribny c6b2cf6
gem unpack %{SOURCE0}
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%setup -q -D -T -n  %{gem_name}-%{version}
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%build
Josef Stribny c6b2cf6
# Create the gem as gem install only works on a gem file
Josef Stribny c6b2cf6
gem build %{gem_name}.gemspec
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
Josef Stribny c6b2cf6
# by default, so that we can move it into the buildroot in %%install
Josef Stribny c6b2cf6
%gem_install
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%install
Josef Stribny c6b2cf6
mkdir -p %{buildroot}%{gem_dir}
Josef Stribny c6b2cf6
cp -a .%{gem_dir}/* \
Josef Stribny c6b2cf6
        %{buildroot}%{gem_dir}/
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
# Run the test suite
Josef Stribny c6b2cf6
%check
Josef Stribny c6b2cf6
pushd .%{gem_instdir}
Josef Stribny c6b2cf6
# Remove Bundler
Josef Stribny c6b2cf6
sed -i -e '2,9d' test/helper.rb
Josef Stribny c6b2cf6
ruby -Ilib:test -rsqlite3 test/test_list.rb
Josef Stribny c6b2cf6
popd
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%files
Josef Stribny c6b2cf6
%dir %{gem_instdir}
Josef Stribny c6b2cf6
%{gem_libdir}
Josef Stribny c6b2cf6
%exclude %{gem_cache}
Josef Stribny c6b2cf6
%exclude %{gem_instdir}/.gemtest
Josef Stribny c6b2cf6
%exclude %{gem_instdir}/.gitignore
Josef Stribny c6b2cf6
%exclude %{gem_instdir}/.travis.yml
Josef Stribny c6b2cf6
%{gem_spec}
Josef Stribny c6b2cf6
%license %{gem_instdir}/MIT-LICENSE
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%files doc
Josef Stribny c6b2cf6
%doc %{gem_docdir}
Josef Stribny c6b2cf6
%{gem_instdir}/Gemfile
Josef Stribny c6b2cf6
%{gem_instdir}/Rakefile
Josef Stribny c6b2cf6
%doc %{gem_instdir}/README.md
Josef Stribny c6b2cf6
%{gem_instdir}/test
Josef Stribny c6b2cf6
%{gem_instdir}/init.rb
Josef Stribny c6b2cf6
%{gem_instdir}/gemfiles
Josef Stribny c6b2cf6
%{gem_instdir}/%{gem_name}.gemspec
Josef Stribny c6b2cf6
Josef Stribny c6b2cf6
%changelog
Josef Stribny c6b2cf6
* Thu Sep 18 2014 Josef Stribny <jstribny@redhat.com> - 0.4.0-1
Josef Stribny c6b2cf6
- Initial package