diff --git a/hub/Makefile b/hub/Makefile index a44e1c4b..fc3bd634 100644 --- a/hub/Makefile +++ b/hub/Makefile @@ -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 diff --git a/plugins/Makefile b/plugins/Makefile index caf07063..50fd89fe 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -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)";