rubygem-mustache/rubygem-mustache.spec
lyn1001 78c946ae92 Fix build error
(cherry picked from commit ad5719ad3085ff10af8fd609300dc2597523c327)
2022-01-23 16:54:29 +08:00

78 lines
2.2 KiB
RPMSpec

%global gem_name mustache
Name: rubygem-mustache
Version: 1.0.2
Release: 8
Summary: A framework-agnostic way to render logic-free views
License: MIT
URL: https://github.com/mustache/mustache
Source0: https://rubygems.org/gems/mustache-%{version}.gem
Patch0: rubygem-mustache-1.0.2-Fix-test-race-condition.patch
BuildRequires: ruby(release) rubygems-devel ruby rubygem(minitest)
BuildArch: noarch
%description
Inspired by ctemplate and et, Mustache is a framework-agnostic way to render logic-free views.
As ctemplates says, "It emphasizes separating logic from presentation: it is impossible to embed
application logic in this template language."
%package help
Summary: Help documentation for rubygem-mustache
Requires: rubygem-mustache = %{version}-%{release}
Provides: rubygem-mustache-doc = %{version}-%{release}
Obsoletes: rubygem-mustache-doc < %{version}-%{release}
BuildArch: noarch
%description help
Documentation for rubygem-mustache.
%prep
%setup -q -c -T
%gem_install -n %{SOURCE0}
%patch0 -p1
%build
%install
install -d %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/
install -d %{buildroot}%{_bindir}
cp -a .%{_bindir}/* %{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
install -d %{buildroot}%{_mandir}/man5
cp -a .%{gem_instdir}/man/mustache.5 %{buildroot}%{_mandir}/man5
install -d %{buildroot}%{_mandir}/man1
cp -a .%{gem_instdir}/man/mustache.1 %{buildroot}%{_mandir}/man1
cp -a .%{gem_instdir}/man/*.html .
%check
cd .%{gem_instdir}
sed -r -i '/[Cc]ode[Cc]limate/ s/^/#/' test/helper.rb
LANG=en_US.utf8 ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
cd -
%files
%dir %{gem_instdir}
%{_bindir}/mustache
%doc %{gem_instdir}/LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_instdir}/man
%exclude %{gem_cache}
%{gem_spec}
%files help
%doc *.html
%doc %{_mandir}/man1/*
%doc %{_mandir}/man5/*
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/{Rakefile,test}
%changelog
* Sat Jan 22 2022 liyanan <liyanan32@huawei.com> - 1.0.2-8
- Fix build error
* Sat Mar 14 2020 Ling Yang <lingyang2@huawei.com> - 1.0.2-7
- Package Init