2 %bcond_without tests # do not perform "make test"
5 # - 'module' should match the Python import path (first component?)
6 # - 'egg_name' should equal to Python egg name
7 # - 'pypi_name' must match the Python Package Index name
8 %define module pychromecast
9 %define egg_name PyChromecast
10 %define pypi_name pychromecast
11 Summary: Library for Python 3 to communicate with the Google Chromecast
12 Name: python3-%{pypi_name}
16 Group: Libraries/Python
17 Source0: https://github.com/balloob/pychromecast/archive/%{version}.tar.gz
18 # Source0-md5: 6f172ab76d8e7adcbbcf9a125b554cd2
19 URL: https://github.com/balloob/pychromecast
20 BuildRequires: python3-modules
21 BuildRequires: python3-setuptools
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
25 BuildRequires: python3-casttube
26 BuildRequires: python3-zeroconf
28 Requires: python3-modules
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Library for Python 3.4+ to communicate with the Google Chromecast. It
36 Auto discovering connected Chromecasts on the network Start the
37 default media receiver and play any online media Control playback of
38 current playing media Implement Google Chromecast api v2 Communicate
39 with apps via channels Easily extendable to add support for
40 unsupported namespaces Multi-room setups with Audio cast devices
43 %setup -q -n %{pypi_name}-%{version}
46 %py3_build %{?with_tests:test}
49 rm -rf $RPM_BUILD_ROOT
53 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
54 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
55 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
56 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
59 rm -rf $RPM_BUILD_ROOT
62 %defattr(644,root,root,755)
64 %{py3_sitescriptdir}/%{module}
65 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
66 %{_examplesdir}/python3-%{pypi_name}-%{version}