LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File rubygem-rmagick.spec of Package rubygem-rmagick (Project home:luizluca:IPSIDS)

%{!?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-rmagick (Version 2.13.1)
#
# 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-rmagick
Version:        2.13.1
Release:        1.1
%define mod_name rmagick
#
Group:          Development/Languages/Ruby
License:        GPL-2.0+ or Ruby
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  rubygems19_with_buildroot_patch
Requires:       ruby19 >= 1.8.5
BuildRequires:  ruby19-devel >= 1.8.5
BuildRequires:  ImageMagick-devel >= 6.4.9
BuildRequires:  pkg-config
#
Url:            http://rubyforge.org/projects/rmagick
Source:         %{mod_name}-%{version}.gem
#
Summary:        Ruby binding to ImageMagick
%description
RMagick is an interface between Ruby and ImageMagick.


%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.
    
%prep
%build
%install
%gem19_install %{S:0}

%gem19_cleanup
%__rm -Rf "%{buildroot}%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}/ext"
%__rm -Rf "%{buildroot}%{_libdir}/ruby/gems/%{rb19_ver}/doc/%{mod_name}-%{version}/rdoc/ext/RMagick/Makefile.html"

%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



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

%changelog
* Tue Sep 18 2012 - luizluca@gmail.com
- Initial package