#2 EPEL 8 compat
Opened 5 years ago by kanarip. Modified 5 years ago
rpms/ kanarip/python-fedora epel8  into  rawhide

EPEL 8 compat
Jeroen van Meeuwen (Kolab Systems) • 5 years ago  
file modified
+34 -89
@@ -1,4 +1,4 @@ 

- %if 0%{?fedora}

+ %if 0%{?fedora} || 0%{?rhel} >= 8

  %global with_python3 1

  %global py3dir ../python3

  %endif
@@ -14,6 +14,10 @@ 

  Fedora Infrastructure Applications such as Bodhi, PackageDB, MirrorManager,\

  and FAS2.\

  

+ %if 0%{?fedora} || 0%{?rhel} >= 8

+ %global py2 2

+ %endif

+ 

  

  Name:           python-fedora

  Version:        0.10.0
@@ -25,58 +29,25 @@ 

  URL:            https://github.com/fedora-infra/python-fedora

  Source0:        https://github.com/fedora-infra/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz

  

- BuildRequires:  python-lockfile

- BuildRequires:  python-munch

- BuildRequires:  python-openid

- BuildRequires:  python-openid-cla

- BuildRequires:  python-openid-teams

- BuildRequires:  python2-devel

+ BuildRequires:  python%{?py2}-lockfile

+ BuildRequires:  python%{?py2}-munch

+ BuildRequires:  python%{?py2}-openid

+ BuildRequires:  python%{?py2}-openid-cla

+ BuildRequires:  python%{?py2}-openid-teams

+ BuildRequires:  python%{?py2}-devel

  

  %if 0%{?rhel} == 6

  BuildRequires:  python-sphinx10

  %else

- %if 0%{?fedora} >= 24

- BuildRequires:  python2-sphinx

- %else

- BuildRequires:  python-sphinx

- %endif

+ BuildRequires:  python%{?py2}-sphinx

  %endif

  

- %if 0%{?fedora} || (0%{?rhel} >= 7)

- BuildRequires:  python-cherrypy2

- %else

- # Do not need TurboGears1 dependencies on epel7

- %if 0%{?rhel} && 0%{?rhel} < 7

- BuildRequires:  python-cherrypy

- %endif

- %endif

- 

- # Needed for tests and for the way we build docs

- %if 0%{?rhel} && 0%{?rhel} < 7

- # Phasing this out.  First from epel7 and later for everything

- BuildRequires: TurboGears

- %endif

- 

- %if 0%{?fedora} >= 24

- BuildRequires:  python2-babel

- BuildRequires:  python2-nose

- BuildRequires:  python2-requests >= 2.6.0

- BuildRequires:  python2-setuptools

- %if 0%{?fedora} >= 26

- BuildRequires:  python2-kitchen

- BuildRequires:  python2-six

- %else

- BuildRequires:  python-kitchen

- BuildRequires:  python-six

- %endif

- %else

- BuildRequires:  python-babel

- BuildRequires:  python-kitchen

- BuildRequires:  python-nose

- BuildRequires:  python-requests >= 2.6.0

- BuildRequires:  python-setuptools

- BuildRequires:  python-six

- %endif

+ BuildRequires:  python%{?py2}-babel

+ BuildRequires:  python%{?py2}-nose

+ BuildRequires:  python%{?py2}-requests >= 2.6.0

+ BuildRequires:  python%{?py2}-setuptools

+ BuildRequires:  python%{?py2}-kitchen

+ BuildRequires:  python%{?py2}-six

  

  %if 0%{?with_python3}

  BuildRequires:  python3-babel
@@ -100,31 +71,18 @@ 

  %package -n python2-fedora

  Summary:        %{summary}

  

- Requires:       python-beautifulsoup4

- Requires:       python-lockfile

- Requires:       python-munch

+ Requires:       python%{?py2}-beautifulsoup4

+ Requires:       python%{?py2}-lockfile

+ Requires:       python%{?py2}-munch

  # These are now optional dependencies.  Some bodhi methods will not work if

  # they aren't installed but they aren't needed for most functionality of the

  # module.

  #Requires:       koji python-iniparse yum

  

- %if 0%{?fedora} >= 24

- Requires:       python2-openidc-client

- Requires:       python2-requests >= 2.6.0

- %if 0%{?fedora} >= 26

- Requires:       python2-kitchen

- Requires:       python2-six

- %else

- Requires:       python-kitchen

- Requires:       python-six

- %endif

- %else

- Requires:       python-kitchen

- Requires:       python-openidc-client

- Requires:       python-requests >= 2.6.0

- Requires:       python-six

- %endif

- 

+ Requires:       python%{?py2}-openidc-client

+ Requires:       python%{?py2}-requests >= 2.6.0

+ Requires:       python%{?py2}-kitchen

+ Requires:       python%{?py2}-six

  

  %{?python_provide:%python_provide python2-fedora}

  
@@ -182,17 +140,8 @@ 

  Requires: python-feedparser

  Requires: python2-fedora = %{version}-%{release}

  

- %if 0%{?fedora} >= 24

- Requires: python2-decorator

- %if 0%{?fedora} >= 26

- Requires: python2-sqlalchemy

- %else

- Requires: python-sqlalchemy

- %endif

- %else

- Requires: python-decorator

- Requires: python-sqlalchemy

- %endif

+ Requires: python%{?py2}-decorator

+ Requires: python%{?py2}-sqlalchemy

  

  %{?python_provide:%python_provide python2-fedora-turbogears}

  
@@ -210,17 +159,13 @@ 

  Summary: Python modules for flask applications authing to Fedora Account System

  License:        LGPLv2+

  

- Requires: python-flask-wtf

- Requires: python-openid

- Requires: python-openid-cla

- Requires: python-openid-teams

+ Requires: python%{?py2}-flask-wtf

+ Requires: python%{?py2}-openid

+ Requires: python%{?py2}-openid-cla

+ Requires: python%{?py2}-openid-teams

  Requires: python2-fedora = %{version}-%{release}

  

- %if 0%{?fedora} >= 25

- Requires: python2-flask

- %else

- Requires: python-flask

- %endif

+ Requires: python%{?py2}-flask

  

  %{?python_provide:%python_provide python2-fedora-flask}

  
@@ -244,9 +189,7 @@ 

  # https://bugzilla.redhat.com/show_bug.cgi?id=1329539

  rm -f python2/translations/{anp,bal,ilo,mai,nds,wba}.po

  

- # Pull in the old compat version of cherrypy to build the tg1 docs.

  cp python2/setup.py python2/setup_docs.py

- sed -i 's/import sys/import sys\n__requires__ = ["CherryPy < 3.0"]; import pkg_resources/' python2/setup_docs.py

  

  %if 0%{?with_python3}

  cp -a python2 python3
@@ -321,8 +264,10 @@ 

  %{python2_sitelib}/fedora/

  %{python2_sitelib}/python_fedora*egg-info

  %exclude %{python2_sitelib}/fedora/tg/

+ %if 0%{?rhel} != 6

  %exclude %{python2_sitelib}/fedora/tg2/

  %exclude %{python2_sitelib}/fedora/wsgi/

+ %endif

  %exclude %{python2_sitelib}/flask_fas_openid.py*

  

  %if 0%{?with_python3}

Tested build for f28, f29, f30, master, epel7 and el6.

Note: Drops the TurboGears dep on el6 entirely, because TurboGears depends on python-sqlobject which in turn depends on the unavailable python-sqlite2.

Also drops some of the end-of-life Fedora release logic.

This BuildRequires python2-sphinx and hence cannot proceed.

Shouldn't EPEL changes go into an EPEL branch and not into master?

@bowlofeggs it's a matter of workflow/taste. I guess we should decide on a common workflow for all the infra-sig packages?

In this case I think kanarip was building rawhide pkgs on rhel8beta so he wanted his mods in there, and if we want to keep a common spec over branches we could too.

Shouldn't EPEL changes go into an EPEL branch and not into master?

I wish this was the consensus and all the epel hacks can be removed from this package.

The front page of this project states:

Do note that this repository only uses master, and all builds are made from there.

This BuildRequires python2-sphinx and hence cannot proceed.

Having dropped python2-sphinx from rawhide between 1 month and 14 days ago indeed does not help this pull request.

It is as yet unclear (to me) whether or not there will or will not be a python2-sphinx (and all python2-fu alongside it) for EL8.