%global srcname speedometer %global sum Chart network TX/RX and file download rates on the console %global desc \ Measure and display the rate of data across a network connection\ or data being stored in a file. %if 0%{?fedora} # FIXME build with python3 is currently b0rken # https://github.com/wardi/speedometer/issues/11 %bcond_with python3 %endif Name: %{srcname} Version: 2.8 Release: 2%{?dist} Summary: %{sum} # Sources tell about LGPL, https://github.com/wardi/speedometer/issues/10 License: LGPLv2+ #URL: https://github.com/wardi/speedometer URL: http://excess.org/%{name} Source0: %{url}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-urwid %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-urwid %endif %description %{desc} %package -n python2-%{srcname} Summary: %{sum} Requires: python2-urwid %{?python_provide:%python_provide python2-%{srcname}} Provides: %{name} = %{version}-%{release} %description -n python2-%{srcname} %{desc} %package -n python3-%{srcname} Summary: %{sum} Requires: python3-urwid %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %{desc} %prep %autosetup %build %py2_build %if %{with python3} %py3_build %endif %install %py2_install %if %{with python3} %py3_install %endif pushd %{buildroot}%{_bindir} find . -name \*.pyc -print -delete find . -name \*.py -exec mv '{}' $(basename -s '{}') \; sed -r 's:/.*python.*:%{__python3}:' %{name} >%{name}-3 popd %files -n python2-%{srcname} %doc CHANGELOG %{python2_sitelib}/* %{_bindir}/%{name} %exclude %{_bindir}/*.py* %exclude %{_bindir}/*-3 %if %{with python3} %files -n python3-%{srcname} %doc CHANGELOG %{python3_sitelib}/* %{_bindir}/%{name}-3 %endif %changelog * Tue Sep 19 2017 Raphael Groner - 2.8-2 - move binary into versionized subpackage - add dependency python-urwid - prepare build conditional for epel7 - prepare subpackage for python3, upstream is not ready yet * Sat Jun 17 2017 Raphael Groner - 2.8-1 - initial