]>
Commit | Line | Data |
---|---|---|
8ef51ec1 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
10e8fb94 | 4 | %bcond_without python3 # CPython 3.x module |
8ef51ec1 JB |
5 | |
6 | Summary: Python 2 module to interface with the Linux scheduler | |
7 | Summary(pl.UTF-8): Moduł Pythona 2 do komunikacji z linuksowym planistą | |
8 | Name: python-schedutils | |
10e8fb94 | 9 | Version: 0.6 |
e88bf112 | 10 | Release: 7 |
8ef51ec1 JB |
11 | License: GPL v2 |
12 | Group: Libraries/Python | |
13 | Source0: https://www.kernel.org/pub/software/libs/python/python-schedutils/%{name}-%{version}.tar.xz | |
10e8fb94 | 14 | # Source0-md5: e834aa5b0d026102bd9b04f24019c731 |
8ef51ec1 | 15 | URL: https://rt.wiki.kernel.org/index.php/Tuna |
0731b3a0 | 16 | %if %{with python2} |
4270f987 | 17 | BuildRequires: python-devel >= 2 |
8ef51ec1 | 18 | BuildRequires: python-modules >= 2 |
0731b3a0 | 19 | %endif |
8ef51ec1 | 20 | %if %{with python3} |
4270f987 | 21 | BuildRequires: python3-devel >= 1:3.2 |
8ef51ec1 JB |
22 | BuildRequires: python3-modules >= 1:3.2 |
23 | %endif | |
0731b3a0 JB |
24 | BuildRequires: rpm-pythonprov |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
8ef51ec1 JB |
26 | BuildRequires: tar >= 1:1.22 |
27 | BuildRequires: xz | |
8ef51ec1 JB |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | Python 2 interface for the Linux scheduler | |
32 | sched_{get,set}{affinity,scheduler} functions and friends. | |
33 | ||
34 | %description -l pl.UTF-8 | |
35 | Interfejs Pythona 2 do funkcji linuksowego planisty | |
36 | sched_{get,set}{affinity,scheduler} oraz pokrewnych. | |
37 | ||
38 | %package -n python3-schedutils | |
39 | Summary: Python 3 module to interface with the Linux scheduler | |
40 | Summary(pl.UTF-8): Moduł Pythona 3 do komunikacji z linuksowym planistą | |
41 | Group: Libraries/Python | |
42 | ||
43 | %description -n python3-schedutils | |
44 | Python 3 interface for the Linux scheduler | |
45 | sched_{get,set}{affinity,scheduler} functions and friends. | |
46 | ||
47 | %description -n python3-schedutils -l pl.UTF-8 | |
48 | Interfejs Pythona 3 do funkcji linuksowego planisty | |
49 | sched_{get,set}{affinity,scheduler} oraz pokrewnych. | |
50 | ||
51 | %prep | |
52 | %setup -q | |
53 | ||
54 | %build | |
55 | %if %{with python2} | |
47ec5ed5 | 56 | %py_build |
8ef51ec1 JB |
57 | %endif |
58 | ||
59 | %if %{with python3} | |
47ec5ed5 | 60 | %py3_build |
8ef51ec1 JB |
61 | %endif |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | install -d $RPM_BUILD_ROOT%{_bindir} | |
66 | ||
10e8fb94 JB |
67 | %if %{with python3} |
68 | %py3_install | |
69 | %endif | |
70 | ||
8ef51ec1 | 71 | %if %{with python2} |
47ec5ed5 | 72 | %py_install |
8ef51ec1 JB |
73 | |
74 | %py_postclean | |
75 | ||
10e8fb94 JB |
76 | #cp -p pchrt.py $RPM_BUILD_ROOT%{_bindir}/pchrt |
77 | #cp -p ptaskset.py $RPM_BUILD_ROOT%{_bindir}/ptaskset | |
8ef51ec1 JB |
78 | %endif |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %if %{with python2} | |
84 | %files | |
85 | %defattr(644,root,root,755) | |
86 | %doc ChangeLog | |
87 | %attr(755,root,root) %{_bindir}/pchrt | |
88 | %attr(755,root,root) %{_bindir}/ptaskset | |
89 | %attr(755,root,root) %{py_sitedir}/schedutils.so | |
10e8fb94 JB |
90 | %{_mandir}/man1/pchrt.1* |
91 | %{_mandir}/man1/ptaskset.1* | |
8ef51ec1 | 92 | %if "%{py_ver}" > "2.4" |
10e8fb94 | 93 | %{py_sitedir}/schedutils-%{version}-py*.egg-info |
8ef51ec1 JB |
94 | %endif |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %files -n python3-schedutils | |
99 | %defattr(644,root,root,755) | |
100 | %doc ChangeLog | |
101 | %attr(755,root,root) %{py3_sitedir}/schedutils.cpython-*.so | |
10e8fb94 | 102 | %{py3_sitedir}/schedutils-%{version}-py*.egg-info |
8ef51ec1 | 103 | %endif |