diff --git a/python-PyGithub.spec b/python-PyGithub.spec index f83771a..4e959e3 100644 --- a/python-PyGithub.spec +++ b/python-PyGithub.spec @@ -1,15 +1,22 @@ -%global pypi_name PyGithub +# what it's called on pypi +%global srcname PyGithub +# what it's imported as +%global libname github +# name of egg info directory +%global eggname %{srcname} +# package name fragment +%global pkgname pygithub %bcond_without python2 %bcond_without python3 -Name: python-%{pypi_name} +Name: python-%{srcname} Version: 1.39 Release: 4%{?dist} Summary: Python library to work with the Github API License: LGPLv3+ URL: https://github.com/PyGithub/PyGithub -Source0: https://files.pythonhosted.org/packages/source/P/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source0: %pypi_source BuildArch: noarch %global _description \ @@ -18,7 +25,7 @@ A Python library implementing the full Github API v3. %description %{_description} %if %{with python2} -%package -n python2-pygithub +%package -n python2-%{pkgname} Summary: %{summary} BuildRequires: python2-devel BuildRequires: python2-setuptools @@ -28,13 +35,13 @@ Provides: python-github = %{version}-%{release} Obsoletes: python-github < 1.11.1-4 Provides: python-PyGithub = %{version}-%{release} Obsoletes: python-PyGithub < 1.29-8 -%{?python_provide:%python_provide python2-pygithub} +%{?python_provide:%python_provide python2-%{pkgname}} -%description -n python2-pygithub %{_description} +%description -n python2-%{pkgname} %{_description} %endif %if %{with python3} -%package -n python%{python3_pkgversion}-pygithub +%package -n python%{python3_pkgversion}-%{pkgname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -44,13 +51,14 @@ Provides: python%{python3_pkgversion}-github = %{version}-%{release} Obsoletes: python%{python3_pkgversion}-github < 1.25.2-2 Provides: python%{python3_pkgversion}-PyGithub = %{version}-%{release} Obsoletes: python%{python3_pkgversion}-PyGithub < 1.29-8 -%{?python_provide:%python_provide python%{python3_pkgversion}-pygithub} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}} -%description -n python%{python3_pkgversion}-pygithub %{_description} +%description -n python%{python3_pkgversion}-%{pkgname} %{_description} %endif %prep -%setup -q -n %{pypi_name}-%{version} +%setup -q -n %{srcname}-%{version} +rm -rf %{eggname}.egg-info # this test needs network connection => kill it for Koji builds sed -i '/from Issue142 import \*/d' github/tests/AllTests.py @@ -93,21 +101,21 @@ popd %endif %if %{with python2} -%files -n python2-pygithub +%files -n python2-%{pkgname} %license COPYING COPYING.LESSER %doc README.md -%{python2_sitelib}/github -%exclude %{python2_sitelib}/github/tests -%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info +%{python2_sitelib}/%{libname} +%exclude %{python2_sitelib}/%{libname}/tests +%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info %endif %if %{with python3} -%files -n python%{python3_pkgversion}-pygithub +%files -n python%{python3_pkgversion}-%{pkgname} %license COPYING COPYING.LESSER %doc README.md -%{python3_sitelib}/github -%exclude %{python3_sitelib}/github/tests -%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/%{libname} +%exclude %{python3_sitelib}/%{libname}/tests +%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info %endif %changelog