]>
Commit | Line | Data |
---|---|---|
926cf60f AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module prctl | |
7 | Summary: Allows to control specific characteristics of a process’ behaviour | |
8 | Name: python-%{module} | |
9 | Version: 1.5.0 | |
422ed271 | 10 | Release: 3 |
926cf60f AM |
11 | License: GPL v3 |
12 | Group: Libraries/Python | |
13 | Source0: https://github.com/seveas/python-prctl/archive/v%{version}.tar.gz | |
14 | # Source0-md5: 1fb338e9ffce5f654c91e8d44b018734 | |
15 | URL: https://pythonhosted.org/python-prctl/ | |
16 | BuildRequires: python-devel | |
17 | BuildRequires: python-distribute | |
18 | BuildRequires: rpm-pythonprov | |
19 | # if py_postclean is used | |
18e698cc | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
926cf60f AM |
21 | # when python3 present |
22 | BuildRequires: libcap-devel | |
23 | BuildRequires: sed >= 4.0 | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-devel | |
926cf60f AM |
26 | BuildRequires: python3-modules |
27 | %endif | |
28 | Requires: python-modules | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | The linux prctl function allows you to control specific | |
33 | characteristics of a process’ behaviour. | |
34 | ||
35 | %package -n python3-%{module} | |
36 | Summary: Allows to control specific characteristics of a process’ behaviour | |
37 | Group: Libraries/Python | |
38 | ||
39 | %description -n python3-%{module} | |
40 | The linux prctl function allows you to control specific | |
41 | characteristics of a process’ behaviour. | |
42 | ||
43 | %package apidoc | |
44 | Summary: %{module} API documentation | |
45 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
46 | Group: Documentation | |
47 | ||
48 | %description apidoc | |
49 | API documentation for %{module}. | |
50 | ||
51 | %description apidoc -l pl.UTF-8 | |
52 | Dokumentacja API %{module}. | |
53 | ||
54 | %prep | |
55 | %setup -q | |
56 | ||
57 | %build | |
58 | %if %{with python2} | |
bf5b9add | 59 | %py_build |
926cf60f AM |
60 | %endif |
61 | ||
62 | %if %{with python3} | |
bf5b9add | 63 | %py3_build |
926cf60f AM |
64 | %endif |
65 | ||
66 | %if %{with doc} | |
67 | cd docs | |
68 | %{__make} -j1 html | |
69 | rm -rf _build/html/_sources | |
70 | %endif | |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
bf5b9add | 76 | %py_install |
926cf60f AM |
77 | |
78 | %py_postclean | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
bf5b9add | 82 | %py3_install |
926cf60f AM |
83 | %endif |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc README | |
92 | %{py_sitedir}/*.py[co] | |
93 | %attr(755,root,root) %{py_sitedir}/*.so | |
94 | %if "%{py_ver}" > "2.4" | |
95 | %{py_sitedir}/python_%{module}-*.egg-info | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | %files -n python3-%{module} | |
101 | %defattr(644,root,root,755) | |
102 | %doc README | |
103 | %{py3_sitedir}/__pycache__/%{module}.*.py[co] | |
104 | %{py3_sitedir}/%{module}.py | |
105 | %attr(755,root,root) %{py3_sitedir}/_%{module}.*.so | |
106 | %{py3_sitedir}/python_%{module}-%{version}-py*.egg-info | |
107 | %endif | |
108 | ||
109 | %if %{with doc} | |
110 | %files apidoc | |
111 | %defattr(644,root,root,755) | |
112 | %doc docs/_build/html/* | |
113 | %endif |