From 462281b3427c35457f2fd14915d359c28d5168e7 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Feb 25 2019 15:37:55 +0000 Subject: Initial release --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c29ae42 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/yappi-1.0.tar.gz diff --git a/python-yappi.spec b/python-yappi.spec new file mode 100644 index 0000000..dc28493 --- /dev/null +++ b/python-yappi.spec @@ -0,0 +1,127 @@ +%global srcname yappi + +# python3 is enabled in any fedora and rhel>7 +%if 0%{?fedora} || 0%{?rhel} > 7 +%global with_python3 1 +%else +%global with_python3 0 +%endif + +# python2 is disabled only in fedora >= 30 +%if 0%{?fedora} >= 30 +%global with_python2 0 +%else +%global with_python2 1 +%endif + +Name: python-%{srcname} +Version: 1.0 +Release: 1%{?dist} +Summary: Yet Another Python Profiler, supports Multithread/CPU time profiling + +License: MIT +URL: https://github.com/sumerc/yappi +Source0: https://files.pythonhosted.org/packages/source/y/%{srcname}/%{srcname}-%{version}.tar.gz + +BuildRequires: git +BuildRequires: gcc + +%description +Yappi, Yet Another Python Profiler, provides multithreading and cpu-time +support to profile python programs. + +%if 0%{?with_python2} +%package -n python2-%{srcname} +Summary: Yet Another Python Profiler, supports Multithread/CPU time profiling. +%{?python_provide:%python_provide python2-%{srcname}} + +# Previously bundled things: +BuildRequires: python2-devel +BuildRequires: python2-setuptools + +%description -n python2-%{srcname} +Yappi, Yet Another Python Profiler, provides multithreading and cpu-time +support to profile python programs. + +%endif + +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: Yet Another Python Profiler, supports Multithread/CPU time profiling. + +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description -n python3-%{srcname} +Yappi, Yet Another Python Profiler, provides multithreading and cpu-time +support to profile python programs. + +%endif + +%prep +%autosetup -n %{srcname}-%{version} -S git + +%build +%if 0%{?with_python2} +%py2_build +%endif +%if 0%{?with_python3} +%py3_build +%endif + +%install +%if 0%{?with_python2} +%py2_install +mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python2_version} +ln -s %{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}-2 +ln -s %{srcname}-2 %{buildroot}%{_bindir}/%{srcname} +%endif +%if 0%{?with_python3} +rm -f %{buildroot}%{_bindir}/%{srcname} +%py3_install +mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python3_version} +ln -s %{srcname}-%{python3_version} %{buildroot}%{_bindir}/%{srcname}-3 +ln -s %{srcname}-3 %{buildroot}%{_bindir}/%{srcname} +%endif + +%check +%if 0%{?with_python2} +export PYTHONPATH=%{buildroot}/%{python2_sitearch} +%{__python2} tests/test_functionality.py +%{__python2} tests/test_hooks.py +%endif +%if 0%{?with_python3} +export PYTHONPATH=%{buildroot}/%{python3_sitearch} +%{__python3} tests/test_functionality.py +%{__python3} tests/test_hooks.py +%endif + +%if 0%{?with_python2} +%files -n python2-%{srcname} +%license LICENSE +%doc README.md +%{python2_sitearch}/%{srcname}.py* +%{python2_sitearch}/_%{srcname}.so +%{python2_sitearch}/%{srcname}-*.egg-info +%{_bindir}/%{srcname}-2* +%if 0%{?with_python3} == 0 +%{_bindir}/%{srcname} +%endif +%endif + + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%license LICENSE +%doc README.md +%{python3_sitearch}/%{srcname}.py* +%{python3_sitearch}/_%{srcname}*.so +%{python3_sitearch}/__pycache__/%{srcname}* +%{python3_sitearch}/%{srcname}-*.egg-info +%{_bindir}/%{srcname} +%{_bindir}/%{srcname}-3* +%endif + +%changelog +* Thu Feb 21 2019 Alfredo Moralejo - 1.0-1 +- Initial version diff --git a/sources b/sources new file mode 100644 index 0000000..ff1dac8 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (yappi-1.0.tar.gz) = d743c471ee3797b9f3b24c831fcb4ddf2cec7c13c56e567c0618eeada9a534ca0b114929da623a2c67142c61f3c38b024b25ba5e32883113148f4377f7574905