65 lines
1.7 KiB
RPMSpec
65 lines
1.7 KiB
RPMSpec
|
|
%global gem_name rubyzip
|
||
|
|
Name: rubygem-%{gem_name}
|
||
|
|
Version: 1.1.7
|
||
|
|
Release: 1
|
||
|
|
Summary: A ruby module for reading and writing zip files
|
||
|
|
License: Ruby or BSD
|
||
|
|
URL: http://github.com/rubyzip/rubyzip
|
||
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||
|
|
# CVE-2019-16892 denial of service via crafted ZIP file.
|
||
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1771298
|
||
|
|
# https://github.com/rubyzip/rubyzip/pull/403
|
||
|
|
Patch0: rubygem-rubyzip-1.3.0-CVE-2019-16892-Validate-entry-sizes-when-extracting.patch
|
||
|
|
BuildRequires: ruby(release) rubygems-devel ruby rubygem(minitest)
|
||
|
|
BuildArch: noarch
|
||
|
|
%description
|
||
|
|
A ruby module for reading and writing zip files.
|
||
|
|
|
||
|
|
%package doc
|
||
|
|
Summary: Documentation for %{name}
|
||
|
|
Requires: %{name} = %{version}-%{release}
|
||
|
|
BuildArch: noarch
|
||
|
|
%description doc
|
||
|
|
Documentation for %{name}.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%setup -q -c -T
|
||
|
|
%gem_install -n %{SOURCE0}
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
%patch0 -p1
|
||
|
|
popd
|
||
|
|
|
||
|
|
%build
|
||
|
|
|
||
|
|
%install
|
||
|
|
mkdir -p %{buildroot}%{gem_dir}
|
||
|
|
cp -a .%{gem_dir}/* \
|
||
|
|
%{buildroot}%{gem_dir}/
|
||
|
|
# https://github.com/rubyzip/rubyzip/pull/228
|
||
|
|
chmod a-x %{buildroot}%{gem_libdir}/zip/*.rb
|
||
|
|
rm -f %{buildroot}%{gem_instdir}/samples/write_simple.rb
|
||
|
|
|
||
|
|
%check
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
sed -i '/simplecov/ s/^/#/' test/test_helper.rb
|
||
|
|
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
|
||
|
|
popd
|
||
|
|
|
||
|
|
%files
|
||
|
|
%dir %{gem_instdir}
|
||
|
|
%doc %{gem_instdir}/README.md
|
||
|
|
%{gem_libdir}
|
||
|
|
%exclude %{gem_cache}
|
||
|
|
%{gem_spec}
|
||
|
|
|
||
|
|
%files doc
|
||
|
|
%doc %{gem_docdir}
|
||
|
|
%{gem_instdir}/Rakefile
|
||
|
|
%doc %{gem_instdir}/TODO
|
||
|
|
%{gem_instdir}/samples
|
||
|
|
%{gem_instdir}/test
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Wed Aug 19 2020 xiezheng <xiezheng4@huawei.com> - 1.1.7-1
|
||
|
|
- package init
|