packaging: Block py3 compilation in py2 env
Related: https://pagure.io/koji/issue/3485
This commit is contained in:
parent
924ad6f563
commit
d1a9105179
2 changed files with 10 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[:1]))')
|
||||
PACKAGE = $(shell basename `pwd`)
|
||||
PYFILES = $(wildcard *.py)
|
||||
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
|
||||
|
|
@ -30,5 +31,7 @@ install:
|
|||
for p in $(PYFILES) ; do \
|
||||
install -p -m 644 $$p $(DESTDIR)/$(SERVERDIR)/$$p; \
|
||||
done
|
||||
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(SERVERDIR)', 1, '$(PYDIR)', 1)"
|
||||
@if [ "$(PYVER_MAJOR)" == "3" ] ; then \
|
||||
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(SERVERDIR)', 1, '$(PYDIR)', 1)" ; \
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -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)";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue