%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
%global git_url https://raw.githubusercontent.com/jekyll/%{gem_name}/master
%global gem_name jekyll-watch
Name: rubygem-%{gem_name}
Version: 1.5.0
Release: 1%{?dist}
Summary: Rebuild your Jekyll site when a file changes
License: MIT
URL: https://github.com/jekyll/%{gem_name}
Source0: https://rubygems.org/downloads/%{gem_name}-%{version}.gem
Source1: %{git_url}/History.markdown#/%{gem_name}-History.markdown
Source2: %{git_url}/LICENSE.txt#/%{gem_name}-LICENSE.txt
Source3: %{git_url}/README.md#/%{gem_name}-README.markdown
BuildArch: noarch
BuildRequires: rubygems-devel
%description
Rebuild your Jekyll site when a file changes with the `--watch` switch!
%package doc
Summary: Documentation files for %{name}
%description doc
This package contains the documentation files for %{name}.
%prep
%{__rm} -rf %{gem_name}-%{version}
%{_bindir}/gem unpack %{SOURCE0}
%setup -DTqn %{gem_name}-%{version}
%{_bindir}/gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
%{_bindir}/gem build %{gem_name}.gemspec
%gem_install
%install
%{__mkdir} -p %{buildroot}%{gem_dir}
%{__cp} -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
%{__install} -pm0644 %{SOURCE1} ./History.markdown
%{__install} -pm0644 %{SOURCE2} ./LICENSE
%{__install} -pm0644 %{SOURCE3} ./README.markdown
%files
%exclude %{gem_cache}
%license LICENSE
%doc History.markdown README.markdown
%{gem_instdir}
%{gem_spec}
%files doc
%doc %{_pkgdocdir}
%doc %{gem_docdir}
%changelog
* Tue Aug 23 2016 Björn Esser <fedora@besser82.io> - 1.5.0-1
- initial import (#1368847)
* Sun Aug 21 2016 Björn Esser <fedora@besser82.io> - 1.5.0-0.1
- initial rpm-release (#1368847)