Blame python-yappi.spec

462281b
%global srcname yappi
462281b
462281b
# python3 is enabled in any fedora and rhel>7
462281b
%if 0%{?fedora} || 0%{?rhel} > 7
462281b
%global with_python3 1
462281b
%else
462281b
%global with_python3 0
462281b
%endif
462281b
462281b
# python2 is disabled only in fedora >= 30
462281b
%if 0%{?fedora} >= 30 
462281b
%global with_python2 0
462281b
%else
462281b
%global with_python2 1
462281b
%endif
462281b
462281b
Name:           python-%{srcname}
462281b
Version:        1.0
46101d0
Release:        3%{?dist}
462281b
Summary:        Yet Another Python Profiler, supports Multithread/CPU time profiling
462281b
462281b
License:        MIT
462281b
URL:            https://github.com/sumerc/yappi
462281b
Source0:        https://files.pythonhosted.org/packages/source/y/%{srcname}/%{srcname}-%{version}.tar.gz
462281b
462281b
BuildRequires:  git
462281b
BuildRequires:  gcc
462281b
462281b
%description
462281b
Yappi, Yet Another Python Profiler, provides multithreading and cpu-time
462281b
support to profile python programs.
462281b
462281b
%if 0%{?with_python2}
462281b
%package -n python2-%{srcname}
462281b
Summary:        Yet Another Python Profiler, supports Multithread/CPU time profiling.
462281b
%{?python_provide:%python_provide python2-%{srcname}}
462281b
462281b
# Previously bundled things:
462281b
BuildRequires:       python2-devel
462281b
BuildRequires:       python2-setuptools
462281b
462281b
%description -n python2-%{srcname}
462281b
Yappi, Yet Another Python Profiler, provides multithreading and cpu-time
462281b
support to profile python programs.
462281b
462281b
%endif
462281b
462281b
%if 0%{?with_python3}
462281b
%package -n python3-%{srcname}
462281b
Summary:        Yet Another Python Profiler, supports Multithread/CPU time profiling.
462281b
462281b
BuildRequires:  python3-devel
462281b
BuildRequires:  python3-setuptools
462281b
462281b
%description -n python3-%{srcname}
462281b
Yappi, Yet Another Python Profiler, provides multithreading and cpu-time
462281b
support to profile python programs.
462281b
462281b
%endif
462281b
462281b
%prep
462281b
%autosetup -n %{srcname}-%{version} -S git
462281b
462281b
%build
462281b
%if 0%{?with_python2}
462281b
%py2_build
462281b
%endif
462281b
%if 0%{?with_python3}
462281b
%py3_build
462281b
%endif
462281b
462281b
%install
462281b
%if 0%{?with_python2}
462281b
%py2_install
462281b
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python2_version}
462281b
ln -s %{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}-2
462281b
ln -s %{srcname}-2 %{buildroot}%{_bindir}/%{srcname}
462281b
%endif
462281b
%if 0%{?with_python3}
462281b
rm -f %{buildroot}%{_bindir}/%{srcname}
462281b
%py3_install
462281b
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python3_version}
462281b
ln -s %{srcname}-%{python3_version} %{buildroot}%{_bindir}/%{srcname}-3
462281b
ln -s %{srcname}-3 %{buildroot}%{_bindir}/%{srcname}
462281b
%endif
462281b
462281b
%check
462281b
%if 0%{?with_python2}
462281b
export PYTHONPATH=%{buildroot}/%{python2_sitearch}
462281b
%{__python2} tests/test_functionality.py
462281b
%{__python2} tests/test_hooks.py
462281b
%endif
462281b
%if 0%{?with_python3}
462281b
export PYTHONPATH=%{buildroot}/%{python3_sitearch}
462281b
%{__python3} tests/test_functionality.py
462281b
%{__python3} tests/test_hooks.py
462281b
%endif
462281b
462281b
%if 0%{?with_python2}
462281b
%files -n python2-%{srcname}
462281b
%license LICENSE
462281b
%doc README.md
462281b
%{python2_sitearch}/%{srcname}.py*
462281b
%{python2_sitearch}/_%{srcname}.so
462281b
%{python2_sitearch}/%{srcname}-*.egg-info
462281b
%{_bindir}/%{srcname}-2*
462281b
%if 0%{?with_python3} == 0
462281b
%{_bindir}/%{srcname}
462281b
%endif
462281b
%endif
462281b
462281b
462281b
%if 0%{?with_python3}
462281b
%files -n python3-%{srcname}
462281b
%license LICENSE
462281b
%doc README.md
462281b
%{python3_sitearch}/%{srcname}.py*
462281b
%{python3_sitearch}/_%{srcname}*.so
462281b
%{python3_sitearch}/__pycache__/%{srcname}*
462281b
%{python3_sitearch}/%{srcname}-*.egg-info
462281b
%{_bindir}/%{srcname}
462281b
%{_bindir}/%{srcname}-3*
462281b
%endif
462281b
462281b
%changelog
46101d0
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 1.0-3
46101d0
- Rebuilt for Python 3.8
46101d0
7511ffa
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2
7511ffa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7511ffa
462281b
* Thu Feb 21 2019 Alfredo Moralejo <amoralej@redhat.com> - 1.0-1
462281b
- Initial version