a2fc50c
%define gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
a2fc50c
%define gemname yard
a2fc50c
%define geminstdir %{gemdir}/gems/%{gemname}-%{version}
a2fc50c
a2fc50c
%define rubyabi 1.8 
a2fc50c
a2fc50c
Name: rubygem-%{gemname}
a2fc50c
Summary: Documentation tool for consistent and usable documentation in Ruby
a2fc50c
Version: 0.5.3
a2fc50c
Release: 3%{?dist}
a2fc50c
Group: Development/Languages
a2fc50c
License: MIT and (GPLv2 or Ruby)
a2fc50c
URL: http://yardoc.org
a2fc50c
a2fc50c
Source0: http://gemcutter.org/downloads/%{gemname}-%{version}.gem
a2fc50c
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
a2fc50c
Requires: rubygems
a2fc50c
Requires: ruby(abi) = %{rubyabi}
a2fc50c
BuildRequires: rubygems
a2fc50c
BuildRequires(check): rubygem(rake)
a2fc50c
BuildRequires(check): rubygem(rspec)
a2fc50c
BuildRequires(check): rubygem(RedCloth)
a2fc50c
BuildArch: noarch
a2fc50c
Provides: rubygem(%{gemname}) = %{version}
a2fc50c
a2fc50c
%description
a2fc50c
YARD is a documentation generation tool for the Ruby programming language.
a2fc50c
It enables the user to generate consistent, usable documentation that can be
a2fc50c
exported to a number of formats very easily, and also supports extending for
a2fc50c
custom Ruby constructs such as custom class level definitions.
a2fc50c
a2fc50c
a2fc50c
%prep
a2fc50c
%setup -q -T -c
a2fc50c
a2fc50c
%build
a2fc50c
a2fc50c
%install
a2fc50c
rm -rf %{buildroot}
a2fc50c
mkdir -p %{buildroot}%{gemdir}
a2fc50c
mkdir -p %{buildroot}/%{_bindir}
a2fc50c
a2fc50c
gem install --local --install-dir ./%{gemdir} \
a2fc50c
            --force --rdoc %{SOURCE0}
a2fc50c
cp -a ./%{gemdir}/* %{buildroot}/%{gemdir}/. 
a2fc50c
mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
a2fc50c
rmdir %{buildroot}%{gemdir}/bin
a2fc50c
find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
a2fc50c
a2fc50c
%clean
a2fc50c
rm -rf %{buildroot}
a2fc50c
a2fc50c
%check
a2fc50c
pushd .%{geminstdir} 
a2fc50c
rake spec || : 
a2fc50c
a2fc50c
%files
a2fc50c
%defattr(-, root, root, -)
a2fc50c
%{_bindir}/yardoc
a2fc50c
%{_bindir}/yri
a2fc50c
%{_bindir}/yard-graph
a2fc50c
%dir %{geminstdir} 
a2fc50c
%{geminstdir}/bin
a2fc50c
%{geminstdir}/lib
a2fc50c
%{geminstdir}/templates
a2fc50c
%{geminstdir}/.yardopts
a2fc50c
a2fc50c
%{gemdir}/cache/%{gemname}-%{version}.gem
a2fc50c
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
a2fc50c
a2fc50c
%doc %{geminstdir}/LICENSE 
a2fc50c
%doc %{geminstdir}/README.md
a2fc50c
%doc %{geminstdir}/Rakefile
a2fc50c
%doc %{geminstdir}/ChangeLog
a2fc50c
%doc %{geminstdir}/benchmarks 
a2fc50c
%doc %{geminstdir}/spec
a2fc50c
%doc %{geminstdir}/docs
a2fc50c
%doc %{gemdir}/doc/%{gemname}-%{version}
a2fc50c
a2fc50c
a2fc50c
%changelog
a2fc50c
* Mon Feb 22 2010 Mohammed Morsi <mmorsi@redhat.com> - 0.5.3-3
a2fc50c
- fixed dependencies/package issues according to guidelines
a2fc50c
a2fc50c
* Mon Feb 08 2010 Mohammed Morsi <mmorsi@redhat.com> - 0.5.3-2
a2fc50c
- cleaned up macros, other package guideline compliance fixes
a2fc50c
- corrected license, added MIT
a2fc50c
- include all files and docs, added check/test section
a2fc50c
a2fc50c
* Mon Feb 08 2010 Mohammed Morsi <mmorsi@redhat.com> - 0.5.3-1
a2fc50c
- Initial package
a2fc50c