Blame rubygem-openstack-compute.spec

a54adfc
# Generated from openstack-compute-1.1.5.gem by gem2rpm -*- rpm-spec -*-
a54adfc
%global gem_name openstack-compute
a54adfc
%global rubyabi 1.9.1
a54adfc
a54adfc
Summary: OpenStack Compute Ruby API
a54adfc
Name: rubygem-%{gem_name}
a54adfc
Version: 1.1.5
a54adfc
Release: 2%{?dist}
a54adfc
Group: Development/Languages
a54adfc
License: MIT
a54adfc
URL: https://launchpad.net/ruby-openstack-compute
a54adfc
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
a54adfc
# To get tests:
a54adfc
# git clone https://github.com/rackspace/ruby-openstack-compute.git && cd ruby-openstack-compute
a54adfc
# git checkout v1.1.5
a54adfc
# tar -czvf openstack-compute-1.1.5-test.tgz test
a54adfc
Source1: %{gem_name}-%{version}-test.tgz
a54adfc
# Fixes the library to work properly with Ruby 1.9
a54adfc
# https://github.com/rackspace/ruby-openstack-compute/pull/11
a54adfc
Patch0: openstack-compute-fix-tests-for-ruby-1.9.patch
a54adfc
Requires: ruby(abi) = %{rubyabi}
a54adfc
Requires: ruby(rubygems) 
a54adfc
Requires: rubygem(json) 
a54adfc
BuildRequires: rubygems-devel
a54adfc
BuildRequires: rubygem(mocha)
a54adfc
BuildRequires: rubygem(minitest)
a54adfc
BuildRequires: rubygem(json)
a54adfc
BuildArch: noarch
a54adfc
Provides: rubygem(%{gem_name}) = %{version}
a54adfc
a54adfc
%description
a54adfc
Ruby Openstack Compute binding for the v1.0 OSAPI.
a54adfc
Currently supports both v1.0 and v2.0 (keystone) auth.
a54adfc
a54adfc
%package doc
a54adfc
Summary: Documentation for %{name}
a54adfc
Group: Documentation
a54adfc
Requires: %{name} = %{version}-%{release}
a54adfc
BuildArch: noarch
a54adfc
a54adfc
%description doc
a54adfc
Documentation for %{name}
a54adfc
a54adfc
%prep
a54adfc
%setup -q -c -T
a54adfc
mkdir -p .%{gem_dir}
a54adfc
gem install --local --install-dir .%{gem_dir} \
a54adfc
            --force %{SOURCE0}
a54adfc
a54adfc
pushd .%{gem_instdir}
a54adfc
%patch0 -p1
a54adfc
popd
a54adfc
a54adfc
%build
a54adfc
a54adfc
%install
a54adfc
mkdir -p %{buildroot}%{gem_dir}
a54adfc
cp -a .%{gem_dir}/* \
a54adfc
        %{buildroot}%{gem_dir}/
a54adfc
# Remove the unneeded shebang.
a54adfc
sed -i '1d' %{buildroot}%{gem_libdir}/openstack/compute.rb
a54adfc
a54adfc
%check
a54adfc
pushd .%{gem_instdir}
a54adfc
# move tests into place, fix them so that they use minitest
a54adfc
tar xvzf %{SOURCE1}
a54adfc
sed -i "s|^gem 'test-unit'||" test/test_helper.rb
a54adfc
testrb test/*_test.rb
a54adfc
popd
a54adfc
a54adfc
%files
a54adfc
%dir %{gem_instdir}
a54adfc
%{gem_libdir}
a54adfc
%exclude %{gem_cache}
a54adfc
%{gem_spec}
a54adfc
%doc %{gem_instdir}/COPYING
a54adfc
# VERSION file is needed for runtime
a54adfc
%{gem_instdir}/VERSION
a54adfc
a54adfc
%files doc
a54adfc
%doc %{gem_docdir}
a54adfc
%doc %{gem_instdir}/README.rdoc
a54adfc
a54adfc
%changelog
a54adfc
* Fri Jan 27 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.5-2
a54adfc
- Switched from test-unit to minitest.
a54adfc
- Renamed the patch not to incorporate version.
a54adfc
- Unpacking test suite in %%check, so that it doesn't get into the RPM.
a54adfc
- Removed the unneeded shebang from one file.
a54adfc
a54adfc
* Thu Jan 26 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1.1.5-1
a54adfc
- Initial package