Commit b5b88808 authored by Mattias Ellert's avatar Mattias Ellert
Browse files

Make Python 3 default for Fedora 29+

parent d99acadc
......@@ -7,10 +7,8 @@
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
%if %{?rhel}%{!?rhel:0} == 6
%filter_provides_in %{python2_sitearch}.*\.so$
%filter_provides_in %{python2_sitearch}/.*\.so$
%filter_setup
%else
%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$
%endif
#
......@@ -72,6 +70,16 @@
%global with_pylint 0
%endif
%if %{?fedora}%{!?fedora:0} >= 29 || %{?rhel}%{!?rhel:0} >= 8
%global py3default 1
%global __defpython python3
%global __altpython python2
%else
%global py3default 0
%global __defpython python2
%global __altpython python3
%endif
%if %{?fedora}%{!?fedora:0} >= 7 || %{?rhel}%{!?rhel:0} >= 5 || %{?suse_version}%{!?suse_version:0} >= 1110
%global with_acix 1
%else
......@@ -277,6 +285,10 @@ BuildRequires: perl(Test::Harness)
BuildRequires: perl(Test::Simple)
# Needed to run ACIX unit tests
%if %{with_acix}
%if %{py3default}
BuildRequires: python3-twisted
BuildRequires: python3-pyOpenSSL
%else
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
BuildRequires: python-twisted
%else
......@@ -289,11 +301,8 @@ BuildRequires: python-openssl
BuildRequires: pyOpenSSL
%endif
%endif
BuildRequires: swig
%if %{?suse_version:1}%{!?suse_version:0}
# Needed for python/doxy2swig.py
BuildRequires: python-xml
%endif
BuildRequires: swig
%if %{?fedora}%{!?fedora:0} >= 4 || %{?rhel}%{!?rhel:0} >= 5
BuildRequires: libtool-ltdl-devel
%else
......@@ -493,14 +502,24 @@ Requires: %{name} = %{version}-%{release}
Requires: %{name}-hed = %{version}-%{release}
Requires: %{name}-plugins-needed = %{version}-%{release}
%if %{with_python}
%if %{py3default}
Requires: python3-%{name} = %{version}-%{release}
%else
Requires: python2-%{name} = %{version}-%{release}
%endif
%endif
Requires: perl(JSON::XS)
Requires: perl(XML::Simple)
%if %{with_pythonlrms}
Requires: perl(Inline)
Requires: perl(Inline::Python)
%endif
%if %{py3default}
Requires: python3-stomppy
Requires: python3-ldap
Requires: python3-dirq
Requires: python3-isodate
%else
%if %{?fedora}%{!?fedora:0} >= 26 || %{?rhel}%{!?rhel:0} >= 8
Requires: python2-stomppy
%else
......@@ -508,7 +527,8 @@ Requires: stomppy
%endif
Requires: python-ldap
Requires: python-dirq
Requires: python-isodate
Requires: python-isodate
%endif
Requires(post): %{service_post_requires}
Requires(preun): %{service_preun_requires}
......@@ -618,13 +638,22 @@ Group: System Environment/Libraries
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch: noarch
%endif
%if %{py3default}
Requires: python3-twisted
Requires: python3-pyOpenSSL
%else
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
Requires: python-twisted
%else
Requires: python-twisted-core
Requires: python-twisted-web
%endif
%if %{?suse_version:1}%{!?suse_version:0}
Requires: python-openssl
%else
Requires: pyOpenSSL
%endif
%endif
%description acix-core
NorduGrid is a collaboration aiming at development, maintenance and
......@@ -639,13 +668,6 @@ Group: System Environment/Libraries
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch: noarch
%endif
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
Requires: python-twisted
%else
Requires: python-twisted-core
Requires: python-twisted-web
%endif
Requires: pyOpenSSL
Requires: %{name}-acix-core = %{version}-%{release}
Requires(post): %{service_post_requires}
......@@ -667,13 +689,6 @@ Group: System Environment/Libraries
%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6
BuildArch: noarch
%endif
%if %{?fedora}%{!?fedora:0} || %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version:1}%{!?suse_version:0}
Requires: python-twisted
%else
Requires: python-twisted-core
Requires: python-twisted-web
%endif
Requires: pyOpenSSL
Requires: %{name}-acix-core = %{version}-%{release}
Requires(post): %{service_post_requires}
......@@ -815,9 +830,9 @@ fi
%if %{with_s3}
--enable-s3 \
%endif
--with-python=python2 \
--with-python=%{__defpython} \
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 7
--with-altpython=python3 \
--with-altpython=%{__altpython} \
%endif
%if %{with_canl}
--enable-canlxx \
......@@ -1041,22 +1056,18 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%{_libdir}/%{pkgdir}/DataStagingDelivery
%dir %{_libexecdir}/%{pkgdir}
%{_libexecdir}/%{pkgdir}/arcconfig-parser
%if %{py3default}
%dir %{python3_sitearch}/%{pkgdir}
%{python3_sitearch}/%{pkgdir}/__init__.py
%{python3_sitearch}/%{pkgdir}/__pycache__/__init__.*
%{python3_sitearch}/%{pkgdir}/utils
%{python3_sitearch}/%{pkgdir}/control
%else
%dir %{python2_sitearch}/%{pkgdir}
%{python2_sitearch}/%{pkgdir}/__init__.py*
%dir %{python2_sitearch}/%{pkgdir}/utils
%{python2_sitearch}/%{pkgdir}/utils/__init__.py*
%{python2_sitearch}/%{pkgdir}/utils/config.py*
%dir %{python2_sitearch}/%{pkgdir}/control
%{python2_sitearch}/%{pkgdir}/control/__init__.py*
%{python2_sitearch}/%{pkgdir}/control/Accounting.py*
%{python2_sitearch}/%{pkgdir}/control/ControlCommon.py*
%{python2_sitearch}/%{pkgdir}/control/ControlPaths.py*
%{python2_sitearch}/%{pkgdir}/control/Jobs.py*
%{python2_sitearch}/%{pkgdir}/control/OSPackage.py*
%{python2_sitearch}/%{pkgdir}/control/OSService.py*
%{python2_sitearch}/%{pkgdir}/control/RunTimeEnvironment.py*
%{python2_sitearch}/%{pkgdir}/control/Services.py*
%{python2_sitearch}/%{pkgdir}/control/ThirdPartyDeployment.py*
%{python2_sitearch}/%{pkgdir}/utils
%{python2_sitearch}/%{pkgdir}/control
%endif
%dir %{_datadir}/%{pkgdir}
%dir %{_datadir}/%{pkgdir}/examples
%{_datadir}/%{pkgdir}/examples/arc.conf.reference
......@@ -1272,7 +1283,11 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%{_datadir}/%{pkgdir}/ssm/sender.cfg
%if %{with_pythonlrms}
%{_libexecdir}/%{pkgdir}/arc-sshfs-mount
%if %{py3default}
%{python3_sitearch}/%{pkgdir}/lrms
%else
%{python2_sitearch}/%{pkgdir}/lrms
%endif
%{_datadir}/%{pkgdir}/SLURMPYmod.pm
%{_datadir}/%{pkgdir}/job_script.stubs
%endif
......@@ -1286,13 +1301,24 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%if %{with_acix}
%files acix-core
%defattr(-,root,root,-)
%if %{py3default}
%dir %{python3_sitelib}/acix
%{python3_sitelib}/acix/__init__.py
%{python3_sitelib}/acix/__pycache__/__init__.*
%{python3_sitelib}/acix/core
%else
%dir %{python2_sitelib}/acix
%{python2_sitelib}/acix/__init__.py*
%{python2_sitelib}/acix/core
%endif
%files acix-cache
%defattr(-,root,root,-)
%if %{py3default}
%{python3_sitelib}/acix/cacheserver
%else
%{python2_sitelib}/acix/cacheserver
%endif
%if %{use_systemd}
%{_unitdir}/acix-cache.service
%{_datadir}/%{pkgdir}/acix-cache-start
......@@ -1302,7 +1328,11 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%files acix-index
%defattr(-,root,root,-)
%if %{py3default}
%{python3_sitelib}/acix/indexserver
%else
%{python2_sitelib}/acix/indexserver
%endif
%if %{use_systemd}
%{_unitdir}/acix-index.service
%{_datadir}/%{pkgdir}/acix-index-start
......@@ -1419,8 +1449,12 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%defattr(-,root,root,-)
%doc docdir/python/*
%dir %{python2_sitearch}/%{pkgdir}
%{python2_sitearch}/_arc.@PYTHON_SOABI@*so
%{python2_sitearch}/_arc.*so
%if %{py3default}
%{python2_sitearch}/%{pkgdir}
%else
%{python2_sitearch}/%{pkgdir}/[^_]*.py*
%endif
%{_libdir}/%{pkgdir}/libaccPythonBroker.so
%{_libdir}/%{pkgdir}/libaccPythonBroker.apd
%{_libdir}/%{pkgdir}/libpythonservice.so
......@@ -1430,9 +1464,14 @@ service nordugrid-arc-aris condrestart > /dev/null 2>&1 || :
%if %{?fedora}%{!?fedora:0} >= 13 || %{?rhel}%{!?rhel:0} >= 7
%files -n python%{python3_pkgversion}-%{name}
%defattr(-,root,root,-)
%{python3_sitearch}/_arc.@ALTPYTHON_SOABI@*so
%{python3_sitearch}/_arc.*so
%if %{py3default}
%{python3_sitearch}/%{pkgdir}/[^_]*.py
%{python3_sitearch}/%{pkgdir}/__pycache__/[^_]*.*
%else
%{python3_sitearch}/%{pkgdir}
%endif
%endif
%files gridmap-utils
%defattr(-,root,root,-)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment