URL: https://github.com/freeipa/freeipa/pull/2153
Author: tiran
 Title: #2153: Fedora 29: No longer build python2-ipaserver
Action: opened

PR body:
"""
Some Python 2 dependencies such as python2-pki are no longer available
on Fedora 29. The pki package is a required dependency of
python2-ipaserver. It's not yet feasible to remove all Python 2
packages, since fleetcommander is not fully ported to Python 3 yet.

On Fedora 29, python2-ipaserver and python2-ipatests are no longer
built. The Python 3 packages replace the Python 2 packages.

Signed-off-by: Christian Heimes <chei...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2153/head:pr2153
git checkout pr2153
From 61634707be8677925f2374bb383caee301f350da Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Fri, 13 Jul 2018 19:00:34 +0200
Subject: [PATCH] Fedora 29: No longer build python2-ipaserver

Some Python 2 dependencies such as python2-pki are no longer available
on Fedora 29. The pki package is a required dependency of
python2-ipaserver. It's not yet feasible to remove all Python 2
packages, since fleetcommander is not fully ported to Python 3 yet.

On Fedora 29, python2-ipaserver and python2-ipatests are no longer
built. The Python 3 packages replace the Python 2 packages.

Signed-off-by: Christian Heimes <chei...@redhat.com>
---
 freeipa.spec.in | 54 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 35 insertions(+), 19 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 014d373d42..aeb749688e 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -28,9 +28,14 @@
 %global with_default_python 3
 %global with_python2 0
 %else
+%if 0%{?fedora} >= 29
+%global with_default_python 3
+%global with_python2 1
+%else
 %{!?with_default_python:%global with_default_python 3}
 %{!?with_python2:%global with_python2 1}
 %endif
+%endif
 
 %if %{with_default_python} == 3
 %global python %{__python3}
@@ -194,11 +199,6 @@ BuildRequires:  python2-six
 %if 0%{?with_wheels}
 BuildRequires:  dbus-glib-devel
 BuildRequires:  libffi-devel
-%if 0%{?with_python2}
-BuildRequires:  python2-tox
-BuildRequires:  python2-twine
-BuildRequires:  python2-wheel
-%endif
 BuildRequires:  python3-tox
 BuildRequires:  python3-twine
 BuildRequires:  python3-wheel
@@ -231,7 +231,10 @@ BuildRequires:  python2-lxml
 BuildRequires:  python2-netaddr >= %{python_netaddr_version}
 BuildRequires:  python2-netifaces
 BuildRequires:  python2-paste
+%if 0%{?fedora} < 29
+# Fedora 29 workaround: Dogtag no longer packages Python 2
 BuildRequires:  python2-pki >= %{pki_version}
+%endif
 BuildRequires:  python2-polib
 BuildRequires:  python2-pyasn1
 BuildRequires:  python2-pyasn1-modules
@@ -402,8 +405,8 @@ and integration with Active Directory based infrastructures (Trusts).
 If you are installing an IPA server, you need to install this package.
 
 
-%if 0%{?with_python2}
-
+%if 0%{?with_python2} && 0%{?fedora} < 29
+# Fedora 29 workaround: don't build python2-ipaserver, python2-pki is n/a
 %package -n python2-ipaserver
 Summary: Python libraries used by IPA server
 Group: System Environment/Libraries
@@ -434,7 +437,7 @@ features for further integration with Linux based clients (SUDO, automount)
 and integration with Active Directory based infrastructures (Trusts).
 If you are installing an IPA server, you need to install this package.
 
-%endif  # with_python2
+%endif  # with_python2 and Fedora < 29
 
 %package -n python3-ipaserver
 Summary: Python libraries used by IPA server
@@ -443,6 +446,8 @@ BuildArch: noarch
 %{?python_provide:%python_provide python3-ipaserver}
 Requires: %{name}-server-common = %{version}-%{release}
 Requires: %{name}-common = %{version}-%{release}
+Conflicts: python2-ipaserver
+Obsoletes: python2-ipaserver < %{version}
 # we need pre-requires since earlier versions may break upgrade
 Requires(pre): python3-ldap >= %{python_ldap_version}
 Requires: python3-augeas
@@ -835,8 +840,8 @@ If you are using IPA, you need to install this package.
 
 %if 0%{?with_ipatests}
 
-%if 0%{?with_python2}
-
+%if 0%{?with_python2} && 0%{?fedora} < 29
+# Fedora 29 workaround: don't build python2-ipaserver, depends on ipaserver
 %package -n python2-ipatests
 Summary: IPA tests and test tools
 BuildArch: noarch
@@ -872,7 +877,7 @@ features for further integration with Linux based clients (SUDO, automount)
 and integration with Active Directory based infrastructures (Trusts).
 This package contains tests that verify IPA functionality.
 
-%endif  # with_python2
+%endif  # with_python2 and Fedora < 29
 
 %package -n python3-ipatests
 Summary: IPA tests and test tools
@@ -880,6 +885,8 @@ BuildArch: noarch
 %{?python_provide:%python_provide python3-ipatests}
 Requires: python3-ipaclient = %{version}-%{release}
 Requires: python3-ipaserver = %{version}-%{release}
+Conflicts: python2-ipatests
+Obsoletes: python2-ipatests < %{version}
 Requires: iptables
 Requires: ldns-utils
 Requires: python3-coverage
@@ -996,14 +1003,15 @@ ln -rs %{buildroot}%{_bindir}/ipa-test-task-%{python3_version} %{buildroot}%{_bi
 pushd %{_builddir}/freeipa-%{version}-python2
 %{__make} python_install DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
 popd
-%if 0%{?with_ipatests}
+%if 0%{?with_python2} && 0%{?fedora} < 29
+# Fedora 29 workaround: don't ship ipatests binaries
 mv %{buildroot}%{_bindir}/ipa-run-tests %{buildroot}%{_bindir}/ipa-run-tests-%{python2_version}
 mv %{buildroot}%{_bindir}/ipa-test-config %{buildroot}%{_bindir}/ipa-test-config-%{python2_version}
 mv %{buildroot}%{_bindir}/ipa-test-task %{buildroot}%{_bindir}/ipa-test-task-%{python2_version}
 ln -rs %{buildroot}%{_bindir}/ipa-run-tests-%{python2_version} %{buildroot}%{_bindir}/ipa-run-tests-2
 ln -rs %{buildroot}%{_bindir}/ipa-test-config-%{python2_version} %{buildroot}%{_bindir}/ipa-test-config-2
 ln -rs %{buildroot}%{_bindir}/ipa-test-task-%{python2_version} %{buildroot}%{_bindir}/ipa-test-task-2
-%endif # with_ipatests
+%endif # with_ipatests and Fedora < 29
 %endif # with_python2
 
 # default installation
@@ -1027,6 +1035,14 @@ ln -frs %{buildroot}%{_bindir}/ipa-test-task-%{python2_version} %{buildroot}%{_b
 # remove files which are useful only for make uninstall
 find %{buildroot} -wholename '*/site-packages/*/install_files.txt' -exec rm {} \;
 
+%if 0%{?with_ipatests} && 0%{?with_python2} && 0%{?fedora} >= 29
+# Fedora 29 workaround: Remove Python 2 ipaserver and ipatests
+rm -rf %{buildroot}%{python2_sitelib}/ipaserver
+rm -rf %{buildroot}%{python2_sitelib}/ipaserver-*.egg-info
+rm -rf %{buildroot}%{python2_sitelib}/ipatests
+rm -rf %{buildroot}%{python2_sitelib}/ipatests-*.egg-info
+%endif  # with python2 ipatests and Fedora >= 29
+
 %find_lang %{gettext_domain}
 
 %if ! %{ONLY_CLIENT}
@@ -1345,8 +1361,8 @@ fi
 %{_mandir}/man1/ipa-winsync-migrate.1*
 %{_mandir}/man1/ipa-pkinit-manage.1*
 
-%if 0%{?with_python2}
-
+%if 0%{?with_python2} && 0%{?fedora} < 29
+# Fedora 29 workaround: don't build python2-ipaserver, python2-pki is n/a
 %files -n python2-ipaserver
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
@@ -1354,7 +1370,7 @@ fi
 %{python2_sitelib}/ipaserver
 %{python2_sitelib}/ipaserver-*.egg-info
 
-%endif # with_python2
+%endif # with_python2 and Fedora < 29
 
 %files -n python3-ipaserver
 %defattr(-,root,root,-)
@@ -1635,8 +1651,8 @@ fi
 
 %if 0%{?with_ipatests}
 
-%if 0%{?with_python2}
-
+%if 0%{?with_python2} && 0%{?fedora} < 29
+# Fedora 29 workaround: don't build python2-ipatests, depends on ipaserver
 %files -n python2-ipatests
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
@@ -1658,7 +1674,7 @@ fi
 %{_mandir}/man1/ipa-test-task.1*
 %endif
 
-%endif # with_python2
+%endif # with_python2 and Fedora < 29
 
 %files -n python3-ipatests
 %defattr(-,root,root,-)
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/LXYSHS5GH67ACBAQ4HQQLOXHJTPB3G2P/

Reply via email to