Blob Blame History Raw
# Generated from coffee-script-2.2.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name coffee-script
%global rubyabi 1.9.1

Summary: Ruby CoffeeScript Compiler
Name: rubygem-%{gem_name}
Version: 2.2.0
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://github.com/josh/ruby-coffee-script
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
# To get the tests:
# git clone https://github.com/josh/ruby-coffee-script && cd ruby-coffee-script
# git checkout v2.2.0 && tar czf coffee-script-tests-2.2.0.tgz test/
Source1: coffee-script-tests-%{version}.tgz
# Proposed upstream https://github.com/josh/ruby-coffee-script/pull/16
# For initial report see https://github.com/josh/ruby-coffee-script/issues/15
Patch0: coffee-script-fix-newlines-in-tests.patch
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Requires: rubygem(coffee-script-source)
Requires: rubygem(execjs)
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(coffee-script-source)
BuildRequires: rubygem(execjs)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(therubyracer)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}

%description
Ruby CoffeeScript is a bridge to the JS CoffeeScript compiler.


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

%description doc
Documentation for %{name}

%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
            --force %{SOURCE0}

%build

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

%check
pushd .%{gem_instdir}
# unpack and patch the tests
tar xzf %{SOURCE1}
patch -p1 < %{PATCH0}

testrb -Ilib test
popd

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

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

%changelog
* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 2.2.0-1
- Initial package