During update, RPM cannot simply replace directory by link to direcotry,
therefore create the directory structure and link the files there one by
one (rhbz#1691039).
This avoids issues running `$ bin/rails console --sandbox`, which
otherwise breaks with error such as:
~~~
$ bin/rails console --sandbox
Traceback (most recent call last):
12: from bin/rails:4:in `<main>'
11: from bin/rails:4:in `require'
10: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/commands.rb:18:in `<top (required)>'
9: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command.rb:44:in `invoke'
8: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command.rb:70:in `find_by_namespace'
7: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:79:in `lookup'
6: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:79:in `each'
5: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:80:in `block in lookup'
4: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:80:in `each'
3: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
2: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:84:in `require'
1: from /builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:3:in `<top (required)>'
/builddir/.gem/ruby/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:3:in `require': cannot load such file -- irb (LoadError)
~~~
The macros need to be udpated, since RPM 4.14+ can expand .gem files and
also also provide %{gem_name}.gemspec file used to rebuild the gem.
However, the .gemspec file is not in current directory, but directly in
%{_builddir}.
If there is only conflict requirement, this still menas that there is
dependency on that package and appropriate requirement must be generated
(rhbz#1561487)
This causes issues with building other ruby packages, since it would
force every package to depend on gmp-devel. Reverting this until this
gets resolved upstream:
https://bugs.ruby-lang.org/issues/14422#note-6
This reverts commit 5624addc78.