]> git.pld-linux.org Git - packages/python-linux-procfs.git/blob - python-linux-procfs.spec
85b1359388ae1b48c73e8e34eddb3efffd1bd058
[packages/python-linux-procfs.git] / python-linux-procfs.spec
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
9 Version:        0.4.6
10 Release:        1
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
14 # Source0-md5:  881fa973dd6cda1d431f51126b55b085
15 URL:            https://rt.wiki.kernel.org/index.php/Tuna
16 BuildRequires:  python-modules >= 2
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.612
19 %if %{with python3}
20 BuildRequires:  python3-modules >= 1:3.2
21 %endif
22 BuildRequires:  tar >= 1:1.22
23 BuildRequires:  xz
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 Python 2 abstractions to extract information from the Linux kernel
29 /proc files.
30
31 %description -l pl.UTF-8
32 Abstrakcje Pythona 2 do wydobywania informacji z plików /proc jądra
33 Linuksa.
34
35 %package -n python3-linux-procfs
36 Summary:        Linux /proc abstraction classes for Python 3
37 Summary(pl.UTF-8):      Klasy abstrakcji linuksowego /proc dla Pythona 3
38 Group:          Libraries/Python
39
40 %description -n python3-linux-procfs
41 Python 3 abstractions to extract information from the Linux kernel
42 /proc files.
43
44 %description -n python3-linux-procfs -l pl.UTF-8
45 Abstrakcje Pythona 3 do wydobywania informacji z plików /proc jądra
46 Linuksa.
47
48 %prep
49 %setup -q
50
51 %build
52 %if %{with python2}
53 CC="%{__cc}" \
54 CFLAGS="%{rpmcflags}" \
55 %{__python} setup.py build --build-base build-2
56 %endif
57
58 %if %{with python3}
59 CC="%{__cc}" \
60 CFLAGS="%{rpmcflags}" \
61 %{__python3} setup.py build --build-base build-3
62 %endif
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT%{_sbindir}
67
68 %if %{with python2}
69 %{__python} setup.py \
70         build --build-base build-2 \
71         install --skip-build \
72                 --root=$RPM_BUILD_ROOT \
73                 --optimize=2
74
75 %py_postclean
76 %endif
77
78 %if %{with python3}
79 %{__python3} setup.py \
80         build --build-base build-3 \
81         install --skip-build \
82                 --root=$RPM_BUILD_ROOT \
83                 --optimize=2
84 %endif
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %if %{with python2}
90 %files
91 %defattr(644,root,root,755)
92 %{py_sitescriptdir}/procfs
93 %if "%{py_ver}" > "2.4"
94 %{py_sitescriptdir}/python_linux_procfs-%{version}-py*.egg-info
95 %endif
96 %endif
97
98 %if %{with python3}
99 %files -n python3-linux-procfs
100 %defattr(644,root,root,755)
101 %{py3_sitescriptdir}/procfs
102 %{py3_sitescriptdir}/python_linux_procfs-%{version}-py*.egg-info
103 %endif
This page took 0.043568 seconds and 2 git commands to generate.