File ruby-2_0-mkmf-destdir.patch of Package apparmor.19459

diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile ../orig-apparmor-2.8.1/libraries/libapparmor/swig/ruby/extconf.rb ./libraries/libapparmor/swig/ruby/extconf.rb
--- ../orig-apparmor-2.8.1/libraries/libapparmor/swig/ruby/extconf.rb	2009-05-12 23:56:56.000000000 +0200
+++ ./libraries/libapparmor/swig/ruby/extconf.rb	2013-06-04 14:52:01.677579537 +0200
@@ -28,7 +28,14 @@
   # hack 2: strip all rpath references
   open('Makefile.ruby', 'w') do |out|
     IO.foreach('Makefile.new') do |line|
-      out.puts line.gsub(/-Wl,-R'[^']*'/, '')
+      l = line.gsub(/-Wl,-R'[^']*'/, '')
+      # oldincludedir = $(DESTDIR)/usr/include
+      # -> oldincludedir = /usr/include
+      l = l.gsub(/(oldincludedir)\s+=\s+\$\(DESTDIR\)(.*)/) {  |m| "#{$1} = #{$2}" }
+      # hdrdir = $(includedir)/$(RUBY_VERSION_NAME)
+      #  -> hdrdir = $(oldincludedir)/$(RUBY_VERSION_NAME)
+      l = l.gsub(/(hdrdir)\s+=\s+\$\(includedir\)(.*)/) {  |m| "#{$1} = $(oldincludedir)#{$2}" }
+      out.puts l
     end
   end
 else
openSUSE Build Service is sponsored by