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
%global gem19_cleanup /usr/bin/gem_build_cleanup %{buildroot}%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}
# 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

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

# 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 
Source:         %{mod_name}-%{version}.gem
Summary:        Generate XPath expressions from Ruby
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.
%gem19_install %{S:0}

%{__rm} -rf %{buildroot}

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

%define pkg_name %name

%files -n %pkg_name


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

%files -n %gemprefix-%mod_name-doc
%doc %{_libdir}/ruby/gems/%{rb19_ver}/doc/%{mod_name}-%{version}

%files -n %gemprefix-%mod_name-testsuite
* Tue Sep 18 2012 -
- Initial package