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