- we do have gettimeofday(), build is just confused
[packages/python-line_profiler.git] / python-line_profiler.spec
CommitLineData
b1135905
MK
1#
2# Conditional build:
3%bcond_with doc # don't build doc (not provided by package)
4%bcond_without tests # do not perform "make test"
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
cd7cf9c2 8%define module line_profiler
b1135905
MK
9Summary: module for doing line-by-line profiling of functions
10Summary(pl.UTF-8): Moduł do optymalizacji linia po linii kodu funkcji
11# Name must match the python module/package name (as in 'import' statement)
12Name: python-%{module}
b0abd0f6 13Version: 2.1
cd7cf9c2 14Release: 4
b1135905
MK
15License: BSD
16Group: Libraries/Python
b0abd0f6
AM
17Source0: https://github.com/rkern/line_profiler/archive/%{version}.tar.gz
18# Source0-md5: bd1cb2ba21af02339beab7ddc3a69c66
b1135905 19URL: https://github.com/rkern/line_profiler
18023865 20BuildRequires: rpmbuild(macros) >= 1.710
b1135905
MK
21BuildRequires: rpm-pythonprov
22%if %{with python2}
c3634a62 23BuildRequires: python-Cython
b1135905
MK
24BuildRequires: python-devel
25BuildRequires: python-distribute
b0abd0f6 26BuildRequires: python-ipython
b1135905
MK
27%endif
28%if %{with python3}
c3634a62 29BuildRequires: python3-Cython
b1135905
MK
30BuildRequires: python3-devel
31BuildRequires: python3-distribute
b0abd0f6 32BuildRequires: python3-ipython
b1135905
MK
33BuildRequires: python3-modules
34%endif
35Requires: python-modules
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39line_profiler will profile the time individual lines of code take to
40execute. The profiler is implemented in C via Cython in order to
41reduce the overhead of profiling
42
43%description -l pl.UTF-8
44line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
45zaimplementowany w C poprzez Cythona tak aby zredukować narzut
46profilowania.
47
48%package -n python3-%{module}
49Summary: -
50Summary(pl.UTF-8): -
51Group: Libraries/Python
52Requires: python3-modules
53
54%description -n python3-%{module}
55line_profiler will profile the time individual lines of code take to
56execute. The profiler is implemented in C via Cython in order to
57reduce the overhead of profiling
58
59%description -n python3-%{module} -l pl.UTF-8
60line_profile wskazuje czas wykonywania poszczególnych linii kodu. Jest
61zaimplementowany w C poprzez Cythona tak aby zredukować narzut
62profilowania.
63
64%package apidocs
65Summary: %{module} API documentation
66Summary(pl.UTF-8): Dokumentacja API %{module}
67Group: Documentation
68
69%description apidocs
70API documentation for %{module}.
71
72%description apidocs -l pl.UTF-8
73Dokumentacja API %{module}.
74
75%prep
76%setup -q -n %{module}-%{version}
77
78%build
79%if %{with python2}
80CC="%{__cc}" \
cd7cf9c2 81CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
8541e604 82%py_build %{?with_tests:test}
b1135905
MK
83%endif
84
85%if %{with python3}
86CC="%{__cc}" \
cd7cf9c2 87CFLAGS="%{rpmcppflags} %{rpmcflags} -DHAVE_GETTIMEOFDAY" \
8541e604 88%py3_build %{?with_tests:test}
b1135905
MK
89%endif
90
91%if %{with doc}
92cd docs
93%{__make} -j1 html
94rm -rf _build/html/_sources
95%endif
96
97%install
98rm -rf $RPM_BUILD_ROOT
99
100%if %{with python2}
8541e604 101%py_install
b1135905
MK
102
103%py_postclean
104%endif
105
106%if %{with python3}
8541e604 107%py3_install
b1135905
MK
108%endif
109
110%clean
111rm -rf $RPM_BUILD_ROOT
112
113%if %{with python2}
114%files
115%defattr(644,root,root,755)
116%doc LICENSE.txt README.rst
117%{py_sitedir}/kernprof.py[co]
118%{py_sitedir}/line_profiler.py[co]
119%attr(755,root,root) %{py_sitedir}/_line_profiler.so
120%if "%{py_ver}" > "2.4"
121%{py_sitedir}/%{module}-%{version}-py*.egg-info
122%endif
123%endif
124
125%if %{with python3}
126%files -n python3-%{module}
127%defattr(644,root,root,755)
128%doc LICENSE.txt README.rst
129%{py3_sitedir}/kernprof.py
130%{py3_sitedir}/line_profiler.py
131%{py3_sitedir}/__pycache__
60d1c445 132%attr(755,root,root) %{py3_sitedir}/_line_profiler.cpython-*.so
b1135905
MK
133%attr(755,root,root) %{_bindir}/kernprof
134%{py3_sitedir}/%{module}-%{version}-py*.egg-info
135%endif
136
137%if %{with doc}
138%files apidocs
139%defattr(644,root,root,755)
140%doc docs/_build/html/*
141%endif
This page took 0.096962 seconds and 4 git commands to generate.