libsemanage python3 support.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dave Malcolm has been working on adding python3 support to libsemanage (and libselinux).
Change to Makefile to:
# Support building the Python bindings multiple times, against various Python
# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build # targets with "PYPREFIX":
Should build python2 version by default, without the user doing any changes. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkvi5uQACgkQrlYvE4MpobPT4gCfZjtxs171+6HsQNx/cDZTMWp9 VzYAn03cycetc+M3MnJMzAz88zyAYK/I
=JxHy
-----END PGP SIGNATURE-----
src/Makefile +12 -4
@@ -1,9 +1,15 @@ +# Support building the Python bindings multiple times, against various Python +# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build +# targets with "PYPREFIX": +PYTHON ?= python +PYPREFIX ?= + # Installation directories. PREFIX ?= $(DESTDIR)/usr LIBDIR ?= $(PREFIX)/lib SHLIBDIR ?= $(PREFIX)/lib INCLUDEDIR ?= $(PREFIX)/include -PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]') +PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])') PYINC ?= /usr/include/${PYLIBVER} PYLIBDIR ?= $(LIBDIR)/${PYLIBVER} RUBYLIBVER ?= $(shell ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
@@ -34,9 +40,9 @@ SWIGIF= semanageswig_python.i SWIGRUBYIF= semanageswig_ruby.i SWIGCOUT= semanageswig_wrap.c SWIGRUBYCOUT= semanageswig_ruby_wrap.c -SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT)) +SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT)) SWIGRUBYLOBJ:= $(patsubst %.c,%.lo,$(SWIGRUBYCOUT)) -SWIGSO=_semanage.so +SWIGSO=$(PYPREFIX)_semanage.so SWIGFILES=$(SWIGSO) semanage.py SWIGRUBYSO=_rubysemanage.so LIBSO=$(TARGET).$(LIBVERSION)
@@ -132,7 +138,9 @@ install: all install-pywrap: pywrap test -d $(PYLIBDIR)/site-packages || install -m 755 -d $(PYLIBDIR)/site-packages - install -m 755 $(SWIGFILES) $(PYLIBDIR)/site-packages + install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/_semanage.so + install -m 755 semanage.py $(PYLIBDIR)/site-packages + install-rubywrap: rubywrap test -d $(RUBYINSTALL) || install -m 755 -d $(RUBYINSTALL)