3 %bcond_without doc # don't build doc
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 %define egg_name notify2
9 %define pypi_name notify2
10 Summary: Python 2 interface to DBus notifications
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: ffccaed9330787c7442b453f6520a474
18 URL: https://bitbucket.org/takluyver/pynotify2
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
30 BuildRequires: python3-devel-tools
31 BuildRequires: sphinx-pdg
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 This is a pure Python replacement for notify-python, using python-dbus
38 to communicate with the notifications server directly.
40 %package -n python3-%{pypi_name}
41 Summary: Python 3 interface to DBus notifications
42 Group: Libraries/Python
44 %description -n python3-%{pypi_name}
45 This is a pure Python replacement for notify-python, using python-dbus
46 to communicate with the notifications server directly.
49 Summary: %{module} API documentation
50 Summary(pl.UTF-8): Dokumentacja API %{module}
54 API documentation for %{module}.
56 %description apidocs -l pl.UTF-8
57 Dokumentacja API %{module}.
60 %setup -q -n %{pypi_name}-%{version}
73 sphinx-build docs html
74 # remove the sphinx-build leftovers
75 %{__rm} -r html/.{doctrees,buildinfo}
79 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
84 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
85 %{__rm} $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}/notify2.py
86 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
87 $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}/*.py
92 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
93 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
94 %{__rm} $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}/notify2.py
95 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \
96 $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
100 rm -rf $RPM_BUILD_ROOT
104 %defattr(644,root,root,755)
105 %{py_sitescriptdir}/%{pypi_name}.py[co]
106 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
107 %{_examplesdir}/python-%{module}-%{version}
111 %files -n python3-%{pypi_name}
112 %defattr(644,root,root,755)
113 %{py3_sitescriptdir}/%{pypi_name}.py
114 %{py3_sitescriptdir}/__pycache__/*.pyc
115 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
116 %{_examplesdir}/python3-%{pypi_name}-%{version}
121 %defattr(644,root,root,755)