diff --git a/python-jwt.spec b/python-jwt.spec index de681bf..1bed479 100644 --- a/python-jwt.spec +++ b/python-jwt.spec @@ -1,5 +1,13 @@ %global _docdir_fmt %{name} -%global srcname jwt + +# what it's called on pypi +%global srcname PyJWT +# what it's imported as +%global libname jwt +# name of egg info directory +%global eggname %{srcname} +# package name fragment +%global pkgname %{libname} %global _description \ A Python implementation of JSON Web Token draft 01. This library provides a\ @@ -8,13 +16,13 @@ claims to be transferred between two parties encoded as digitally signed and\ encrypted JSON objects. -Name: python-jwt +Name: python-%{pkgname} Version: 1.6.4 Release: 1%{?dist} Summary: JSON Web Token implementation in Python License: MIT URL: https://github.com/jpadilla/pyjwt -Source0: %pypi_source PyJWT +Source0: %pypi_source Patch0: disable-coverage-and-runner.patch BuildArch: noarch @@ -22,34 +30,34 @@ BuildArch: noarch %description %{_description} -%package -n python2-%{srcname} +%package -n python2-%{pkgname} Summary: %{summary} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-cryptography >= 1.4.0 BuildRequires: python2-pytest Requires: python2-cryptography >= 1.4.0 -%{?python_provide:%python_provide python2-%{srcname}} +%{?python_provide:%python_provide python2-%{pkgname}} -%description -n python2-%{srcname} %{_description} +%description -n python2-%{pkgname} %{_description} -%package -n python%{python3_pkgversion}-%{srcname} +%package -n python%{python3_pkgversion}-%{pkgname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-cryptography >= 1.4.0 BuildRequires: python%{python3_pkgversion}-pytest Requires: python%{python3_pkgversion}-cryptography >= 1.4.0 -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}} -%description -n python%{python3_pkgversion}-%{srcname} %{_description} +%description -n python%{python3_pkgversion}-%{pkgname} %{_description} %prep -%autosetup -n PyJWT-%{version} -p 1 +%autosetup -n %{srcname}-%{version} -p 1 # prevent pullng in `addopts` for pytest run later rm setup.cfg @@ -69,18 +77,18 @@ py.test-%{python2_version} --verbose py.test-%{python3_version} --verbose -%files -n python2-jwt +%files -n python2-%{pkgname} %doc README.rst AUTHORS %license LICENSE -%{python2_sitelib}/%{srcname}/ -%{python2_sitelib}/PyJWT-%{version}-py%{python2_version}.egg-info +%{python2_sitelib}/%{libname} +%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info -%files -n python%{python3_pkgversion}-jwt +%files -n python%{python3_pkgversion}-%{pkgname} %doc README.rst AUTHORS %license LICENSE -%{python3_sitelib}/%{srcname}/ -%{python3_sitelib}/PyJWT-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/%{libname} +%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info %{_bindir}/pyjwt