Hello,

you might have noticed the discussion about the libapparmor ruby 
bindings build failures on openSUSE Factory, which is the first version 
with ruby 2.0.

The problem was that DESTDIR was added to too many variables, which 
finally resulted in

[ 1399s] make[4]: Entering directory
`/home/abuild/rpmbuild/BUILD/apparmor-2.8.1/libraries/libapparmor/swig/ruby'
[ 1399s] make[4]: *** No rule to make target
`/home/abuild/rpmbuild/BUILDROOT/apparmor-2.8.1-147.1.x86_64/usr/include/ruby-2.0.0/ruby.h',

See https://bugzilla.novell.com/show_bug.cgi?id=822277 for all details.


Klaus Kaempf provided the attached patch which fixes the build, but he 
intentionally enabled it for Factory builds only (not <= 12.3) and wrote 
about it in the bugreport:

(comment 8)
Added a clunky workaround: created request id 177452
Should be fixed upstream

(comment 10)
Well, it is a crude hack, based on the contents of the created 
Makefile(.ruby)
Other distributions have different Makefiles (hence this bug doesn't 
appear there) and the patch might create more harm.


The only thing I can say about the patch is that it fixes the problem.
I don't know if it breaks anything on other distributions etc., 
therefore I'm asking for an extra strict review (and some testing) ;-)


Regards,

Christian Boltz
-- 
> Ich geh' jetzt erstmal Gummienten beim Wettschwimmen zugucken...
Du Gluecklicher. Ich darf morgen "echten" eNTen beim Umfallen zuschaun.
                            [Jochen Erwied und Thomas Ogrisegg in dasr]
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
-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to