[apparmor] [patch] fix libapparmor ruby bindings for ruby 2.0

Steve Beattie steve at nxnw.org
Tue Jun 11 23:27:23 UTC 2013


On Wed, Jun 05, 2013 at 10:23:41PM +0200, Christian Boltz wrote:
> 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',

Well. I'm thoroughly confused, based on experiments on Ubuntu. One,
ruby.h doesn't get built here.  Two, I applied this patch on
ubuntu 13.04 and got no actual differences in install locations when
installing the ruby bits.  The resultant Makefile.ruby changes looked
like so:

--- Makefile.ruby.old	2013-06-11 12:40:19.000000000 -0700
+++ Makefile.ruby.new	2013-06-11 12:39:42.000000000 -0700
@@ -21,7 +21,7 @@
 exec_prefix = $(prefix)
 vendorhdrdir = $(rubyhdrdir)/vendor_ruby
 sitehdrdir = $(rubyhdrdir)/site_ruby
-rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
+rubyhdrdir = $(oldincludedir)/$(RUBY_BASE_NAME)-$(ruby_version)
 vendordir = $(DESTDIR)/usr/lib/ruby/vendor_ruby
 sitedir = $(DESTDIR)/usr/local/lib/site_ruby
 ridir = $(datarootdir)/$(RI_BASE_NAME)
@@ -34,7 +34,7 @@
 htmldir = $(docdir)
 infodir = $(prefix)/share/info
 docdir = $(datarootdir)/doc/$(PACKAGE)
-oldincludedir = $(DESTDIR)/usr/include
+oldincludedir = /usr/include
 includedir = $(prefix)/include
 localstatedir = $(DESTDIR)/var
 sharedstatedir = $(prefix)/com

but since at least in ruby 1.8 and ruby 1.9 we're not generating a
header, I guess that's why I'm not seeing any difference.

I am confused why he chose to modify oldincludedir and convert
rubyhdrdir (or hdrdir under SUSE?) to use it (I'm not sure what
oldincludedir's intended usage is, either).

Finally, Ubuntu doesn't package the ruby bits (though I would like
to change that at some point).  So I think the patch is safe from an
Ubuntu perspective for ruby 1.8 and 1.9 (and I don't know when ruby 2.0
is coming into the distro). So I'm not terribly opposed to the patch
going in if it fixes an actual build problem for openSUSE. Could you
add a reference to the bug in a comment before the rewriting occurs
to give some explanation why it is done? With that addition,
Acked-by: Steve Beattie <sbeattie at ubuntu.com>.

Thanks.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130611/96daf9e2/attachment.pgp>


More information about the AppArmor mailing list