Blob Blame History Raw
# Generated from websocket-driver-0.3.4.gem by gem2rpm -*- rpm-spec -*-
%global gem_name websocket-driver

Name: rubygem-%{gem_name}
Version: 0.6.4
Release: 1%{?dist}
Summary: WebSocket protocol handler with pluggable I/O
Group: Development/Languages
License: MIT
URL: http://github.com/faye/websocket-driver-ruby
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/faye/websocket-driver-ruby.git
# cd websocket-driver-ruby && git checkout 0.6.4
# tar czvf websocket-driver-ruby-0.6.4-tests.tgz spec/
Source1: websocket-driver-ruby-%{version}-tests.tgz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
BuildRequires: rubygem(websocket-extensions)
BuildRequires: rubygem(eventmachine)
BuildRequires: rubygem(rake-compiler)
BuildRequires: rubygem(rspec)

%if 0%{?fedora} <= 20
Requires: ruby(release)
Requires: ruby(rubygems) 
Provides: rubygem(%{gem_name}) = %{version}
%endif

%description
This module provides a complete implementation of the WebSocket protocols that
can be hooked up to any TCP library. It aims to simplify things by decoupling
the protocol details from the I/O layer, such that users only need to implement
code to stream data in and out of it without needing to know anything about how
the protocol actually works. Think of it as a complete WebSocket system with
pluggable I/O.

%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

%build
gem build %{gem_name}.gemspec

%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}%{gem_extdir_mri}
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/

# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/

%check
pushd .%{gem_instdir}
tar xf %{SOURCE1}
# Bundler
sed -i -e '2d' examples/tcp_server.rb
sed -i -e '2d' spec/spec_helper.rb
rspec -I$(dirs +1)%{gem_extdir_mri} spec
popd

%files
%dir %{gem_instdir}
%{gem_libdir}
%{gem_extdir_mri}
%exclude %{gem_cache}
# Asking upstream to separate the license text.
# https://github.com/faye/websocket-driver-ruby/issues/44
%doc %{gem_instdir}/README.md
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%{gem_instdir}/examples

%changelog
* Thu Jul 07 2016 Jun Aruga <jaruga@redhat.com> - 0.6.4-1
- Update to websocket-driver 0.6.4.

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jan 11 2016 Pavel Valena <pvalena@redhat.com> - 0.3.4-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
- Correct attributes for websocket_mask.so

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Jan 18 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.3.4-2
- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_2.2

* Tue Jul 15 2014 Josef Stribny <jstribny@redhat.com> - 0.3.4-1
- Initial package