From 192dce8dd244ad6480af82b02ec84570fb5765cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 3 Apr 2012 14:59:13 +0200 Subject: [PATCH] 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(-) delete mode 100644 cairo-1.10.0-ext.cairo.depend diff --git a/cairo-1.10.0-ext.cairo.depend b/cairo-1.10.0-ext.cairo.depend deleted file mode 100644 index d267ff6..0000000 --- a/cairo-1.10.0-ext.cairo.depend +++ /dev/null @@ -1,2 +0,0 @@ -install-so: - $(INSTALL_DATA) $(srcdir)/rb_cairo.h $(RUBYARCHDIR) 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@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 - 1.10.2-4 +- Fix conditionals for F17 to work for RHEL 7 as well. + * Sun Jan 29 2012 Mamoru Tasaka - 1.10.2-3 - F-17: rebuild against ruby 1.9