8b6b5dd
%global gem_name asciidoctor
c049479
%global mandir %{_mandir}/man1
8b6b5dd
5ac83d7
Summary: AsciiDoc implementation in Ruby
8b6b5dd
Name: rubygem-%{gem_name}
39eeeb0
Version: 0.1.1
8b6b5dd
Release: 1%{?dist}
8b6b5dd
Group: Development/Languages
8b6b5dd
License: MIT
cbc47f8
URL: http://github.com/asciidoctor/asciidoctor
8b6b5dd
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
5c09b9a
# Patch0: disables use of pending statement in the test suite The required gem,
5c09b9a
# pending, is not packaged in Fedora and since the statement is merely a task
5c09b9a
# note, it's safe to disable it's usage for the purpose of packaging.
5ac83d7
Patch0: asciidoctor-disable-use-of-pending.patch
a1c88dd
# Patch1: works around nth-child selector bug in Nokogiri
a1c88dd
Patch1: asciidoctor-fix-nth-child-selectors.patch
558b60f
%if 0%{?fedora} <= 18
558b60f
Requires: ruby(abi) = 1.9.1
558b60f
BuildRequires: ruby(abi) = 1.9.1
558b60f
%else
94e044f
Requires: ruby(release)
558b60f
BuildRequires: ruby(release)
558b60f
%endif
5ac83d7
Requires: ruby(rubygems)
5ac83d7
BuildRequires: rubygems-devel
3ea83d2
BuildRequires: ruby(rubygems)
5ac83d7
BuildRequires: rubygem(coderay)
5ac83d7
BuildRequires: rubygem(erubis)
5ac83d7
BuildRequires: rubygem(htmlentities)
8b6b5dd
BuildRequires: rubygem(mocha)
8d3ce3f
BuildRequires: rubygem(minitest)
8b6b5dd
BuildRequires: rubygem(nokogiri)
8b6b5dd
# using patch to comment lines where pending is used
8b6b5dd
#BuildRequires: rubygem(pending)
8b6b5dd
BuildArch: noarch
8b6b5dd
Provides: rubygem(%{gem_name}) = %{version}
8b6b5dd
8b6b5dd
%description
c049479
A pure AsciiDoc implementation in Ruby for parsing AsciiDoc source files and
c049479
strings and then rendering them as HTML, DocBook or other formats using the
c049479
built-in ERB templates or a set of custom Tilt-supported template files.
8b6b5dd
8b6b5dd
%package doc
8b6b5dd
Summary: Documentation for %{name}
8b6b5dd
Group: Documentation
8b6b5dd
Requires: %{name} = %{version}-%{release}
8b6b5dd
BuildArch: noarch
8b6b5dd
8b6b5dd
%description doc
8b6b5dd
Documentation for %{name}
8b6b5dd
8b6b5dd
%prep
721716d
gem unpack -V %{SOURCE0}
721716d
%setup -q -D -T -n %{gem_name}-%{version}
8d3ce3f
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
721716d
%patch0 -p1
a1c88dd
%patch1 -p1
8b6b5dd
8b6b5dd
%build
8d3ce3f
gem build %{gem_name}.gemspec
558b60f
%gem_install
8b6b5dd
8b6b5dd
%check
8d3ce3f
LANG=en_US.utf8 testrb -Ilib test/*_test.rb
8b6b5dd
8b6b5dd
%install
c049479
mkdir -p %{buildroot}%{gem_dir}
c049479
cp -pa .%{gem_dir}/* \
c049479
        %{buildroot}%{gem_dir}/
721716d
4464fc0
mkdir -p %{buildroot}%{_bindir}
c049479
cp -pa .%{_bindir}/* \
c049479
        %{buildroot}%{_bindir}/
c049479
c049479
mkdir -p %{buildroot}%{mandir}
c049479
cp -pa .%{gem_instdir}/man/*.1 \
c049479
        %{buildroot}%{mandir}/
8b6b5dd
8b6b5dd
%files
8b6b5dd
%dir %{gem_instdir}
c049479
%exclude %{gem_cache}
c049479
%exclude %{gem_instdir}/%{gem_name}.gemspec
c049479
%exclude %{gem_instdir}/Gemfile
c049479
%exclude %{gem_instdir}/Rakefile
c049479
%exclude %{gem_instdir}/test
c049479
%exclude %{gem_instdir}/man
721716d
%{gem_instdir}/LICENSE
c049479
%{gem_instdir}/README.*
c049479
%{_bindir}/*
c049479
%{gem_instdir}/bin
8b6b5dd
%{gem_libdir}
c049479
%{mandir}/*
8b6b5dd
%{gem_spec}
8b6b5dd
8b6b5dd
%files doc
721716d
%doc %{gem_docdir}
8b6b5dd
8b6b5dd
%changelog
39eeeb0
* Fri Mar 01 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.1-1
8b6b5dd
- Initial package