block py2 building for hub/web/util

This commit is contained in:
Tomas Kopecek 2022-11-28 10:44:13 +01:00
parent f7324fafa8
commit df70ecfbba
3 changed files with 10 additions and 4 deletions

View file

@ -1,11 +1,18 @@
NAME=koji
SPECFILE = $(firstword $(wildcard *.spec))
SUBDIRS = kojihub builder koji cli util www plugins vm
ifndef PYTHON
export PYTHON=python2
endif
PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[:1]))')
ifeq ($(PYVER_MAJOR),2)
SUBDIRS = builder koji cli plugins vm
else
SUBDIRS = kojihub builder koji cli util www plugins vm
endif
ifdef DIST
DIST_DEFINES := --define "dist $(DIST)"
endif

View file

@ -335,9 +335,7 @@ Requires(postun): systemd
%description utils
Utilities for the Koji system
%endif
%if 0%{py3_support} > 1
%package web
Summary: Koji Web UI
Group: Applications/Internet
@ -405,7 +403,7 @@ make DESTDIR=$RPM_BUILD_ROOT KOJI_MINIMAL=1 PYTHON=%{__python2} install
popd
%endif
%if 0%{py2_support} > 1
for D in kojihub builder plugins util www vm ; do
for D in builder plugins vm ; do
pushd $D
make DESTDIR=$RPM_BUILD_ROOT PYTHON=%{__python2} install
popd

View file

@ -35,3 +35,4 @@ install:
mkdir -p $(DESTDIR)/$(SERVERDIR)
install -p -m 644 kojiapp.py $(DESTDIR)/$(SERVERDIR)/kojiapp.py
$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(SERVERDIR)', 1, '$(PYDIR)', 1)"