204fcb0
%global gem_name sequel
Alejandro Pérez e2994e7
204fcb0
Name: rubygem-%{gem_name}
bef8f55
Version: 5.1.0
bef8f55
Release: 1%{?dist}
0decc0f
Summary: The Database Toolkit for Ruby
Alejandro Pérez e2994e7
Group: Development/Languages
Alejandro Pérez e2994e7
License: MIT
0decc0f
URL: http://sequel.jeremyevans.net
0decc0f
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
0decc0f
BuildRequires: ruby(release)
0decc0f
BuildRequires: rubygems-devel 
0decc0f
BuildRequires: ruby >= 1.8.7
Alejandro Pérez e2994e7
BuildArch: noarch
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%description
0decc0f
The Database Toolkit for Ruby.
0decc0f
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%package doc
Alejandro Pérez e2994e7
Summary: Documentation for %{name}
Alejandro Pérez e2994e7
Group: Documentation
Alejandro Pérez e2994e7
Requires: %{name} = %{version}-%{release}
0decc0f
BuildArch: noarch
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%description doc
0decc0f
Documentation for %{name}.
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%prep
alejandro 89ae71c
gem unpack %{SOURCE0}
0decc0f
0decc0f
%setup -q -D -T -n  %{gem_name}-%{version}
0decc0f
alejandro 89ae71c
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%build
0decc0f
# Create the gem as gem install only works on a gem file
alejandro 89ae71c
gem build %{gem_name}.gemspec
0decc0f
0decc0f
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
0decc0f
# by default, so that we can move it into the buildroot in %%install
0decc0f
%gem_install
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%install
204fcb0
mkdir -p %{buildroot}%{gem_dir}
0decc0f
cp -a .%{gem_dir}/* \
0decc0f
        %{buildroot}%{gem_dir}/
0decc0f
0decc0f
0decc0f
mkdir -p %{buildroot}%{_bindir}
0decc0f
cp -pa .%{_bindir}/* \
0decc0f
        %{buildroot}%{_bindir}/
3f65c15
0decc0f
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
0decc0f
0decc0f
# Run the test suite
0decc0f
%check
0decc0f
pushd .%{gem_instdir}
0decc0f
0decc0f
popd
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%files
0decc0f
%dir %{gem_instdir}
0decc0f
%{_bindir}/sequel
0decc0f
%{gem_instdir}/bin/sequel
0decc0f
%exclude %{gem_dir}/bin/sequel
0decc0f
%{gem_libdir}
0decc0f
%exclude %{gem_cache}
204fcb0
%{gem_spec}
0decc0f
%{gem_instdir}/Rakefile
0decc0f
%doc %{gem_instdir}/MIT-LICENSE
Alejandro Pérez e2994e7
Alejandro Pérez e2994e7
%files doc
3f65c15
%doc %{gem_docdir}
0decc0f
%doc %{gem_instdir}/README.rdoc
0decc0f
%doc %{gem_instdir}/CHANGELOG
0decc0f
%{gem_instdir}/doc/
0decc0f
%{gem_instdir}/spec/
410f5d3
Alejandro Pérez e2994e7
%changelog
bef8f55
* Thu Oct 5 2017 Alejandro Perez <alejandro.perez.torres@gmail.com> - 5.1.0-1
Alejandro Pérez e2994e7
- Initial package