Blob Blame History Raw
# Generated from sprockets-rails-2.0.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name sprockets-rails

# Disable tests for this build due to broken rubygem-rack dep in rawhide
%global enable_test 1

Name: rubygem-%{gem_name}
Version: 2.0.1
Release: 2%{?dist}
Summary: Sprockets Rails integration
Group: Development/Languages
License: MIT
URL: https://github.com/rails/sprockets-rails
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# License file from the git repo
# https://github.com/rails/sprockets-rails/pull/75
Source1: LICENSE
# Get the tests
# git clone https://github.com/rails/sprockets-rails.git && cd sprockets-rails/
# git checkout v2.0.0
# tar czvf sprockets-rails-2.0.0-tests.tgz test/
Source2: sprockets-rails-%{version}-tests.tgz
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(sprockets) => 2.8
Requires: rubygem(sprockets) < 3
Requires: rubygem(actionpack) >= 3.0
Requires: rubygem(activesupport) >= 3.0
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
%if 0%{enable_test} > 0
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(rails) >= 3.0
BuildRequires: rubygem(rake)
%endif
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}

%description
Provides Sprockets implementation for Rails 4.x (and beyond) Asset Pipeline.


%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

# Move license into place
cp %{SOURCE1} .%{gem_instdir}/LICENSE

# Move the tests into place
tar xzvf %{SOURCE2} -C .%{gem_instdir}

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

%check
%if 0%{enable_test} > 0
pushd ./%{gem_instdir}
# Running the test suite separately works fine
testrb -Ilib test/test_helper.rb
testrb -Ilib test/test_task.rb

# We need minitest 4.7.5. Disable for now.
# https://github.com/seattlerb/minitest/pull/275
#testrb -Ilib test/test_railtie.rb
popd
%endif


%files
%dir %{gem_instdir}
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%doc %{gem_instdir}/LICENSE

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/test

%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Mar 07 2014 Josef Stribny <jstribny@redhat.com> - 2.0.1-1
- Update to 2.0.1

* Thu Aug 08 2013 Josef Stribny <jstribny@redhat.com> - 2.0.0-3
- Enable tests

* Wed Jul 31 2013 Josef Stribny <jstribny@redhat.com> - 2.0.0-2
- Disable tests for now due to broken deps in Rails

* Mon Jul 22 2013 Josef Stribny <jstribny@redhat.com> - 2.0.0-1
- Initial package