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