[rubygem-cairo/f17: 1/2] Fix conditionals for F17 to work for RHEL 7 as well.
Vít Ondruch
vondruch at fedoraproject.org
Tue Apr 3 13:01:55 UTC 2012
commit 192dce8dd244ad6480af82b02ec84570fb5765cc
Author: Vít Ondruch <vondruch at redhat.com>
Date: Tue Apr 3 14:59:13 2012 +0200
Fix conditionals for F17 to work for RHEL 7 as well.
cairo-1.10.0-ext.cairo.depend | 2 --
rubygem-cairo.spec | 23 ++++++++++++++---------
2 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/rubygem-cairo.spec b/rubygem-cairo.spec
index 7958b3c..154bb5e 100644
--- a/rubygem-cairo.spec
+++ b/rubygem-cairo.spec
@@ -3,12 +3,14 @@
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
%endif
-%if 0%{?fedora} >= 17
+%if %{?fedora:0%{fedora} >= 17}%{?rhel:0%{rhel} >= 7}
%global rubyabi 1.9.1
%global header_dir %{ruby_vendorarchdir}
+%global ruby19 1
%else
%global rubyabi 1.8
%global header_dir %{ruby_sitearch}
+%global ruby19 0
%endif
%global gem_name cairo
@@ -18,7 +20,7 @@
Summary: Ruby bindings for cairo
Name: rubygem-%{gem_name}
Version: 1.10.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: Development/Languages
License: GPLv2 or Ruby
URL: http://cairographics.org/rcairo/
@@ -38,7 +40,7 @@ Requires: ruby(abi) = %{rubyabi}
Requires: rubygems
Provides: rubygem(%{gem_name}) = %{version}-%{release}
-%if 0%{?fedora} >= 17
+%if %{ruby19}
Obsoletes: ruby-%{gem_name} = %{version}-%{release}
Provides: ruby-%{gem_name} = %{version}-%{release}
%endif
@@ -80,7 +82,7 @@ Requires: ruby-devel
# Remove on F-17 and above
Obsoletes: ruby-cairo-devel < 1.9
Provides: ruby-cairo-devel = %{version}-%{release}
-%if 0%{?fedora} < 17
+%if %{ruby19} < 1
Provides: ruby(cairo-devel) = %{version}-%{release}
%endif
@@ -122,7 +124,7 @@ done
# Move C extension library to some private directory
pushd ./TMPINSTDIR/%{gem_instdir}
-%if 0%{?fedora} < 17
+%if %{ruby19} < 1
grep -rl '%{gem_name}.so' . | \
xargs sed -i \
-e "\@require at s|'%{gem_name}.so'|'%{gem_name}/%{gem_name}.so'|" \
@@ -213,12 +215,12 @@ popd
}
-%if 0%{?fedora} < 17
+%if %{ruby19} < 1
create_symlink_rec %{gem_instdir}/lib %{ruby_sitelib}
%endif
%check
-%if 0%{?fedora} >= 17
+%if %{ruby19}
export RUBYLIB=$(pwd)/TMPINSTDIR/%{gem_instdir}:$(pwd)/TMPINSTDIR/%{gem_extdir}/lib
%else
export RUBYLIB=$(pwd)/TMPINSTDIR/%{ruby_sitearch}
@@ -240,7 +242,7 @@ ruby ./test/run-test.rb
popd
%files
-%if 0%{fedora} < 17
+%if %{ruby19} < 1
%dir %{ruby_sitearch}/%{gem_name}/
%{ruby_sitearch}/%{gem_name}/%{gem_name}.so
%else
@@ -263,7 +265,7 @@ popd
%{gem_instdir}/test/
%{gem_docdir}/
-%if 0%{?fedora} < 17
+%if %{ruby19} < 1
%files -n ruby-%{gem_name}
%{ruby_sitelib}/%{gem_name}.rb
%{ruby_sitelib}/%{gem_name}/
@@ -273,6 +275,9 @@ popd
%{header_dir}/rb_cairo.h
%changelog
+* Tue Apr 03 2012 Vít Ondruch <vondruch at redhat.com> - 1.10.2-4
+- Fix conditionals for F17 to work for RHEL 7 as well.
+
* Sun Jan 29 2012 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.10.2-3
- F-17: rebuild against ruby 1.9
More information about the scm-commits
mailing list