diff mbox series

[2/4] libsemanage: compile Python bytecode when installing Python files

Message ID 20191102172812.22492-2-nicolas.iooss@m4x.org (mailing list archive)
State Rejected
Headers show
Series [1/4] libselinux: compile Python bytecode when installing Python files | expand

Commit Message

Nicolas Iooss Nov. 2, 2019, 5:28 p.m. UTC
Create a cache file such as
/usr/lib/python3.7/site-packages/__pycache__/semanage.cpython-37.pyc
in order to prevent it from being dynamically created when semanage
module is imported.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 libsemanage/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
index e029f0988dd8..a9adfa47bdc8 100644
--- a/libsemanage/src/Makefile
+++ b/libsemanage/src/Makefile
@@ -145,7 +145,7 @@  install-pywrap: pywrap
 	test -d $(DESTDIR)$(PYTHONLIBDIR) || install -m 755 -d $(DESTDIR)$(PYTHONLIBDIR)
 	install -m 755 $(SWIGSO) $(DESTDIR)$(PYTHONLIBDIR)/_semanage$(PYCEXT)
 	install -m 644 semanage.py $(DESTDIR)$(PYTHONLIBDIR)
-
+	$(PYTHON) -m compileall $(DESTDIR)$(PYTHONLIBDIR)/semanage.py
 
 install-rubywrap: rubywrap
 	test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)