Blob Blame History Raw
%global gem_name rots

%global commitdate 20160208
%global commit 8c278ef4563b8a2f7bb8d45e0690046350387684
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: rubygem-%{gem_name}
Version: 0.2.2
Release: 1.%{commitdate}git%{shortcommit}%{?dist}
Summary: OpenID server for testing OpenID client implementations
Group: Development/Languages
License: MIT
URL: https://github.com/roman/rots
# To obtain this gem:
# git clone git://github.com/roman/rots.git
# cd rots
# git checkout 8c278ef4563b8a2f7bb8d45e0690046350387684
# gem build rots.gemspec
# mv rots-0.2.2.gem ..
Source0: %{gem_name}-%{version}.gem
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Requires: ruby(release)
Requires: ruby(rubygems)
%endif
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(rack)
BuildRequires: rubygem(ruby-openid)
BuildArch: noarch
%if 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif

# The ruby(release) package already provides a usable Ruby interpreter.
# Filter the extra /usr/bin/ruby requirement here.
%global __requires_exclude ^/usr/bin/ruby$

%description
Ruby OpenID Test Server (ROTS) provides a basic OpenID server made in top of
the Rack gem. With this small server, you can make dummy OpenID request for
testing purposes, the success of the response will depend on a parameter
given on the URL of the authentication request.


%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

# Fix shebang
sed -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/%{gem_name}

# Remove developer-only file.
rm Rakefile
sed -i "s|\"Rakefile\",||g" %{gem_name}.gemspec

# Remove dependency on bundler
sed -e "\|require 'bundler/setup'|d" -i spec/spec_helper.rb

%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

%gem_install

# Remove unnecessary gemspec
rm -rf .%{gem_instdir}/%{gem_name}.gemspec

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

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

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

%check
pushd .%{gem_instdir}
  rspec -Ilib spec
popd

%files
%dir %{gem_instdir}
%doc %{gem_instdir}/README
%{_bindir}/rots
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/AUTHORS
%exclude %{gem_instdir}/Rakefile
%exclude %{gem_instdir}/spec

%changelog
* Tue Feb 09 2016 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.2.2-1.20160208git8c278ef
- Update to latest upstream Git snapshot
- Update for latest Rubygem packaging guidelines (drop explicit
  Requires/Provides)

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

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-6.20131106gitbabb555
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-5.20131106gitbabb555
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Nov 11 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.2.1-4.20131106gitbabb555
- Adjust Description

* Sat Nov 09 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.2.1-3.20131106gitbabb555
- Adjust Description

* Sat Nov 09 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.2.1-2.20131106gitbabb555
- Adjust Summary and changelog

* Wed Nov 06 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.2.1-1
- Initial package, created with gem2rpm 0.9.2