Blob Blame History Raw
# Generated from hocon-0.9.3.gem by gem2rpm -*- rpm-spec -*-
%global gem_name hocon

%if 0%{?el7}
%global enable_checks 0
%else
%global enable_checks 1
%endif

Name: rubygem-%{gem_name}
Version: 0.9.3
Release: 3%{?dist}
Summary: HOCON Config Library
Group: Development/Languages
License: ASL 2.0
URL: https://github.com/puppetlabs/ruby-hocon
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem

# https://github.com/puppetlabs/ruby-hocon/issues/65
# SOURCE1 contains the upstream project from github
# in particular this includes the spec directory which was not
# included in the gemfile.
# The following hash corresponds to 0.9.3 tag.
%global commit0 7defef5927bc79dd6d25e3dd2ac42b9e9876c67f
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Source1: https://github.com/puppetlabs/ruby-hocon/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz

BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby >= 1.9.0
%if 0%{?enable_checks}
BuildRequires: rubygem(rspec)
%endif
BuildArch: noarch
%if 0%{?el7}
Provides: rubygem(hocon) = %{version}-%{release}
%endif

%description
A port of the Java Typesafe Config
library to Ruby.
https://github.com/typesafehub/config

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

%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

# unpack only the spec files from SOURCE2.
tar zxf %{SOURCE1} ruby-hocon-7defef5927bc79dd6d25e3dd2ac42b9e9876c67f/spec --strip-components 1

%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 -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

%check
%if 0%{?enable_checks}
rspec spec/
%endif

%files
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.md

%changelog
* Mon Dec 14 2015 Steve Traylen <steve.traylen@cern.ch> - 0.9.3-3
- Remove references to fc21.

* Thu Dec 03 2015 Steve Traylen <steve.traylen@cern.ch> - 0.9.3-2
- Use spec tests from upstream source.

* Tue Nov 03 2015 Steve Traylen <steve.traylen@cern.ch> - 0.9.3-1
- Initial package