Blob Blame History Raw
%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}

# Generated from mime-types-1.16.gem by gem2rpm -*- rpm-spec -*-
%global gem_name mime-types

Summary: The mime-types library provides a library
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 3.1
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: https://github.com/mime-types/ruby-mime-types/
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem

Requires:      %{?scl_prefix_ruby}ruby(release)
Requires:      %{?scl_prefix_ruby}ruby(rubygems)
Requires:      %{?scl_prefix}rubygem(mime-types-data) >= 3.2015
BuildRequires: %{?scl_prefix_ruby}ruby
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
BuildRequires: %{?scl_prefix_ruby}ruby(release)
BuildRequires: %{?scl_prefix_ruby}ruby(rubygems)
BuildRequires: %{?scl_prefix_ruby}rubygem(minitest)
BuildRequires: %{?scl_prefix}rubygem(mime-types-data) >= 3.2015
BuildArch: noarch
Provides:      %{?scl_prefix}rubygem(%{gem_name}) = %{version}

# Explicitly require runtime subpackage, as long as older scl-utils do not generate it
%{?scl:Requires: %{?scl_prefix}runtime}

%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 %{pkg_name}
Group: Documentation

Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}

%description doc
This package contains documentation for %{pkg_name}.

%prep
%setup -n %{pkg_name}-%{version} -q -c -T

%{?scl:scl enable %{scl} - << \EOF}
%gem_install -n %{SOURCE0}
%{?scl:EOF}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/

# These aren't executables
find %{buildroot}%{gem_instdir}/{Rakefile,test} -type f | \
  xargs -n 1 sed -i  -e '/^#! \/usr\/bin\/env .*/d'

%check
pushd .%{gem_instdir}

# We don't have these rubygem packages in Fedora yet.
sed -i '7,11s/^/#/' test/minitest_helper.rb

# Add assert_has_keys manually not to load minitest-bonus-assertions.
# https://github.com/halostatue/minitest-bonus-assertions/blob/v2.0/lib/minitest-bonus-assertions.rb#L53-57
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

# We don't have minitest-hooks in Fedora yet.
mv test/test_mime_types_cache.rb{,.disable}

%{?scl:scl enable %{scl} - << \EOF}
ruby -Ilib:test -rminitest/autorun -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
%{?scl:EOF}

popd

%files
# There is no %%license macro on RHEL6.
# https://bugzilla.redhat.com/show_bug.cgi?id=1386246
%{!?_licensedir:%global license %%doc}

%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
* Mon Oct 17 2016 Jun Aruga <jaruga@redhat.com> - 3.1-1
- Update to mime-types 3.1.

* Thu Feb 25 2016 Pavel Valena <pvalena@redhat.com> - 1.25.1-4
- Rebuilt for rh-ror42

* Fri Jan 16 2015 Josef Stribny <jstribny@redhat.com> - 1.25.1-1
- Update to 1.25.1

* Fri Mar 21 2014 Vít Ondruch <vondruch@redhat.com> - 1.19-4
- Rebuid against new scl-utils to depend on -runtime package.
  Resolves: rhbz#1069109

* Thu Jan 23 2014 Vít Ondruch <vondruch@redhat.com> - 1.19-3
- Fix ruby prefix macro.

* Thu Jun 20 2013 Josef Stribny <jstribny@redhat.com> - 1.19-2
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

* Thu Jul 26 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.19-1
- Update to Mime-Types 1.19.
- Specfile cleanup

* Tue Apr 03 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.18-1
- Rebuilt for scl.
- Updated to 1.18.

* Tue Jan 31 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.16-7
- Rebuilt for Ruby 1.9.3.

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.16-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Aug 08 2011 Mo Morsi <mmorsi@redhat.com> - 1.16-5
- Replace BR(check) with BR

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Dec 30 2009 Matthew Kent <mkent@magoazul.com> - 1.16-3
- Remove needless rcov task in Rakefile causing issue (#544964).

* Sun Dec 27 2009 Matthew Kent <mkent@magoazul.com> - 1.16-2
- Fix license (#544964).
- Add note about rcov warning in test phase (#544964).

* Sun Dec 06 2009 Matthew Kent <mkent@magoazul.com> - 1.16-1
- Initial package