URL: https://github.com/freeipa/freeipa/pull/1030
Author: stlaz
 Title: #1030: Python3 - depend on python3-* packages by default in Fedora
Action: opened

PR body:
"""
This patchset is an easier way for a more proper solution in 
https://github.com/freeipa/freeipa/pull/1024. We should investigate the proper 
solution more to see why it fails but there's currently not enough time before 
release.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1030/head:pr1030
git checkout pr1030
From 964685778acff19a81caff2a4188910d03f1f7b5 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 1 Sep 2017 09:24:48 +0200
Subject: [PATCH 1/3] spec: remove python3 workaround

We have had a python3-ipaserver package for quite some time now

https://pagure.io/freeipa/issue/4985
---
 freeipa.spec.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 9aee44040f..fd4f0ce49e 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -826,8 +826,7 @@ Summary: IPA tests and test tools
 BuildArch: noarch
 %{?python_provide:%python_provide python3-ipatests}
 Requires: python3-ipaclient = %{version}-%{release}
-# FIXME: uncomment once there's python3-ipaserver
-#Requires: python3-ipaserver = %{version}-%{release}
+Requires: python3-ipaserver = %{version}-%{release}
 Requires: tar
 Requires: xz
 Requires: python3-nose

From 0cfbd9ed0aa0f6dde63ed7b5fbf3abe6cd5d4e50 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 1 Sep 2017 09:21:38 +0200
Subject: [PATCH 2/3] spec: have the scripts depend on py3 packages

When building for Fedora, we have with_python3 set to 1 by
default. Therefore, when such build is performed, have the
scripts depend on python3 packages instead of python2 (the
previous state was the scripts depended on both Python versions).

https://pagure.io/freeipa/issue/4985
---
 freeipa.spec.in | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index fd4f0ce49e..65d8050e07 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -281,8 +281,9 @@ Requires: %{name}-client = %{version}-%{release}
 Requires: %{name}-common = %{version}-%{release}
 %if 0%{?with_python3}
 Requires: python3-ipaserver = %{version}-%{release}
-%endif
+%else
 Requires: python2-ipaserver = %{version}-%{release}
+%endif
 Requires: 389-ds-base >= 1.3.5.14
 Requires: openldap-clients > 2.4.35-4
 Requires: nss >= 3.14.3-12.0
@@ -512,8 +513,9 @@ Requires: %{name}-client-common = %{version}-%{release}
 Requires: %{name}-common = %{version}-%{release}
 %if 0%{?with_python3}
 Requires: python3-ipaclient = %{version}-%{release}
-%endif
+%else
 Requires: python2-ipaclient = %{version}-%{release}
+%endif
 Requires: python-ldap
 Requires: cyrus-sasl-gssapi%{?_isa}
 Requires: ntp
@@ -635,8 +637,9 @@ Provides: %{name}-python = %{version}-%{release}
 Requires: %{name}-common = %{version}-%{release}
 %if 0%{?with_python3}
 Requires: python3-ipalib = %{version}-%{release}
-%endif
+%else
 Requires: python2-ipalib = %{version}-%{release}
+%endif
 
 Provides: %{alt_name}-python-compat = %{version}
 Conflicts: %{alt_name}-python-compat

From 02b36ecced95556f1788ad6fde03bdfbddc45630 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 1 Sep 2017 09:30:52 +0200
Subject: [PATCH 3/3] spec: remove strict options from shebangs

https://pagure.io/freeipa/issue/4985
---
 freeipa.spec.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 65d8050e07..e7142b7656 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -932,7 +932,7 @@ install/tools/ipactl
 ipa
 '
 for P in $PY3_SUBST_PATHS; do
-    sed -i -e '1 s|^#!.*\bpython[0-9]*\(\s\+-\)\?|#!%{__python3} -bb|' $P
+    sed -i -e '1 s|^#!.*\bpython[0-9]*\(\s\+-\)\?|#!%{__python3}|' $P
 done;
 
 %endif # with_python3
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to