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}-cryptography >= 2.3
BuildRequires: python%{python3_pkgversion}-pytest
%if %{undefined rhel}
BuildRequires: python%{python3_pkgversion}-deprecated
%endif
%description
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}
Summary: Implements JWK, JWS, JWE specifications using python-cryptography
Requires: python%{python3_pkgversion}-cryptography >= 2.3
%if %{undefined rhel}
Requires: python%{python3_pkgversion}-deprecated
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
@ -32,6 +36,11 @@ Implements JWK, JWS, JWE specifications using python-cryptography
%prep
%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