Better support for build without configuration (rhbz#977941).

This commit is contained in:
Vít Ondruch 2013-07-02 12:17:15 +02:00
parent 315c4674d5
commit 1e68c10ca8
2 changed files with 61 additions and 2 deletions

46
config.h Normal file
View File

@ -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-<arch>.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

View File

@ -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-<arch>.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 <vondruch@redhat.com> - 2.0.0.247-10
- Better support for build without configuration (rhbz#977941).
* Mon Jul 01 2013 Vít Ondruch <vondruch@redhat.com> - 2.0.0.247-9
- Update to Ruby 2.0.0-p247 (rhbz#979605).
- Fix CVE-2013-4073.