From 1e68c10ca8fdeef75236b24640285f3e68f723a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 2 Jul 2013 12:17:15 +0200 Subject: [PATCH] Better support for build without configuration (rhbz#977941). --- config.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ ruby.spec | 17 +++++++++++++++-- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 config.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..ce501db --- /dev/null +++ b/config.h @@ -0,0 +1,46 @@ +/* + * This config.h is a wrapper include file for the original ruby/config.h, + * which has been renamed to ruby/config-.h. There are conflicts for the + * original ruby/config.h on multilib systems, which result from arch-specific + * configuration options. Please do not use the arch-specific file directly. + */ + +/* + * This wrapped is addpated from SDL's one: + * http://pkgs.fedoraproject.org/cgit/SDL.git/tree/SDL_config.h + */ + +#ifdef ruby_config_wrapper_h +#error "ruby_config_wrapper_h should not be defined!" +#endif +#define ruby_config_wrapper_h + +#if defined(__i386__) +#include "ruby/config-i386.h" +#elif defined(__ia64__) +#include "ruby/config-ia64.h" +#elif defined(__powerpc64__) +#include "ruby/config-ppc64.h" +#elif defined(__powerpc__) +#include "ruby/config-ppc.h" +#elif defined(__s390x__) +#include "ruby/config-s390x.h" +#elif defined(__s390__) +#include "ruby/config-s390.h" +#elif defined(__x86_64__) +#include "ruby/config-x86_64.h" +#elif defined(__arm__) +#include "ruby/config-arm.h" +#elif defined(__alpha__) +#include "ruby/config-alpha.h" +#elif defined(__sparc__) && defined (__arch64__) +#include "ruby/config-sparc64.h" +#elif defined(__sparc__) +#include "ruby/config-sparc.h" +#elif defined(__aarch64__) +#include "ruby/config-aarch64.h" +#else +#error "The ruby-devel package is not usable with the architecture." +#endif + +#undef ruby_config_wrapper_h diff --git a/ruby.spec b/ruby.spec index 1387a98..b7303a0 100644 --- a/ruby.spec +++ b/ruby.spec @@ -26,7 +26,7 @@ %endif -%global release 9 +%global release 10 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} %global rubygems_version 2.0.2 @@ -74,6 +74,11 @@ Source3: ruby-exercise.stp Source4: macros.ruby Source5: macros.rubygems Source6: abrt_prelude.rb +# This wrapper fixes https://bugzilla.redhat.com/show_bug.cgi?id=977941 +# Hopefully, it will get removed soon: +# https://fedorahosted.org/fpc/ticket/312 +# https://bugzilla.redhat.com/show_bug.cgi?id=977941 +Source7: config.h # Include the constants defined in macros files. @@ -434,7 +439,7 @@ autoconf --with-vendordir='%{ruby_vendorlibdir}' \ --with-vendorarchdir='%{ruby_vendorarchdir}' \ --with-rubyhdrdir='%{_includedir}' \ - --with-rubyarchhdrdir='$(archincludedir)' \ + --with-rubyarchhdrdir='%{_includedir}' \ --with-sitearchhdrdir='$(sitehdrdir)/$(arch)' \ --with-vendorarchhdrdir='$(vendorhdrdir)/$(arch)' \ --with-rubygemsdir='%{rubygems_dir}' \ @@ -455,6 +460,11 @@ make %{?_smp_mflags} COPY="cp -p" Q= rm -rf %{buildroot} make install DESTDIR=%{buildroot} +# Rename ruby/config.h to ruby/config-.h to avoid file conflicts on +# multilib systems and install config.h wrapper +mv %{buildroot}%{_includedir}/%{name}/config.h %{buildroot}%{_includedir}/%{name}/config-%{_arch}.h +install -m644 %{SOURCE7} %{buildroot}%{_includedir}/%{name}/config.h + # Rename the ruby executable. It is replaced by RubyPick. %{?with_rubypick:mv %{buildroot}%{_bindir}/%{name}{,-mri}} @@ -868,6 +878,9 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog +* Tue Jul 02 2013 Vít Ondruch - 2.0.0.247-10 +- Better support for build without configuration (rhbz#977941). + * Mon Jul 01 2013 Vít Ondruch - 2.0.0.247-9 - Update to Ruby 2.0.0-p247 (rhbz#979605). - Fix CVE-2013-4073.