# Generated from oversip-1.3.8.gem by gem2rpm -*- rpm-spec -*-
%global gem_name oversip

Name: rubygem-%{gem_name}
Version: 1.3.8
Release: 1%{?dist}
Summary: OverSIP (the SIP framework you dreamed about)
Group: Development/Languages
License: MIT
URL: http://www.oversip.net
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
#Requires: ruby(release)
Requires: ruby(abi) >= 1.9.1
Requires: ruby(rubygems) 
Requires: rubygem(eventmachine-le) >= 1.1.4
Requires: rubygem(iobuffer) >= 1.1.2
Requires: rubygem(posix_mq) >= 2.0.0
Requires: rubygem(em-posixmq) >= 0.2.3
Requires: rubygem(em-udns) >= 0.3.6
Requires: rubygem(escape_utils) >= 0.2.4
Requires: rubygem(term-ansicolor) 
Requires: rubygem(posix-spawn) >= 0.3.6
Requires: rubygem(em-synchrony) >= 1.0.2
#BuildRequires: ruby(release)
BuildRequires: ruby(abi)
BuildRequires: rubygems-devel 
BuildRequires: ruby-devel >= 1.9.2
BuildRequires: openssl-devel
BuildRequires: libev-devel
Provides: rubygem(%{gem_name}) = %{version}

%description
OverSIP is an async SIP proxy/server programmable in Ruby language. Some
features of OverSIP are:
- SIP transports: UDP, TCP, TLS and WebSocket.
- Full IPv4 and IPv6 support.
- RFC 3263: SIP DNS mechanism (NAPTR, SRV, A, AAAA) for failover and load
balancing based on DNS.
- RFC 5626: OverSIP is a perfect Outbound Edge Proxy, including an integrated
STUN server.
- Fully programmable in Ruby language (make SIP easy).
- Fast and efficient: OverSIP core is coded in C language.
OverSIP is build on top of EventMachine-LE async library which follows the
Reactor Design Pattern, allowing thousands of concurrent connections and
requests in a never-blocking fashion.


%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
export CFLAGS=-I/usr/include/libev
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

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

mkdir -p %{buildroot}%{gem_extdir_mri}/lib
# TODO: move the extensions
mv %{buildroot}%{gem_instdir}/lib/shared_object.so %{buildroot}%{gem_extdir_mri}/lib/

mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

%files
%dir %{gem_instdir}
%{_bindir}/oversip
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_instdir}/ext
%{gem_extdir_mri}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}

%changelog
* Thu Jul 04 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 1.3.8-1
- Initial package
