%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}
# Generated from websocket-extensions-0.1.2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name websocket-extensions
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 0.1.2
Release: 2%{?dist}
Summary: Generic extension manager for WebSocket connections
Group: Development/Languages
License: MIT
URL: http://github.com/faye/websocket-extensions-ruby
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/faye/websocket-extensions-ruby.git && \
# cd websocket-extensions-ruby
# git checkout 0.1.2
# tar -czf rubygem-websocket-extensions-0.1.2-specs.tgz spec/
Source1: rubygem-websocket-extensions-0.1.2-specs.tgz
Requires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby(rubygems)
BuildRequires: %{?scl_prefix_ruby}ruby(release)
BuildRequires: %{?scl_prefix_ruby}ruby(rubygems)
BuildRequires: %{?scl_prefix_ruby}ruby
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
BuildRequires: %{?scl_prefix}rubygem(rspec)
BuildArch: noarch
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
# Explicitly require runtime subpackage, as long as older scl-utils do not generate it
%{?scl:Requires: %{?scl_prefix}runtime}
%description
Generic extension manager for WebSocket connections.
%package doc
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{pkg_name}.
%prep
%{?scl:scl enable %{scl} - << \EOF}
set -e
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%{?scl:EOF}
%build
%{?scl:scl enable %{scl} - << \EOF}
set -e
gem build %{gem_name}.gemspec
%gem_install
%{?scl:EOF}
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
# Run the test suite
%check
pushd .%{gem_instdir}
tar -xzf %{SOURCE1}
%{?scl:scl enable %{scl} - << \EOF}
rspec spec
%{?scl:EOF}
popd
%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.*
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
# License text is included in README.md
# Now asking to upstream to separate the license text.
# https://github.com/faye/websocket-extensions-ruby/pull/2
%doc %{gem_instdir}/README.md
%changelog
* Wed Feb 15 2017 Jun Aruga <jaruga@redhat.com> - 0.1.2-2
- Add "set -e".
* Mon Mar 14 2016 Jun Aruga <jaruga@redhat.com> - 0.1.2-1
- Initial package