A new user interface for you! Read more...

File rubygem-xpath.spec of Package rubygem-xpath

%{!?gem19_binary: %global gem19_binary /usr/bin/gem1.9}
%{!?gem19_install: %global gem19_install %gem19_binary install --verbose --local --build-root=%{buildroot}}
%if "x%{?gem19_cleanup}" == "x"
%if "0%{?rb_ver}" == "0%{?rb19_ver}"
%global gem19_cleanup %gem_cleanup
%else
%global gem19_cleanup /usr/bin/gem_build_cleanup %{buildroot}%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}
%endif
%endif
#
# spec file for package rubygem-xpath (Version 1.0.0)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%if 0%{?sles_version} == 11
%define gemprefix rubygem19
%else
%define gemprefix rubygem
%endif

# norootforbuild
Name:           rubygem-xpath
Version:        1.0.0
Release:        1.1
%define mod_name xpath
#
Group:          Development/Languages/Ruby
License:        GPL-2.0+ or Ruby
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  rubygems19_with_buildroot_patch
BuildRequires:  %gemprefix-nokogiri => 1.3
Requires:       %gemprefix-nokogiri => 1.3
BuildRequires:  %gemprefix-nokogiri < 2
Requires:       %gemprefix-nokogiri < 2
Suggests:       %gemprefix-rspec => 2.0
Suggests:       %gemprefix-rspec < 3
Suggests:       %gemprefix-yard >= 0.5.8
Suggests:       %gemprefix-rake 
#
Url:            http://github.com/jnicklas/xpath
Source:         %{mod_name}-%{version}.gem
#
Summary:        Generate XPath expressions from Ruby
%description
XPath is a Ruby DSL for generating XPath expressions


%package -n %gemprefix-%mod_name-doc
Summary:        RDoc documentation for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description -n %gemprefix-%mod_name-doc
Documentation for gem %mod_name generated at gem installation time.
Usually in RDoc and RI formats.
    
%package -n %gemprefix-%mod_name-testsuite
Summary:        Test suite for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description -n %gemprefix-%mod_name-testsuite
Test::Unit or RSpec files for gem %mod_name, useful for developers.
    
%prep
%build
%install
%gem19_install %{S:0}


%clean
%{__rm} -rf %{buildroot}

%if 0%{?sles_version} == 11
%define pkg_name rubygem19-%mod_name
%package -n %pkg_name
Summary:       %{summary}
Group:         %{group}
%{expand:%(
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
    [ -e $spec ] && break
done
awk '
 BEGIN { good=false }  
 /^Requires:/ { if (!good) print } 
 /^%/     { 
             if (good) exit
             if ($0 ~ /^%%description[[:blank:]]*$/) {
                in_desc = 1
                print "%description -n %pkg_name"
             } 
             next 
           }
 in_desc  { print; good = 1 }
 ' $spec
)}

%else
%define pkg_name %name
%endif

%files -n %pkg_name
%defattr(-,root,root,-)

%{_libdir}/ruby/gems/%{rb19_ver}/cache/%{mod_name}-%{version}.gem
%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}/
%{_libdir}/ruby/gems/%{rb19_ver}/specifications/%{mod_name}-%{version}.gemspec

%exclude %{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}/spec


%files -n %gemprefix-%mod_name-doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/%{rb19_ver}/doc/%{mod_name}-%{version}

%files -n %gemprefix-%mod_name-testsuite
%defattr(-,root,root,-)
%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}/spec
    
%changelog
* Tue Sep 18 2012 - luizluca@gmail.com
- Initial package