Blob Blame History Raw
%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}

# Generated from globalid-0.3.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name globalid

%{?_with_bootstrap: %global bootstrap 1}

Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 0.3.6
Release: 2%{?dist}
Summary: Refer to any model with a URI: gid://app/class/id
Group: Development/Languages
License: MIT
URL: http://www.rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/rails/globalid.git && cd globalid
# git checkout v0.3.6
# tar czvf globalid-0.3.6-tests.tar.gz test/
Source1: %{gem_name}-%{version}-tests.tar.gz
# Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0.
# https://github.com/rails/globalid/commit/c1ef236
Patch0: rubygem-globalid-0.3.7-fix-fixnum-bignum-warnings.patch

Requires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby(rubygems)
Requires: %{?scl_prefix}rubygem(activesupport) >= 4.1.0
BuildRequires: %{?scl_prefix_ruby}ruby(release)
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
BuildRequires: %{?scl_prefix_ruby}ruby >= 1.9.3
%if ! 0%{?bootstrap}
BuildRequires: %{?scl_prefix}rubygem(activesupport) >= 4.1
BuildRequires: %{?scl_prefix}rubygem(activemodel) >= 4.1
BuildRequires: %{?scl_prefix}rubygem(railties) >= 4.1
%endif
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
URIs for your models makes it easy to pass references around.

%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}/

%if ! 0%{?bootstrap}
%check
pushd .%{gem_instdir}
tar xf %{SOURCE1}
cat %{PATCH0} | patch -p1
sed -i '1d' ./test/helper.rb
%{?scl:scl enable %{scl} - << \EOF}
ruby -Ilib:test -rforwardable -e "Dir.glob './test/cases/*test.rb', &method(:require)"
%{?scl:EOF}
popd
%endif

%files
# There is no %%license macro on RHEL6.
# https://bugzilla.redhat.com/show_bug.cgi?id=1386246
%{!?_licensedir:%global license %%doc}

%dir %{gem_instdir}
%{gem_libdir}
%license %{gem_instdir}/MIT-LICENSE
%{gem_instdir}/lib
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}

%changelog
* Tue Feb 14 2017 Jun Aruga <jaruga@redhat.com> - 0.3.6-2
- Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0.

* Tue Nov 08 2016 Jun Aruga <jaruga@redhat.com> - 0.3.6-1
- Update to 0.3.6

* Mon Feb 22 2016 Pavel Valena <pvalena@redhat.com> - 0.3.3-4
- Add scl macros

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

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

* Thu Mar 19 2015 Josef Stribny <jstribny@redhat.com> - 0.3.3-1
- Update to 0.3.3

* Tue Jan 06 2015 Josef Stribny <jstribny@redhat.com> - 0.3.0-1
- Initial package