diff --git a/python-speedtest-cli.spec b/python-speedtest-cli.spec index 5c8eb18..e4e40a4 100644 --- a/python-speedtest-cli.spec +++ b/python-speedtest-cli.spec @@ -1,9 +1,3 @@ -%if 0%{?fedora} || 0%{?rhel} >= 8 -%bcond_without python3 -%else # 0#{?fedora} || 0#{?rhel} >= 8 -%bcond_with python3 -%endif # 0#{?fedora} || 0#{?rhel} >= 8 - %global pypi_name speedtest-cli Name: python-%{pypi_name} @@ -12,8 +6,8 @@ Release: 1%{?dist} Summary: Command-line interface for testing internet bandwidth using speedtest.net License: ASL 2.0 -URL: https://pypi.python.org/pypi/%{pypi_name} -Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +URL: https://github.com/sivel/speedtest-cli +Source0: https://github.com/sivel/speedtest-cli/archive/v%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch @@ -22,110 +16,46 @@ BuildRequires: help2man %description %{summary}. -%package -n python2-%{pypi_name} -Summary: %{summary} - -BuildRequires: python2-devel -BuildRequires: python2-setuptools - -%{?python_provide:%python_provide python2-%{pypi_name}} - -%description -n python2-%{pypi_name} -%{summary}. - -%if %{with python3} %package -n python3-%{pypi_name} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools - %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} %{summary}. -%endif # with python3 %prep %autosetup -n %{pypi_name}-%{version} %build -%py2_build -%if %{with python3} %py3_build -%endif # with python3 %install %{__mkdir} -p %{buildroot}%{_mandir}/man1 -%py2_install -for f in $(%{_bindir}/find %{buildroot}%{_bindir} -type f -name '*') -do - /bin/ln -f ${f} ${f}-%{python2_version} -done -for f in $(%{_bindir}/find %{buildroot}%{python2_sitelib} -type f -name '*.py') -do - %{__sed} -i.old -e 's~#![ \t]*.*/bin/env[ \t]*python~#!%{__python2}~g' ${f} - %{__chmod} -c 0755 ${f} - /bin/touch -r ${f}.old ${f} && rm -f ${f}.old -done -%if %{with python3} -for f in $(%{_bindir}/find %{buildroot}%{_bindir} -type f -not -name '*-%{python2_version}') -do - %{__rm} -f ${f} -done %py3_install -for f in $(%{_bindir}/find %{buildroot}%{_bindir} -type f -not -name '*-%{python2_version}') -do - /bin/ln -f ${f} ${f}-%{python3_version} -done -for f in $(%{_bindir}/find %{buildroot}%{python3_sitelib} -type f -name '*.py') -do - %{__sed} -i.old -e 's~#![ \t]*.*/bin/env[ \t]*python~#!%{__python3}~g' ${f} - %{__chmod} -c 0755 ${f} - /bin/touch -r ${f}.old ${f} && rm -f ${f}.old -done export PYTHONPATH="%{buildroot}%{python3_sitelib}" -%else # with python3 -export PYTHONPATH="%{buildroot}%{python2_sitelib}" -%endif # with python3 for f in $(%{_bindir}/find %{buildroot}%{_bindir} -type f -name '*' | /bin/sort ) do of="$(/bin/basename ${f}).1" %{_bindir}/help2man -s 1 -N -o %{buildroot}%{_mandir}/man1/${of} ${f} done unset PYTHONPATH -%{_bindir}/find %{buildroot} -type f -name '*.pyc' -print -delete -%{_bindir}/find %{buildroot} -type f -name '*.pyo' -print -delete - -%files -n python2-%{pypi_name} -%license LICENSE -%doc PKG-INFO README.rst -%if %{with python3} -%{_bindir}/speedtest*-%{python2_version} -%{_mandir}/man1/speedtest*-%{python2_version}.1* -%else # !with python3 -%{_bindir}/speedtest* -%{_mandir}/man1/speedtest*.1* -%endif # !with python3 -%{python2_sitelib}/speedtest*.py* -%{python2_sitelib}/speedtest_cli-%{version}-py%{python2_version}.egg-info -%if %{with python3} %files -n python3-%{pypi_name} +%doc README.rst %license LICENSE -%doc PKG-INFO README.rst -%exclude %{_bindir}/speedtest*-%{python2_version} -%exclude %{_mandir}/man1/speedtest*-%{python2_version}.1* %{_bindir}/speedtest* %{_mandir}/man1/speedtest*.1* %{python3_sitelib}/speedtest*.py %{python3_sitelib}/speedtest_cli-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/__pycache__/speedtest*.cpython-%{python3_version_nodots}*.pyc -%endif # with python3 %changelog * Wed Oct 16 2019 Fabian Affolter - 2.1.2-1 - Update to latest upstream release 2.1.2 +- Remove support for Python 2 (rhbz#1740994) * Thu Oct 03 2019 Miro HronĨok - 1.0.2-10 - Rebuilt for Python 3.8.0rc1 (#1748018)