77 lines
1.8 KiB
RPMSpec
77 lines
1.8 KiB
RPMSpec
%global gem_name rails-html-sanitizer
|
|
|
|
Name: rubygem-%{gem_name}
|
|
Version: 1.4.2
|
|
Release: 2
|
|
Summary: This gem is responsible to sanitize HTML fragments in Rails applications
|
|
License: MIT
|
|
URL: https://github.com/rails/rails-html-sanitizer
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
#From: https://github.com/rails/rails-html-sanitizer/commit/45a5c10fed3d9aa141594c80afa06d748fa0967d
|
|
Patch0: 0001-fix-test-failures.patch
|
|
|
|
BuildRequires: ruby(release)
|
|
BuildRequires: rubygems-devel
|
|
BuildRequires: ruby
|
|
BuildRequires: rubygem(loofah)
|
|
BuildRequires: rubygem(minitest)
|
|
BuildRequires: rubygem(rails-dom-testing)
|
|
BuildArch: noarch
|
|
|
|
%description
|
|
HTML sanitization for Rails applications.
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
|
|
%description doc
|
|
Documentation for %{name}.
|
|
|
|
%prep
|
|
%autosetup -n %{gem_name}-%{version} -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}
|
|
sed -i '/def test_uri_escaping.*_in_a_tag_in_safe_list_sanitizer/,/^ end$/ {
|
|
s/</</g
|
|
s/>/>/g
|
|
}' \
|
|
test/sanitizer_test.rb
|
|
|
|
ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
|
|
popd
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%license %{gem_instdir}/MIT-LICENSE
|
|
%{gem_libdir}
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%files doc
|
|
%doc %{gem_docdir}
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
%doc %{gem_instdir}/README.md
|
|
%{gem_instdir}/test
|
|
|
|
%changelog
|
|
* Thu Jul 14 2022 baizhonggui <baizhonggui@h-partners.com> - 1.4.2-2
|
|
- Fix test failures
|
|
|
|
* Wed May 4 2022 wangkerong <wangkerong@h-partners.com> - 1.4.2-1
|
|
- Upgrade to 1.4.2
|
|
|
|
* Tue Aug 25 2020 huangyangke <huangyangke@huawei.com> - 1.0.4-1
|
|
- package init
|