rubygem-multi_json/rubygem-multi_json.spec

93 lines
2.1 KiB
RPMSpec
Raw Normal View History

2021-06-07 15:43:15 +08:00
%global pkg_name %{name}
2020-08-28 14:18:44 +08:00
%global gem_name multi_json
2021-06-07 15:43:15 +08:00
Summary: A gem to provide swappable JSON backends
Name: rubygem-%{gem_name}
Version: 1.14.1
Release: 1
Group: Development/Languages
License: MIT
URL: https://github.com/intridea/multi_json
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: %{gem_name}-%{version}-tests.tgz
Source2: https://github.com/intridea/%{gem_name}/archive/refs/tags/%{gem_name}-%{version}.tar.gz
Requires: ruby(release)
BuildRequires: ruby(release)
Requires: ruby(rubygems)
Requires: ruby
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(json_pure)
BuildRequires: ruby(rubygems)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
# OkJson is allowed to be bundled:
Provides: bundled(okjson) = 20110719
2020-08-28 14:18:44 +08:00
%description
2021-06-07 15:43:15 +08:00
A gem to provide swappable JSON backends utilizing Yajl::Ruby, the JSON gem,
JSON pure, or a vendored version of okjson.
2020-08-28 14:18:44 +08:00
%package doc
2021-06-07 15:43:15 +08:00
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{pkg_name} = %{version}-%{release}
BuildArch: noarch
2020-08-28 14:18:44 +08:00
%description doc
2021-06-07 15:43:15 +08:00
Documentation for %{pkg_name}
2020-08-28 14:18:44 +08:00
%prep
%setup -q -c -T
%gem_install -n %{SOURCE0}
%build
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
tar xf %{SOURCE1}
sed -i '138,165 s/^/#/' spec/multi_json_spec.rb
sed -i "/expect(MultiJson.adapter.to_s).to eq('MultiJson::Adapters::Oj')/ s/Oj/JsonGem/" spec/multi_json_spec.rb
rspec spec/{multi_json,options_cache}_spec.rb
rm spec/{oj,yajl}_adapter_spec.rb
for adapter in spec/*_adapter_spec.rb; do
rspec $adapter
done
popd
%files
%dir %{gem_instdir}
2021-06-07 15:43:15 +08:00
%exclude %{gem_instdir}/.*
%doc %{gem_instdir}/LICENSE.md
2020-08-28 14:18:44 +08:00
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/CONTRIBUTING.md
2021-06-07 15:43:15 +08:00
%doc %{gem_instdir}/LICENSE.md
2020-08-28 14:18:44 +08:00
%doc %{gem_instdir}/README.md
2021-06-07 15:43:15 +08:00
2020-08-28 14:18:44 +08:00
%changelog
2021-06-07 15:43:15 +08:00
* Mon Jun 07 2021 jiangxinyu <jiangxinyu@kylinos.cn> - 1.14.1-1
- Update version to 1.14.1
2020-08-28 14:18:44 +08:00
* Sat Aug 22 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.13.1-1
- Package init