Fix conditionals for F17 to work for RHEL 7 as well.

This commit is contained in:
Vít Ondruch 2012-04-03 14:59:13 +02:00
parent 4937b90815
commit 192dce8dd2
2 changed files with 14 additions and 11 deletions

View File

@ -1,2 +0,0 @@
install-so:
$(INSTALL_DATA) $(srcdir)/rb_cairo.h $(RUBYARCHDIR)

View File

@ -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 <vondruch@redhat.com> - 1.10.2-4
- Fix conditionals for F17 to work for RHEL 7 as well.
* Sun Jan 29 2012 Mamoru Tasaka <mtasaka@fedoraproject.org> - 1.10.2-3
- F-17: rebuild against ruby 1.9