3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module pymediainfo
9 %define egg_name pymediainfo
10 %define pypi_name pymediainfo
11 Summary: A Python wrapper for the mediainfo library
12 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki mediainfo
13 Name: python-%{pypi_name}
17 Group: Libraries/Python
18 #Source0Download: https://pypi.org/simple/pymediainfo/
19 Source0: https://files.pythonhosted.org/packages/source/p/pymediainfo/%{pypi_name}-%{version}.tar.gz
20 # Source0-md5: 66602dc7015648e7735a2abae346deea
21 URL: https://github.com/sbraz/pymediainfo
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
25 BuildRequires: python-devel
26 BuildRequires: python-setuptools
28 BuildRequires: python-pytest
29 BuildRequires: python-pytest-runner
33 BuildRequires: python3-devel
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-pytest
37 BuildRequires: python3-pytest-runner
41 BuildRequires: sphinx-pdg
43 Requires: libmediainfo
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 This small package is a wrapper around the MediaInfo library.
50 %description -l pl.UTF-8
51 Mały pakiet obudowujący bibliotekę MediaInfo.
53 %package -n python3-%{pypi_name}
54 Summary: A Python wrapper for the mediainfo library
55 Summary(pl.UTF-8): Pythonowy interfejs do biblioteki mediainfo
56 Group: Libraries/Python
57 Requires: libmediainfo
59 %description -n python3-%{pypi_name}
60 This small package is a wrapper around the MediaInfo library.
62 %description -n python3-%{pypi_name} -l pl.UTF-8
63 Mały pakiet obudowujący bibliotekę MediaInfo.
66 %setup -q -n %{pypi_name}-%{version}
68 # Remove bundled egg-info
69 %{__rm} -r %{egg_name}.egg-info
73 %py_build %{?with_tests:test}
77 sphinx-build docs html
78 # remove the sphinx-build leftovers
79 %{__rm} -r html/.{doctrees,buildinfo}
84 %py3_build %{?with_tests:test}
88 python3-sphinx-build docs html
89 # remove the sphinx-build leftovers
90 %{__rm} -r html/.{doctrees,buildinfo}
95 rm -rf $RPM_BUILD_ROOT
106 rm -rf $RPM_BUILD_ROOT
110 %defattr(644,root,root,755)
111 %doc README.rst %{?with_doc:html}
112 %{py_sitescriptdir}/%{module}
113 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
117 %files -n python3-%{pypi_name}
118 %defattr(644,root,root,755)
119 %doc README.rst %{?with_doc:html}
120 %{py3_sitescriptdir}/%{module}
121 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info