%global gem_name angular-rails %if 0%{?rhel} <= 6 && 0%{?fedora} <= 16 %global rubyabi 1.8 %if 0%{?rhel} %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %global gem_libdir %{gem_instdir}/lib %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_spec %{gem_dir}/specifications/%%{gem_name}-%{version}.gemspec %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %endif %else %global rubyabi 1.9.1 %endif Summary: Helpers for angularjs in a rails project Name: rubygem-%{gem_name} Version: 0.0.12 Release: 1%{?dist} Group: Development/Languages License: MIT URL: http://github.com/ludicast/angular-rails Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem Requires: ruby(abi) = %{rubyabi} Requires: ruby(rubygems) Requires: ruby Requires: rubygem(rails) Requires: rubygem(coffee-script) => 2.2.0 Requires: rubygem(coffee-script) < 2.3 BuildRequires: ruby(abi) = %{rubyabi} BuildRequires: rubygems-devel BuildRequires: ruby BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} %description Helpers for angularjs in a rails project (ripped from backbone-rails) %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 mkdir -p ./%{gem_dir} # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec export CONFIGURE_ARGS="--with-cflags='%{optflags}'" # gem install compiles any C extensions and installs into a directory # We set that to be a local directory so that we can move it into the # buildroot in %%install gem install -V \ --local \ --install-dir ./%{gem_dir} \ --bindir ./%{_bindir} \ --force \ --rdoc \ %{gem_name}-%{version}.gem %install mkdir -p %{buildroot}%{gem_dir} cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ %files %doc %{gem_instdir}/MIT-LICENSE %doc %{gem_instdir}/README.md %doc %{gem_instdir}/Rakefile %dir %{gem_instdir} %{gem_instdir}/test %{gem_instdir}/vendor %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %changelog * Tue Mar 01 2013 Adam Miller - 0.0.12-1 - Initial package