rubygem-liquid/rubygem-liquid.spec
2020-08-18 16:32:37 +08:00

67 lines
2.1 KiB
RPMSpec

%global gem_name liquid
Name: rubygem-%{gem_name}
Summary: Secure, non-evaling end user template engine
Version: 4.0.3
Release: 1
License: MIT
URL: http://www.liquidmarkup.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Patch1: 01-test-unit-context-disable-stack-profiler.patch
Patch2: 02-test-helper-remove-shebang-and-executable-bit.patch
BuildArch: noarch
BuildRequires: ruby(release) ruby >= 2.1.0 rubygems-devel >= 1.3.7
BuildRequires: rubygem(bigdecimal) rubygem(minitest)
Requires: rubygem(bigdecimal)
%description
Liquid is a template engine which was written with very specific requirements:
* It has to have beautiful and simple markup. Template engines which don't
produce good looking markup are no fun to use.
* It needs to be non evaling and secure. Liquid templates are made so that
users can edit them. You don't want to run code on your server which your
users wrote.
* It has to be stateless. Compile and render steps have to be separate so that
the expensive parsing and compiling can be done once and later on you can
just render it passing in a hash with local variables and objects.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version}
%patch1 -p1
%patch2 -p1
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
ruby -I"lib:test" -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd
%files
%license %{gem_instdir}/LICENSE
%dir %{gem_instdir}
%{gem_libdir}
%{gem_spec}
%exclude %{gem_cache}
%files doc
%doc %{gem_instdir}/History.md
%doc %{gem_instdir}/README.md
%doc %{gem_docdir}
%{gem_instdir}/test
%changelog
* Thu Jul 30 2020 wutao <wutao61@huawei.com> - 4.0.3-1
- package init