%global pkg_name %{name}

%global gem_name graphql

Name: 		rubygem-%{gem_name}
Version: 	2.0.7
Release: 	1
Summary: 	A GraphQL language and runtime for Ruby
Group: 		Development/Languages
License: 	MIT
URL: 		http://github.com/rmosolgo/graphql-ruby
Source0: 	https://rubygems.org/gems/%{gem_name}-%{version}.gem

# start specfile generated dependencies
Requires: 	ruby(release)
Requires: 	ruby >= 2.2.0
Requires: 	ruby(rubygems)
BuildRequires: 	ruby(release)
BuildRequires: 	ruby >= 2.2.0
BuildRequires: 	rubygems-devel
BuildArch: 	noarch
Provides: 	rubygem(%{gem_name}) = %{version}
# end specfile generated dependencies

%description
A plain-Ruby implementation of GraphQL.


%package doc
Summary: 	Documentation for %{pkg_name}
Group: 		Documentation
Requires: 	%{pkg_name} = %{version}-%{release}
BuildArch: 	noarch

%description doc
Documentation for %{pkg_name}.

%prep
gem unpack %{SOURCE0}

%setup -q -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -pa .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.yardopts
%license %{gem_instdir}/MIT-LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/readme.md

%changelog
* Sun Apr 24 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 2.0.7-1
- Upgrade to 2.0.7

* Mon Jun 07 2021 liqiuyu <liqiuyu@kylinos.cn> - 1.8.14-1
- Init project