Blob Blame History Raw
# Generated from icalendar-1.1.0.gem by gem2rpm -*- rpm-spec -*-
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global gemname icalendar
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%global rubyabi 1.8

Summary: A ruby implementation of the iCalendar specification (RFC-2445)
Name: rubygem-%{gemname}
Version: 1.1.0
Release: 3%{?dist}
Group: Development/Languages
License: GPL+ or Ruby
URL: http://icalendar.rubyforge.org/
Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
# Patch also sent upstream by email 27-Jan-2009
Patch0: rubygem-icalendar-manage_gem.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby(abi) = %{rubyabi}
Requires: rubygems
BuildRequires: rubygems
BuildRequires: rubygem(rake)
BuildArch: noarch
Provides: rubygem(%{gemname}) = %{version}

%description
Implements the iCalendar specification (RFC-2445) in Ruby.  This allows for
the generation and parsing of .ics files, which are used by a variety of
calendaring applications.


%prep

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir}
gem install --local --install-dir %{buildroot}%{gemdir} \
            --force --rdoc %{SOURCE0}

# API documentation hasn't been written, 
# However the rdocs are there
rm -rf %{buildroot}%{geminstdir}/docs/api
# Test case that hasn't been written yet
rm -rf %{buildroot}%{geminstdir}/test/coverage

# Tidy up the file permissions
# The tests are run from the Rakefile
find %{buildroot}%{geminstdir}/test \
    -type f -name '*.rb' | xargs chmod 0644
find %{buildroot}%{geminstdir}/test \
     -type f -name '*.rb' | \
       xargs -n 1 sed -i -e '/^#!\/usr\/.*ruby.*/d'
# ... and the examples are valid scripts ...    
find %{buildroot}%{geminstdir}/examples \
    -type f -name '*.rb' | xargs chmod 0755
# ... and it's perfectly acceptable for users have read access to the
# source gem
chmod 644 %{buildroot}%{gemdir}/cache/%{gemname}-%{version}.gem

pushd %{buildroot}%{geminstdir}
patch -p1 < %{PATCH0}
popd

%clean
rm -rf %{buildroot}

%check
pushd %{buildroot}%{geminstdir}
rake test
popd

%files
%defattr(-, root, root, -)
%dir %{geminstdir}
%{geminstdir}/lib
%{geminstdir}/examples
%{geminstdir}/test
%doc %{gemdir}/doc/%{gemname}-%{version}
%doc %{geminstdir}/README
%doc %{geminstdir}/COPYING
%doc %{geminstdir}/GPL
%doc %{geminstdir}/docs
%doc %{geminstdir}/Rakefile
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec


%changelog
* Mon Feb 01 2010 M D Chappell <tremble@tremble.org.uk> - 1.1.0-3
- Requires rubygem(rake) rather that rubygem-rake

* Wed Jan 27 2010 M D Chappell <m.d.chappell@bath.ac.uk> - 1.1.0-2
- Various Formatting changes
- Run tests
- Fix Rakefile for recent verions of gem
- Correction of SRPM permissions

* Tue Jan 26 2010 M Chappell <m.d.chappell@bath.ac.uk> - 1.1.0-1
- Initial package