]>
Commit | Line | Data |
---|---|---|
65aa80ce ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module parted | |
eb5307b8 JB |
7 | Summary: Python 2.x bindings for libparted library |
8 | Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libparted | |
65aa80ce | 9 | Name: python-%{module} |
8837c633 | 10 | Version: 3.11.2 |
ade53e84 | 11 | Release: 4 |
6a5082dc | 12 | License: GPL v2+ |
f1f36bea | 13 | Group: Libraries/Python |
8837c633 JB |
14 | #Source0Download: https://github.com/dcantrell/pyparted/releases |
15 | Source0: https://github.com/dcantrell/pyparted/releases/download/v%{version}/pyparted-%{version}.tar.gz | |
16 | # Source0-md5: 9477016f5a00bd2d7a280879cdeec3a4 | |
baa4a6a7 | 17 | Patch0: gcc10.patch |
8837c633 | 18 | URL: https://github.com/dcantrell/pyparted |
e60c57f7 | 19 | BuildRequires: parted-devel >= 3.1 |
761dee25 | 20 | BuildRequires: pkgconfig |
94e8c355 | 21 | BuildRequires: rpm-pythonprov |
8837c633 | 22 | BuildRequires: rpmbuild(macros) >= 1.714 |
65aa80ce ER |
23 | %if %{with python2} |
24 | BuildRequires: python-devel >= 1:2.7 | |
8837c633 | 25 | BuildRequires: python-modules >= 1:2.7 |
65aa80ce ER |
26 | %endif |
27 | %if %{with python3} | |
8837c633 JB |
28 | BuildRequires: python3-devel >= 1:3.2 |
29 | BuildRequires: python3-modules >= 1:3.2 | |
65aa80ce | 30 | %endif |
e60c57f7 | 31 | Requires: parted >= 3.1 |
0dccf8bd PZ |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
34 | %description | |
eb5307b8 JB |
35 | Python 2.x bindings for the libparted library. It is used for |
36 | manipulating partition tables. | |
0dccf8bd | 37 | |
d59db43c | 38 | %description -l pl.UTF-8 |
eb5307b8 JB |
39 | Wiązania Pythona 2.x do biblioteki libparted. Służy do modyfikowania |
40 | tablic partycji. | |
1d44540f | 41 | |
65aa80ce | 42 | %package -n python3-%{module} |
eb5307b8 JB |
43 | Summary: Python 3.x bindings for libparted library |
44 | Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libparted | |
65aa80ce | 45 | Group: Libraries/Python |
8837c633 | 46 | Requires: parted >= 3.1 |
65aa80ce ER |
47 | |
48 | %description -n python3-%{module} | |
eb5307b8 JB |
49 | Python 3.x bindings for the libparted library. It is used for |
50 | manipulating partition tables. | |
65aa80ce ER |
51 | |
52 | %description -n python3-%{module} -l pl.UTF-8 | |
eb5307b8 JB |
53 | Wiązania Pythona 3.x do biblioteki libparted. Służy do modyfikowania |
54 | tablic partycji. | |
65aa80ce | 55 | |
0dccf8bd PZ |
56 | %prep |
57 | %setup -q -n pyparted-%{version} | |
baa4a6a7 | 58 | %patch0 -p1 |
0dccf8bd PZ |
59 | |
60 | %build | |
65aa80ce | 61 | %if %{with python2} |
f037ab2f | 62 | %py_build |
65aa80ce ER |
63 | %endif |
64 | ||
65 | %if %{with python3} | |
f037ab2f | 66 | %py3_build |
65aa80ce | 67 | %endif |
0dccf8bd PZ |
68 | |
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
65aa80ce | 71 | %if %{with python2} |
f037ab2f | 72 | %py_install |
1d44540f | 73 | |
5a6eb7e0 | 74 | %py_postclean |
65aa80ce ER |
75 | %endif |
76 | ||
77 | %if %{with python3} | |
f037ab2f | 78 | %py3_install |
65aa80ce | 79 | %endif |
5a6eb7e0 | 80 | |
0dccf8bd PZ |
81 | %clean |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
65aa80ce | 84 | %if %{with python2} |
0dccf8bd PZ |
85 | %files |
86 | %defattr(644,root,root,755) | |
8837c633 | 87 | %doc AUTHORS NEWS README TODO |
cce5f450 | 88 | %attr(755,root,root) %{py_sitedir}/_ped.so |
ba4d6950 PZ |
89 | %dir %{py_sitedir}/parted |
90 | %{py_sitedir}/parted/*.py[co] | |
89ffcaae | 91 | %{py_sitedir}/pyparted-%{version}-py*.egg-info |
65aa80ce ER |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
95 | %files -n python3-%{module} | |
96 | %defattr(644,root,root,755) | |
8837c633 | 97 | %doc AUTHORS NEWS README TODO |
65aa80ce | 98 | %attr(755,root,root) %{py3_sitedir}/_ped.*.so |
04e6a5f1 | 99 | %dir %{py3_sitedir}/parted |
65aa80ce ER |
100 | %{py3_sitedir}/parted/*.py |
101 | %{py3_sitedir}/parted/__pycache__ | |
102 | %{py3_sitedir}/pyparted-%{version}-py*.egg-info | |
103 | %endif |