]>
Commit | Line | Data |
---|---|---|
1891ddaa JB |
1 | # |
2 | # Conditional build: | |
2749bbb7 JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | Summary: Python 2 bindings for libcdio | |
7 | Summary(pl.UTF-8): Wiązania Pythona 2 do libcdio | |
180c8acb | 8 | Name: python-pycdio |
1891ddaa | 9 | Version: 2.1.0 |
914c4ad6 | 10 | Release: 7 |
180c8acb JB |
11 | License: GPL v2+ |
12 | Group: Libraries/Python | |
1891ddaa JB |
13 | Source0: https://ftp.gnu.org/gnu/libcdio/pycdio-%{version}.tar.gz |
14 | # Source0-md5: d1adcee07dc0f510a983547bf5046632 | |
180c8acb | 15 | URL: http://www.gnu.org/software/libcdio/ |
1891ddaa | 16 | BuildRequires: libcdio-devel >= 2.0.0 |
d4c132c2 | 17 | BuildRequires: pkgconfig |
7daadbb3 JB |
18 | %if %{with python2} |
19 | BuildRequires: python-devel >= 1:2.3.5 | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-devel >= 1:3.2 | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
180c8acb | 26 | BuildRequires: rpm-pythonprov |
2749bbb7 JB |
27 | BuildRequires: rpmbuild(macros) >= 1.714 |
28 | BuildRequires: swig-python >= 3 | |
8eacc6c2 | 29 | Requires: libcdio >= 2.0.0 |
2749bbb7 | 30 | Requires: python-libs >= 1:2.3.5 |
180c8acb JB |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
2749bbb7 | 34 | Python 2 bindings for libcdio. |
180c8acb JB |
35 | |
36 | %description -l pl.UTF-8 | |
2749bbb7 JB |
37 | Wiązania Pythona 2 do libcdio. |
38 | ||
39 | %package -n python3-pycdio | |
40 | Summary: Python 3 bindings for libcdio | |
41 | Summary(pl.UTF-8): Wiązania Pythona 3 do libcdio | |
42 | Group: Libraries/Python | |
1891ddaa | 43 | Requires: libcdio >= 2.0.0 |
2749bbb7 JB |
44 | Requires: python3-libs >= 1:3.2 |
45 | ||
46 | %description -n python3-pycdio | |
47 | Python 3 bindings for libcdio. | |
48 | ||
49 | %description -n python3-pycdio -l pl.UTF-8 | |
50 | Wiązania Pythona 3 do libcdio. | |
180c8acb JB |
51 | |
52 | %package examples | |
53 | Summary: Example programs using Python libcdio bindings | |
54 | Summary(pl.UTF-8): Przykładowe programy w Pythonie używające libcdio | |
55 | Group: Libraries/Python | |
56 | Requires: %{name} = %{version}-%{release} | |
57 | ||
58 | %description examples | |
59 | Example programs using Python libcdio bindings. | |
60 | ||
61 | %description examples -l pl.UTF-8 | |
62 | Przykładowe programy w Pythonie używające libcdio. | |
63 | ||
64 | %prep | |
65 | %setup -q -n pycdio-%{version} | |
66 | ||
31f82914 JP |
67 | %{__sed} -i -e '1s,#!.*python,#!%{__python3},' example/*.py |
68 | ||
180c8acb | 69 | %build |
2749bbb7 | 70 | %if %{with python2} |
454d6e98 | 71 | %py_build |
2749bbb7 JB |
72 | %endif |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build | |
76 | %endif | |
180c8acb JB |
77 | |
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
2749bbb7 | 81 | %if %{with python2} |
454d6e98 | 82 | %py_install |
180c8acb | 83 | |
2749bbb7 JB |
84 | %py_postclean |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_install | |
89 | %endif | |
90 | ||
180c8acb JB |
91 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
92 | install example/{*.py,README} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
93 | ||
180c8acb JB |
94 | %clean |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
2749bbb7 | 97 | %if %{with python2} |
180c8acb JB |
98 | %files |
99 | %defattr(644,root,root,755) | |
8eacc6c2 | 100 | %doc ChangeLog README.rst THANKS |
180c8acb JB |
101 | %attr(755,root,root) %{py_sitedir}/_pycdio.so |
102 | %attr(755,root,root) %{py_sitedir}/_pyiso9660.so | |
103 | %{py_sitedir}/cdio.py[co] | |
104 | %{py_sitedir}/iso9660.py[co] | |
105 | %{py_sitedir}/pycdio.py[co] | |
106 | %{py_sitedir}/pyiso9660.py[co] | |
478403e3 | 107 | %{py_sitedir}/pycdio-%{version}-py*.egg-info |
2749bbb7 JB |
108 | %endif |
109 | ||
110 | %if %{with python3} | |
111 | %files -n python3-pycdio | |
112 | %defattr(644,root,root,755) | |
8eacc6c2 | 113 | %doc ChangeLog README.rst THANKS |
2749bbb7 JB |
114 | %attr(755,root,root) %{py3_sitedir}/_pycdio.cpython-*.so |
115 | %attr(755,root,root) %{py3_sitedir}/_pyiso9660.cpython-*.so | |
116 | %{py3_sitedir}/cdio.py | |
117 | %{py3_sitedir}/iso9660.py | |
118 | %{py3_sitedir}/pycdio.py | |
119 | %{py3_sitedir}/pyiso9660.py | |
120 | %{py3_sitedir}/__pycache__/cdio.cpython-*.py[co] | |
121 | %{py3_sitedir}/__pycache__/iso9660.cpython-*.py[co] | |
122 | %{py3_sitedir}/__pycache__/pycdio.cpython-*.py[co] | |
123 | %{py3_sitedir}/__pycache__/pyiso9660.cpython-*.py[co] | |
124 | %{py3_sitedir}/pycdio-%{version}-py*.egg-info | |
125 | %endif | |
180c8acb JB |
126 | |
127 | %files examples | |
128 | %defattr(644,root,root,755) | |
129 | %{_examplesdir}/%{name}-%{version} |