]>
Commit | Line | Data |
---|---|---|
41e94907 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
a36eb557 | 4 | %bcond_with python3 # CPython 3.x module (built from python3-linux-procfs.spec) |
41e94907 JB |
5 | |
6 | Summary: Linux /proc abstraction classes for Python 2 | |
7 | Summary(pl.UTF-8): Klasy abstrakcji linuksowego /proc dla Pythona 2 | |
8 | Name: python-linux-procfs | |
a36eb557 | 9 | # keep 0.7.0 here for python2 support (0.7.1 uses f-strings, thus requires 3.6+) |
2e1790dd | 10 | Version: 0.7.0 |
192fd7ad | 11 | Release: 5 |
41e94907 JB |
12 | License: GPL v2 |
13 | Group: Libraries/Python | |
14 | Source0: https://www.kernel.org/pub/software/libs/python/python-linux-procfs/%{name}-%{version}.tar.xz | |
2e1790dd | 15 | # Source0-md5: a6c26f7cb2ce077b4d95da0e933a7ee9 |
41e94907 | 16 | URL: https://rt.wiki.kernel.org/index.php/Tuna |
d07a9e8d | 17 | %if %{with python2} |
2e1790dd | 18 | BuildRequires: python-modules >= 1:2.5 |
d07a9e8d JB |
19 | BuildRequires: python-setuptools |
20 | %endif | |
41e94907 JB |
21 | %if %{with python3} |
22 | BuildRequires: python3-modules >= 1:3.2 | |
d07a9e8d | 23 | BuildRequires: python3-setuptools |
41e94907 | 24 | %endif |
d07a9e8d JB |
25 | BuildRequires: rpm-pythonprov |
26 | BuildRequires: rpmbuild(macros) >= 1.714 | |
41e94907 JB |
27 | BuildRequires: tar >= 1:1.22 |
28 | BuildRequires: xz | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Python 2 abstractions to extract information from the Linux kernel | |
34 | /proc files. | |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | Abstrakcje Pythona 2 do wydobywania informacji z plików /proc jądra | |
38 | Linuksa. | |
39 | ||
40 | %package -n python3-linux-procfs | |
41 | Summary: Linux /proc abstraction classes for Python 3 | |
42 | Summary(pl.UTF-8): Klasy abstrakcji linuksowego /proc dla Pythona 3 | |
43 | Group: Libraries/Python | |
44 | ||
45 | %description -n python3-linux-procfs | |
46 | Python 3 abstractions to extract information from the Linux kernel | |
47 | /proc files. | |
48 | ||
49 | %description -n python3-linux-procfs -l pl.UTF-8 | |
50 | Abstrakcje Pythona 3 do wydobywania informacji z plików /proc jądra | |
51 | Linuksa. | |
52 | ||
53 | %prep | |
54 | %setup -q | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
8a7c0aa5 | 58 | %py_build |
41e94907 JB |
59 | %endif |
60 | ||
61 | %if %{with python3} | |
8a7c0aa5 | 62 | %py3_build |
41e94907 JB |
63 | %endif |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
41e94907 JB |
67 | |
68 | %if %{with python2} | |
8a7c0aa5 | 69 | %py_install |
41e94907 JB |
70 | |
71 | %py_postclean | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
7e13eda1 JR |
75 | # Make sure python2 script is removed |
76 | %{__rm} -f $RPM_BUILD_ROOT%{_bindir}/pflags | |
8a7c0aa5 | 77 | %py3_install |
41e94907 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) | |
1f45ad27 JB |
86 | %if %{without python3} |
87 | %attr(755,root,root) %{_bindir}/pflags | |
88 | %endif | |
41e94907 | 89 | %{py_sitescriptdir}/procfs |
1f45ad27 | 90 | %{py_sitescriptdir}/python_linux_procfs-%{version}-py*.egg-info |
41e94907 | 91 | %endif |
41e94907 JB |
92 | |
93 | %if %{with python3} | |
94 | %files -n python3-linux-procfs | |
95 | %defattr(644,root,root,755) | |
a73ee581 | 96 | %attr(755,root,root) %{_bindir}/pflags |
41e94907 | 97 | %{py3_sitescriptdir}/procfs |
1f45ad27 | 98 | %{py3_sitescriptdir}/python_linux_procfs-%{version}-py*.egg-info |
41e94907 | 99 | %endif |