URL: https://github.com/freeipa/freeipa/pull/2162
Author: tiran
 Title: #2162: Improve specfile and build dependencies for F29 and RHEL
Action: opened

PR body:
"""
## Use python2_sitelib in spec file

%{python_sitelib} has been deprecated in favor of %{python2_sitelib}.
F29 rawhide no longer defines %{python_sitelib}.

## Update builddep command in BUILD.txt

It's no longer necessary to specify "with_python3" to get Python 3
dependencies.

python3-tox pulls in Python 2.6, 3.3, 3.4, 3.5, and pypy as weak
dependency. Use --setopt=install_weak_deps=False to make a build
environment leaner.

## Add more RHEL customizations to spec file

- Handle name / alt name for Fedora and RHEL. On Fedora, the packages
  are named "freeipa-*" with alternative names "ipa-*". On RHEL it is
  the other way around.
- Don't build ipatests on RHEL.
- Use latest versions of KRB5 on RHEL
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2162/head:pr2162
git checkout pr2162
From 110eb67a6ebab5043bbb990ee1fcbcb4a8100cde Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Tue, 17 Jul 2018 13:23:38 +0200
Subject: [PATCH 1/3] Use python2_sitelib in spec file

%{python_sitelib} has been deprecated in favor of %{python2_sitelib}.
F29 rawhide no longer defines %{python_sitelib}.

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

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 53decdd8e3..d25acf0a09 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -1528,24 +1528,24 @@ fi
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
 %license COPYING
-%dir %{python_sitelib}/ipaclient
-%{python_sitelib}/ipaclient/*.py*
-%dir %{python_sitelib}/ipaclient/install
-%{python_sitelib}/ipaclient/install/*.py*
-%dir %{python_sitelib}/ipaclient/plugins
-%{python_sitelib}/ipaclient/plugins/*.py*
-%dir %{python_sitelib}/ipaclient/remote_plugins
-%{python_sitelib}/ipaclient/remote_plugins/*.py*
-%dir %{python_sitelib}/ipaclient/remote_plugins/2_*
-%{python_sitelib}/ipaclient/remote_plugins/2_*/*.py*
-%dir %{python_sitelib}/ipaclient/csrgen
-%dir %{python_sitelib}/ipaclient/csrgen/profiles
-%{python_sitelib}/ipaclient/csrgen/profiles/*.json
-%dir %{python_sitelib}/ipaclient/csrgen/rules
-%{python_sitelib}/ipaclient/csrgen/rules/*.json
-%dir %{python_sitelib}/ipaclient/csrgen/templates
-%{python_sitelib}/ipaclient/csrgen/templates/*.tmpl
-%{python_sitelib}/ipaclient-*.egg-info
+%dir %{python2_sitelib}/ipaclient
+%{python2_sitelib}/ipaclient/*.py*
+%dir %{python2_sitelib}/ipaclient/install
+%{python2_sitelib}/ipaclient/install/*.py*
+%dir %{python2_sitelib}/ipaclient/plugins
+%{python2_sitelib}/ipaclient/plugins/*.py*
+%dir %{python2_sitelib}/ipaclient/remote_plugins
+%{python2_sitelib}/ipaclient/remote_plugins/*.py*
+%dir %{python2_sitelib}/ipaclient/remote_plugins/2_*
+%{python2_sitelib}/ipaclient/remote_plugins/2_*/*.py*
+%dir %{python2_sitelib}/ipaclient/csrgen
+%dir %{python2_sitelib}/ipaclient/csrgen/profiles
+%{python2_sitelib}/ipaclient/csrgen/profiles/*.json
+%dir %{python2_sitelib}/ipaclient/csrgen/rules
+%{python2_sitelib}/ipaclient/csrgen/rules/*.json
+%dir %{python2_sitelib}/ipaclient/csrgen/templates
+%{python2_sitelib}/ipaclient/csrgen/templates/*.tmpl
+%{python2_sitelib}/ipaclient-*.egg-info
 
 %endif # with_python2
 
@@ -1615,20 +1615,20 @@ fi
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
 %license COPYING
-%dir %{python_sitelib}/ipapython
-%{python_sitelib}/ipapython/*.py*
-%dir %{python_sitelib}/ipapython/install
-%{python_sitelib}/ipapython/install/*.py*
-%dir %{python_sitelib}/ipalib
-%{python_sitelib}/ipalib/*.py*
-%dir %{python_sitelib}/ipalib/install
-%{python_sitelib}/ipalib/install/*.py*
-%dir %{python_sitelib}/ipaplatform
-%{python_sitelib}/ipaplatform/*
-%{python_sitelib}/ipapython-*.egg-info
-%{python_sitelib}/ipalib-*.egg-info
-%{python_sitelib}/ipaplatform-*.egg-info
-%{python_sitelib}/ipaplatform-*-nspkg.pth
+%dir %{python2_sitelib}/ipapython
+%{python2_sitelib}/ipapython/*.py*
+%dir %{python2_sitelib}/ipapython/install
+%{python2_sitelib}/ipapython/install/*.py*
+%dir %{python2_sitelib}/ipalib
+%{python2_sitelib}/ipalib/*.py*
+%dir %{python2_sitelib}/ipalib/install
+%{python2_sitelib}/ipalib/install/*.py*
+%dir %{python2_sitelib}/ipaplatform
+%{python2_sitelib}/ipaplatform/*
+%{python2_sitelib}/ipapython-*.egg-info
+%{python2_sitelib}/ipalib-*.egg-info
+%{python2_sitelib}/ipaplatform-*.egg-info
+%{python2_sitelib}/ipaplatform-*-nspkg.pth
 
 %endif # with_python2
 
@@ -1661,8 +1661,8 @@ fi
 %defattr(-,root,root,-)
 %doc README.md Contributors.txt
 %license COPYING
-%{python_sitelib}/ipatests
-%{python_sitelib}/ipatests-*.egg-info
+%{python2_sitelib}/ipatests
+%{python2_sitelib}/ipatests-*.egg-info
 %{_bindir}/ipa-run-tests-2
 %{_bindir}/ipa-test-config-2
 %{_bindir}/ipa-test-task-2

From d8da581eb6f325ea2f27d48717245866e291cdeb Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Tue, 17 Jul 2018 13:24:55 +0200
Subject: [PATCH 2/3] Update builddep command in BUILD.txt

It's no longer necessary to specify "with_python3" to get Python 3
dependencies.

python3-tox pulls in Python 2.6, 3.3, 3.4, 3.5, and pypy as weak
dependency. Use --setopt=install_weak_deps=False to make a build
environment leaner.

Signed-off-by: Christian Heimes <chei...@redhat.com>
---
 .test_runner_config.yaml          | 2 +-
 .test_runner_config_py3_temp.yaml | 2 +-
 BUILD.txt                         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.test_runner_config.yaml b/.test_runner_config.yaml
index 125c1ea7f7..1c5bff7280 100644
--- a/.test_runner_config.yaml
+++ b/.test_runner_config.yaml
@@ -28,7 +28,7 @@ steps:
   builddep:
   - rm -rf /var/cache/dnf/*
   - "dnf makecache || :"
-  - dnf builddep -y ${builddep_opts} -D "with_wheels 1" --spec freeipa.spec.in --best --allowerasing
+  - dnf builddep -y ${builddep_opts} -D "with_wheels 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False
   - dnf install -y gdb
   cleanup:
   - chown -R ${uid}:${gid} ${container_working_dir}
diff --git a/.test_runner_config_py3_temp.yaml b/.test_runner_config_py3_temp.yaml
index bdc1d0e335..5465d7db47 100644
--- a/.test_runner_config_py3_temp.yaml
+++ b/.test_runner_config_py3_temp.yaml
@@ -30,7 +30,7 @@ steps:
   builddep:
   - rm -rf /var/cache/dnf/*
   - "dnf makecache || :"
-  - dnf builddep -y ${builddep_opts} --spec freeipa.spec.in --best --allowerasing
+  - dnf builddep -y ${builddep_opts} --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False
   - dnf install -y gdb
   cleanup:
   - chown -R ${uid}:${gid} ${container_working_dir}
diff --git a/BUILD.txt b/BUILD.txt
index e3898aa68d..c430f880b4 100644
--- a/BUILD.txt
+++ b/BUILD.txt
@@ -7,7 +7,7 @@ For more information, see http://www.freeipa.org/page/Build
 
 The quickest way to get the dependencies needed for building is:
 
-# dnf builddep -b -D "with_python3 1" -D "with_wheels 1" -D "with_lint 1" --spec freeipa.spec.in --best --allowerasing
+# dnf builddep -b -D "with_wheels 1" -D "with_lint 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False
 
 TIP: For building with latest dependencies for freeipa master enable copr repo:
 

From 6c6d13f763223c66a36fd04d95966d3262f7643a Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Tue, 17 Jul 2018 13:29:10 +0200
Subject: [PATCH 3/3] Add more RHEL customizations to spec file

- Handle name / alt name for Fedora and RHEL. On Fedora, the packages
  are named "freeipa-*" with alternative names "ipa-*". On RHEL it is
  the other way around.
- Don't build ipatests on RHEL.
- Use latest versions of KRB5 on RHEL

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

diff --git a/freeipa.spec.in b/freeipa.spec.in
index d25acf0a09..64fe018e20 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -13,9 +13,12 @@
     %global enable_server_option --enable-server
 %endif
 
-# Build with ipatests
+# Build ipatests
+%if 0%{?rhel}
+    %global with_ipatests 0
+%endif
 %if ! %{ONLY_CLIENT}
-    %global with_ipatests 1
+    %{!?with_ipatests:%global with_ipatests 1}
 %endif
 %if 0%{?with_ipatests}
     %global with_ipatests_option --with-ipatests
@@ -25,23 +28,24 @@
 
 # Python 2/3 packages and default Python interpreter
 %if 0%{?rhel} > 7
-%global with_default_python 3
-%global with_python2 0
+    %global with_default_python 3
+    %global with_python2 0
 %endif
 
 %if 0%{?fedora} >= 29
-# F29 only supports Python 3 as default Python
-%global with_default_python 3
+    # F29 only supports Python 3 as default Python
+    %global with_default_python 3
 %endif
 
 %{!?with_default_python:%global with_default_python 3}
 %{!?with_python2:%global with_python2 1}
 
 %if %{with_default_python} == 3
-%global python %{__python3}
+    %global with_python3 1
+    %global python %{__python3}
 %else
-%global with_python2 1
-%global python %{__python2}
+    %global with_python2 1
+    %global python %{__python2}
 %endif
 
 # lint is not executed during rpmbuild
@@ -52,10 +56,11 @@
     %global linter_options --disable-pylint --without-jslint
 %endif
 
-%global alt_name ipa
 %if 0%{?rhel}
-%global krb5_version 1.15.2
-%global krb5_kdb_version 6.1
+%global package_name ipa
+%global alt_name freeipa
+%global krb5_version 1.16.1
+%global krb5_kdb_version 7.0
 # 0.7.16: https://github.com/drkjam/netaddr/issues/71
 %global python_netaddr_version 0.7.16
 # Require 4.7.0 which brings Python 3 bindings
@@ -65,6 +70,9 @@
 %global python_ldap_version 3.1.0-1
 %global ds_version 1.4.0.8-1
 %else
+# Fedora
+%global package_name freeipa
+%global alt_name ipa
 %global krb5_version 1.16.1
 %global krb5_kdb_version 7.0
 # 0.7.16: https://github.com/drkjam/netaddr/issues/71
@@ -109,7 +117,7 @@
 	%define IPA_VERSION nonsense.to.please.RPM.SPEC.parser
 %endif
 
-Name:           freeipa
+Name:           %{package_name}
 Version:        %{IPA_VERSION}
 Release:        0%{?dist}
 Summary:        The Identity, Policy and Audit system
_______________________________________________
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/DGYD4NJ3H6VOIQKNTN75J66KGBFBTYFS/

Reply via email to