Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uAELT8Ar025304 for ; Mon, 14 Nov 2016 16:29:11 -0500 Received: from localhost.localdomain (81-66-120-207.rev.numericable.fr [81.66.120.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 8A020564861 for ; Mon, 14 Nov 2016 22:29:09 +0100 (CET) From: Nicolas Iooss To: selinux@tycho.nsa.gov Subject: [PATCH 3/4] libsemanage: query for python site-packages dir directly Date: Mon, 14 Nov 2016 22:28:16 +0100 Message-Id: <20161114212817.15781-3-nicolas.iooss@m4x.org> In-Reply-To: <20161114212817.15781-1-nicolas.iooss@m4x.org> References: <20161114212817.15781-1-nicolas.iooss@m4x.org> List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Use the python interpreter to find the install directory, like commit 8162f10e670d ("libselinux: query for python site-packages dir directly") did for libselinux. While at it, do not install semanage.py (generated by SWIG) with executable permission bits. Signed-off-by: Nicolas Iooss --- libsemanage/src/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile index 37d6eabbdae8..5c7bc6c6ea65 100644 --- a/libsemanage/src/Makefile +++ b/libsemanage/src/Makefile @@ -12,9 +12,8 @@ PREFIX ?= $(DESTDIR)/usr LIBDIR ?= $(PREFIX)/lib SHLIBDIR ?= $(DESTDIR)/lib INCLUDEDIR ?= $(PREFIX)/include -PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])') PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) -PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER) +PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])') RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]') RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -lruby"') RUBYINSTALL ?= $(DESTDIR)$(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') @@ -144,9 +143,9 @@ install: all cd $(LIBDIR) && ln -sf $(LIBSO) $(TARGET) install-pywrap: pywrap - test -d $(PYLIBDIR)/site-packages || install -m 755 -d $(PYLIBDIR)/site-packages - install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/_semanage.so - install -m 755 semanage.py $(PYLIBDIR)/site-packages + test -d $(PYSITEDIR) || install -m 755 -d $(PYSITEDIR) + install -m 755 $(SWIGSO) $(PYSITEDIR)/_semanage.so + install -m 644 semanage.py $(PYSITEDIR) install-rubywrap: rubywrap -- 2.10.2