packaging: Block py3 compilation in py2 env

Related: https://pagure.io/koji/issue/3485
This commit is contained in:
Tomas Kopecek 2022-09-06 11:32:32 +02:00
parent 924ad6f563
commit d1a9105179
2 changed files with 10 additions and 5 deletions

View file

@ -40,10 +40,12 @@ install:
ifndef KOJI_MINIMAL
mkdir -p $(DESTDIR)/$(HUBPLUGINDIR);
install -p -m 644 $(HUBFILES) $(DESTDIR)/$(HUBPLUGINDIR);
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(HUBPLUGINDIR)', 1, '$(HUBPLUGINDIR)', 1)";
mkdir -p $(DESTDIR)/$(HUBCONFDIR);
install -p -m 644 $(HUBCONFFILES) $(DESTDIR)/$(HUBCONFDIR);
@if [ "$(PYVER_MAJOR)" == "3" ] ; then \
install -p -m 644 $(HUBFILES) $(DESTDIR)/$(HUBPLUGINDIR); \
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(HUBPLUGINDIR)', 1, '$(HUBPLUGINDIR)', 1)"; \
mkdir -p $(DESTDIR)/$(HUBCONFDIR); \
install -p -m 644 $(HUBCONFFILES) $(DESTDIR)/$(HUBCONFDIR); \
fi
mkdir -p $(DESTDIR)/$(BUILDERPLUGINDIR);
install -p -m 644 $(BUILDERFILES) $(DESTDIR)/$(BUILDERPLUGINDIR);
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(BUILDERPLUGINDIR)', 1, '$(BUILDERPLUGINDIR)', 1)";