%global gem_name mime-types Summary: The mime-types library provides a library Name: rubygem-%{gem_name} Version: 3.5.2 Release: 1 License: MIT URL: https://github.com/mime-types/ruby-mime-types/ Source0: https://rubygems.org/gems/mime-types-%{version}.gem BuildRequires: rubygems-devel ruby(release) ruby >= 2.0 rubygem(mime-types-data) BuildRequires: rubygem(minitest) BuildArch: noarch %description The mime-types library provides a library and registry for information about MIME content type definitions. It can be used to determine defined filename extensions for MIME types, or to use filename extensions to look up the likely MIME type definitions. Version 3.0 is a major release that requires Ruby 2.0 compatibility and removes deprecated functions. The columnar registry format introduced in 2.6 has been made the primary format; the registry data has been extracted from this library and put into {mime-types-data}[https://github.com/mime-types/mime-types-data]. Additionally, mime-types is now licensed exclusively under the MIT licence and there is a code of conduct in effect. There are a number of other smaller changes described in the History file. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} %description doc This package contains documentation for %{name}. %prep %setup -q -c -T %gem_install -n %{SOURCE0} %build %install rm -rf %{buildroot} mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/ find %{buildroot}%{gem_instdir}/{Rakefile,test} -type f | \ xargs -n 1 sed -i -e '/^#! \/usr\/bin\/env .*/d' %check pushd .%{gem_instdir} sed -i '7,11s/^/#/' test/minitest_helper.rb cat << EOF >> test/minitest_helper.rb def assert_has_keys obj, keys, msg = nil keys = [ keys ] unless keys.kind_of?(Array) keys.all? { |key| assert obj.key?(key) } end EOF mv test/test_mime_types_cache.rb{,.disable} ruby -Ilib:test -rminitest/autorun -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' popd %files %license %{gem_instdir}/Licence.md %dir %{gem_instdir} %exclude %{gem_instdir}/.* %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_instdir}/Code-of-Conduct.md %doc %{gem_instdir}/Contributing.md %doc %{gem_instdir}/History.md %doc %{gem_instdir}/README.rdoc %{gem_instdir}/Rakefile %{gem_instdir}/Manifest.txt %{gem_instdir}/test %doc %{gem_docdir} %changelog * Mon Jan 22 2024 Paul Thomas - 3.5.2-1 - update to version 3.5.2 * Wed Jun 29 2022 xu_ping - 3.4.1-1 - Upgrade 3.4.1 * Sat Jan 22 2022 liyanan - 3.1-2 - fix build error * Fri Aug 7 2020 yanan li - 3.1 3.0-1 - Package init