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