Avoid python-deprecated dependency in RHEL builds

This commit is contained in:
Yaakov Selkowitz 2023-07-24 18:35:13 -04:00
parent 7841def4f4
commit b2dba81b05

View File

@ -14,7 +14,9 @@ BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-cryptography >= 2.3 BuildRequires: python%{python3_pkgversion}-cryptography >= 2.3
BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest
%if %{undefined rhel}
BuildRequires: python%{python3_pkgversion}-deprecated BuildRequires: python%{python3_pkgversion}-deprecated
%endif
%description %description
Implements JWK, JWS, JWE specifications using python-cryptography Implements JWK, JWS, JWE specifications using python-cryptography
@ -23,7 +25,9 @@ Implements JWK, JWS, JWE specifications using python-cryptography
%package -n python%{python3_pkgversion}-%{srcname} %package -n python%{python3_pkgversion}-%{srcname}
Summary: Implements JWK, JWS, JWE specifications using python-cryptography Summary: Implements JWK, JWS, JWE specifications using python-cryptography
Requires: python%{python3_pkgversion}-cryptography >= 2.3 Requires: python%{python3_pkgversion}-cryptography >= 2.3
%if %{undefined rhel}
Requires: python%{python3_pkgversion}-deprecated Requires: python%{python3_pkgversion}-deprecated
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname} %description -n python%{python3_pkgversion}-%{srcname}
@ -32,6 +36,11 @@ Implements JWK, JWS, JWE specifications using python-cryptography
%prep %prep
%setup -q -n %{srcname}-%{version} %setup -q -n %{srcname}-%{version}
%if %{defined rhel}
# avoid python-deprecated dependency
sed -i -e '/deprecated/d' setup.py %{srcname}.egg-info/requires.txt
sed -i -e '/^from deprecated/d' -e '/@deprecated/d' %{srcname}/*.py
%endif
%build %build