rubygem-mustache/rubygem-mustache.spec

160 lines
4.4 KiB
RPMSpec

%global gem_name mustache
%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: Framework-agnostic way to render logic-free views
Name: rubygem-%{gem_name}
Version: 0.99.4
Release: 6%{?dist}
Group: Development/Languages
License: MIT
URL: http://github.com/defunkt/mustache
Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
# Executable fails with Ruby 1.9.3.
# https://bugzilla.redhat.com/show_bug.cgi?id=859025
# https://github.com/defunkt/mustache/pull/116
Patch0: mustache-0.99.4-fix-mustache-executable-for-ruby193.patch
Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
%if 0%{?fedora}
BuildRequires: rubygems-devel
%else
BuildRequires: rubygems
%endif
BuildRequires: ruby
BuildRequires: rubygem(minitest)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
%description
Think of Mustache as a replacement for your views.
Instead of views consisting of ERB or HAML with random helpers
and arbitrary logic, your views are broken into two parts:
a Ruby class and an HTML template.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires:%{name} = %{version}-%{release}
%description doc
Documentation for %{name}
%prep
%setup -q -c -T
mkdir -p .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
--bindir .%{_bindir} \
--force %{SOURCE0}
pushd .%{gem_instdir}
%patch0 -p1
popd
%build
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
# Install man pages
mkdir -p %{buildroot}%{_mandir}/man5
cp -a .%{gem_instdir}/man/mustache.5 %{buildroot}%{_mandir}/man5
mkdir -p %{buildroot}%{_mandir}/man1
cp -a .%{gem_instdir}/man/mustache.1 %{buildroot}%{_mandir}/man1
# Install documentation
cp -a .%{gem_instdir}/man/*.html .
%check
pushd %{buildroot}/%{gem_instdir}
export LANG=en_US.utf8
testrb -Ilib test/*_test.rb
popd
%files
%dir %{gem_instdir}
%doc *.html
%{gem_libdir}
%{gem_instdir}/bin
%{_bindir}/mustache
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/LICENSE
%exclude %{gem_cache}
%{gem_spec}
%{gem_instdir}/man
%doc %{_mandir}/man1/*
%doc %{_mandir}/man5/*
%files doc
%{gem_instdir}/Rakefile
%doc %{gem_docdir}
%{gem_instdir}/test
%changelog
* Thu Sep 20 2012 Vít Ondruch <vondruch@redhat.com> - 0.99.4-6
- Fix mustache executable for Ruby 1.9.3 (rhbz#859025).
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Apr 17 2012 Vít Ondruch <vondruch@redhat.com> - 0.99.4-4
- Compatibility fixes with older Fedoras and RHELs.
- Add missing .gemspec.
* Fri Jan 20 2012 Vít Ondruch <vondruch@redhat.com> - 0.99.4-3
- Rebuilt for Ruby 1.9.3.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Jul 27 2011 Vít Ondruch <vondruch@redhat.com> - 0.99.4-1
- Update to Mustache 0.99.4
- Dropped optional Sinatra dependency.
- Removed deprecated %%clean section.
- Added man pages.
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Nov 10 2010 Jozef Zigmund <jzigmund@redhat.com> - 0.11.2-4
- Corrected ruby(abi) require
* Mon Nov 8 2010 Jozef Zigmund <jzigmund@redhat.com> - 0.11.2-3
- Added README.md, LICENSE with macro doc
- Replaced macro {gemdir}/gems/{gemname}-{version}/ by macro dir {geminstdir}
- Added lib, bin to macro {geminstdir}
- Added subpackage doc with folders: man, test and doc
* Mon Oct 18 2010 Jozef Zigmund <jzigmund@redhat.com> - 0.11.2-2
- Repair URL Source0
- Remove "Mustache is a" from Summary
- Add Require: rubygem(sinatra)
* Mon Oct 18 2010 Jozef Zigmund <jzigmund@redhat.com> - 0.11.2-1
- Initial package