3 %bcond_without doc # don't build doc
4 %bcond_without tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 %define pypi_name pyliblo
10 Summary: pyliblo - Python bindings for the liblo OSC library
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: 1be68794dedaf8cc60748fe94fdb9628
18 URL: http://das.nasophon.de/pyliblo/
19 BuildRequires: liblo-devel >= 0.27
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel
24 BuildRequires: python-setuptools
27 BuildRequires: python3-devel
28 BuildRequires: python3-setuptools
30 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Python bindings for the liblo OSC library.
36 %package -n python3-%{pypi_name}
37 Summary: pyliblo - Python bindings for the liblo OSC library
38 Group: Libraries/Python
39 Requires: python3-modules
41 %description -n python3-%{pypi_name}
42 Python bindings for the liblo OSC library.
44 %package -n %{pypi_name}-tools
45 Summary: OSC tools shipped with pyliblo Python library
48 Requires: python3-%{pypi_name}
50 Requires: python-%{pypi_name}
53 %description -n %{pypi_name}-tools
54 OSC tools shipped with pyliblo Python library.
57 Summary: %{pypi_name} API documentation
58 Summary(pl.UTF-8): Dokumentacja API %{pypi_name}
62 API documentation for %{pypi_name}.
64 %description apidocs -l pl.UTF-8
65 Dokumentacja API %{pypi_name}.
68 %setup -q -n %{pypi_name}-%{version}
72 %py_build %{?with_tests:test}
76 %py3_build %{?with_tests:test}
82 rm -rf _build/html/_sources
86 rm -rf $RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT%{_bindir}/*
98 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
99 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
100 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
101 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
104 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
105 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
106 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
107 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
117 %attr(755,root,root) %{py_sitedir}/%{module}.so
118 %{py_sitedir}/%{pypi_name}-%{version}-py*.egg-info
119 %{_examplesdir}/%{name}-%{version}
123 %files -n python3-%{pypi_name}
124 %defattr(644,root,root,755)
126 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
127 %{py3_sitedir}/%{pypi_name}-%{version}-py*.egg-info
128 %{_examplesdir}/python3-%{pypi_name}-%{version}
131 %files -n %{pypi_name}-tools
132 %defattr(644,root,root,755)
133 %attr(755,root,root) %{_bindir}/dump_osc
134 %attr(755,root,root) %{_bindir}/send_osc
135 %{_mandir}/man1/dump_osc.1*
136 %{_mandir}/man1/send_osc.1*
140 %defattr(644,root,root,755)
141 %doc doc/build/html/*