Simplify Python package installation

Move logic for installing just the Python packages out of the spec file
and into our root Makefile. It removes code duplication to simplify a
spec file that supports building without Python 2.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes 2018-02-22 13:38:41 +01:00
parent 9a6a90bbdf
commit fd9ede5296
2 changed files with 11 additions and 13 deletions

View File

@ -1,7 +1,8 @@
ACLOCAL_AMFLAGS = -I m4
if ENABLE_SERVER
SERVER_SUBDIRS = daemons init install ipaserver
IPASERVER_SUBDIRS = ipaserver
SERVER_SUBDIRS = daemons init install
endif
if WITH_IPATESTS
@ -9,9 +10,9 @@ if WITH_IPATESTS
endif
IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython
PYTHON_SUBDIRS = $(IPACLIENT_SUBDIRS) $(IPATESTS_SUBDIRS) $(IPASERVER_SUBDIRS)
IPA_PLACEHOLDERS = freeipa ipa ipaserver ipatests
SUBDIRS = asn1 util client contrib po pypi \
$(IPACLIENT_SUBDIRS) $(IPATESTS_SUBDIRS) $(SERVER_SUBDIRS)
SUBDIRS = asn1 util client contrib po pypi $(PYTHON_SUBDIRS) $(SERVER_SUBDIRS)
GENERATED_PYTHON_FILES = \
$(top_builddir)/ipaplatform/override.py \
@ -358,6 +359,12 @@ pypi_packages: $(WHEELPYPIDIR) .wheelconstraints
@echo -e "\n\nTo upload packages to PyPI, run:\n"
@echo -e " twine upload $(WHEELPYPIDIR)/*-$(VERSION)-py2.py3-none-any.whl\n"
.PHONY: python_install
python_install:
for dir in $(PYTHON_SUBDIRS); do \
$(MAKE) $(AM_MAKEFLAGS) -C $${dir} install || exit 1; \
done
.PHONY:
strip-po:
$(MAKE) -C po strip-po

View File

@ -990,16 +990,7 @@ make %{?_smp_mflags} check VERBOSE=yes LIBDIR=%{_libdir}
# will overwrite /usr/bin/ipa and other scripts with variants using
# python2 shebang.
pushd %{_builddir}/freeipa-%{version}-python3
(cd ipaclient && %make_install)
(cd ipalib && %make_install)
(cd ipaplatform && %make_install)
(cd ipapython && %make_install)
%if ! %{ONLY_CLIENT}
(cd ipaserver && %make_install)
%endif # ONLY_CLIENT
%if 0%{?with_ipatests}
(cd ipatests && %make_install)
%endif # with_ipatests
%{__make} python_install DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
popd
%if 0%{?with_ipatests}