%global modname memory_profiler Name: python-%{modname} Version: 0.43 Release: 1%{?dist} Summary: Module for monitoring memory usage of a python program License: BSD URL: https://github.com/fabianp/memory_profiler Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz BuildArch: noarch %global _description \ This is a python module for monitoring memory consumption of a process as well\ as line-by-line analysis of memory consumption for python programs. %description %{_description} %package -n python2-%{modname} Summary: %{summary} %{?python_provide:%python_provide python2-%{modname}} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-psutil Recommends: python2-psutil Recommends: python2-ipython-console %description -n python2-%{modname} %{_description} Python 2 version. %package -n python3-%{modname} Summary: %{summary} %{?python_provide:%python_provide python3-%{modname}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-psutil Recommends: python3-psutil Recommends: python3-ipython-console %description -n python3-%{modname} %{_description} Python 3 version. %prep %autosetup -n %{modname}-%{version} # We don't want to run ipython tests sed -i -e '/IPYTHON/d' Makefile # mprof should use current interpreter, not the random one sed -i -e 's|args.insert(0, "python")|args.insert(0, sys.executable)|' mprof %build %py2_build %py3_build %install %py3_install mv %{buildroot}%{_bindir}/mprof{,-%{python3_version}} ln -s mprof-%{python3_version} %{buildroot}%{_bindir}/mprof-3 %py2_install mv %{buildroot}%{_bindir}/mprof{,-%{python2_version}} ln -s mprof-%{python2_version} %{buildroot}%{_bindir}/mprof-2 ln -s mprof-2 %{buildroot}%{_bindir}/mprof %check export LC_ALL=C.UTF-8 PYTHONPATH=%{buildroot}%{python2_sitelib} PYTHON=%{__python2} make test PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHON=%{__python3} make test %files -n python2-%{modname} %license COPYING %doc README.rst %{python2_sitelib}/%{modname}-*.egg-info/ %{python2_sitelib}/%{modname}.py* %{_bindir}/mprof %{_bindir}/mprof-2 %{_bindir}/mprof-%{python2_version} %files -n python3-%{modname} %license COPYING %doc README.rst %{python3_sitelib}/%{modname}-*.egg-info/ %{python3_sitelib}/%{modname}.py %{python3_sitelib}/__pycache__/%{modname}.* %{_bindir}/mprof-3 %{_bindir}/mprof-%{python3_version} %changelog * Sun Jan 15 2017 Igor Gnatenko - 0.43-1 - Initial package