File rubygem-ruby_engine.spec of Package rubygem-ruby_engine

%global gem_name ruby_engine

Name:           rubygem-%{gem_name}
Version:        1.0.1
Release:        2%{?dist}
Summary:        Adds the RubyEngine pseudo-constant

Group:          Development/Languages
License:        MIT
URL:            https://github.com/janlelis/ruby_engine
Source0:        https://rubygems.org/gems/%{gem_name}-%{version}.gem

BuildArch:      noarch
BuildRequires:  rubygems-devel
BuildRequires:  rubygem(rspec)
%if 0%{?rhel} && 0%{?rhel} <= 7
Requires:       ruby(rubygems)
Provides:       rubygem(%{gem_name}) = %{version}
%endif

%description
Gives you an RubyEngine class that simplifies checking for your Ruby
implementation.


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

%description doc
Documentation for %{name}.


%prep
gem unpack %{SOURCE0}

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

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


%build
gem build %{gem_name}.gemspec

%gem_install


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


%check
pushd .%{gem_instdir}
rspec -Ilib
popd


%files
%if 0%{?rhel} >= 7
%license %{gem_instdir}/LICENSE.txt
%else
%doc %{gem_instdir}/LICENSE.txt
%endif
%dir %{gem_instdir}/
%{gem_libdir}/
%{gem_spec}
%exclude %{gem_instdir}/pkg/
%exclude %{gem_instdir}/spec/
%exclude %{gem_instdir}/.gitignore
%exclude %{gem_instdir}/.rspec
%exclude %{gem_instdir}/.travis.yml
%exclude %{gem_instdir}/Gemfile
%exclude %{gem_instdir}/Gemfile.lock
%exclude %{gem_instdir}/Rakefile
%exclude %{gem_instdir}/ruby_engine.gemspec
%exclude %{gem_cache}

%files doc
%doc %{gem_docdir}/
%doc %{gem_instdir}/ChangeLog.rdoc
%doc %{gem_instdir}/README.rdoc


%changelog
* Mon Jan 23 2017 František Dvořák <valtri@civ.zcu.cz> - 1.0.1-2
- Exclude unnecessary files

* Thu Jan 12 2017 František Dvořák <valtri@civ.zcu.cz> - 1.0.1-1
- Initial package