diff --git a/mime-types-3.1.gem b/mime-types-3.1.gem new file mode 100644 index 0000000..142b7d6 Binary files /dev/null and b/mime-types-3.1.gem differ diff --git a/rubygem-mime-types.spec b/rubygem-mime-types.spec new file mode 100644 index 0000000..bb8f5c8 --- /dev/null +++ b/rubygem-mime-types.spec @@ -0,0 +1,79 @@ +%global gem_name mime-types +Summary: The mime-types library provides a library +Name: rubygem-%{gem_name} +Version: 3.1 +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.rdoc +%dir %{gem_instdir} +%exclude %{gem_instdir}/.* +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_instdir}/Code-of-Conduct.rdoc +%doc %{gem_instdir}/Contributing.rdoc +%doc %{gem_instdir}/History.rdoc +%doc %{gem_instdir}/README.rdoc +%{gem_instdir}/Rakefile +%{gem_instdir}/Manifest.txt +%{gem_instdir}/test +%doc %{gem_docdir} + +%changelog +* Fri Aug 7 2020 yanan li - 3.1 3.0-1 +- Package init diff --git a/rubygem-mime-types.yaml b/rubygem-mime-types.yaml new file mode 100644 index 0000000..ebf7594 --- /dev/null +++ b/rubygem-mime-types.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/mime-types/ruby-mime-types/.git +version_control: github +src_repo: mime-types/ruby-mime-types +tag_prefix: "^v" +seperator: "."