]>
Commit | Line | Data |
---|---|---|
05b31322 ER |
1 | # |
2 | # Conditional build: | |
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 | |
7 | ||
c88f6c6c JR |
8 | %define module pymediainfo |
9 | %define egg_name pymediainfo | |
05b31322 ER |
10 | %define pypi_name pymediainfo |
11 | Summary: A Python wrapper for the mediainfo library | |
9e87f416 | 12 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki mediainfo |
05b31322 ER |
13 | Name: python-%{pypi_name} |
14 | Version: 2.2.0 | |
342e8235 | 15 | Release: 4 |
05b31322 ER |
16 | License: MIT |
17 | Group: Libraries/Python | |
9e87f416 JB |
18 | #Source0Download: https://pypi.org/simple/pymediainfo/ |
19 | Source0: https://files.pythonhosted.org/packages/source/p/pymediainfo/%{pypi_name}-%{version}.tar.gz | |
05b31322 ER |
20 | # Source0-md5: 66602dc7015648e7735a2abae346deea |
21 | URL: https://github.com/sbraz/pymediainfo | |
22 | BuildRequires: rpm-pythonprov | |
23 | BuildRequires: rpmbuild(macros) >= 1.714 | |
24 | %if %{with python2} | |
25 | BuildRequires: python-devel | |
c88f6c6c | 26 | BuildRequires: python-setuptools |
05b31322 | 27 | %if %{with tests} |
c88f6c6c JR |
28 | BuildRequires: python-pytest |
29 | BuildRequires: python-pytest-runner | |
05b31322 ER |
30 | %endif |
31 | %endif | |
32 | %if %{with python3} | |
33 | BuildRequires: python3-devel | |
9e87f416 | 34 | BuildRequires: python3-setuptools |
05b31322 ER |
35 | %if %{with tests} |
36 | BuildRequires: python3-pytest | |
37 | BuildRequires: python3-pytest-runner | |
05b31322 ER |
38 | %endif |
39 | %endif | |
9e87f416 JB |
40 | %if %{with doc} |
41 | BuildRequires: sphinx-pdg | |
42 | %endif | |
91f348ea | 43 | Requires: libmediainfo |
05b31322 ER |
44 | BuildArch: noarch |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | This small package is a wrapper around the MediaInfo library. | |
49 | ||
9e87f416 JB |
50 | %description -l pl.UTF-8 |
51 | Mały pakiet obudowujący bibliotekę MediaInfo. | |
52 | ||
05b31322 ER |
53 | %package -n python3-%{pypi_name} |
54 | Summary: A Python wrapper for the mediainfo library | |
9e87f416 | 55 | Summary(pl.UTF-8): Pythonowy interfejs do biblioteki mediainfo |
05b31322 | 56 | Group: Libraries/Python |
91f348ea | 57 | Requires: libmediainfo |
05b31322 ER |
58 | |
59 | %description -n python3-%{pypi_name} | |
60 | This small package is a wrapper around the MediaInfo library. | |
61 | ||
9e87f416 JB |
62 | %description -n python3-%{pypi_name} -l pl.UTF-8 |
63 | Mały pakiet obudowujący bibliotekę MediaInfo. | |
64 | ||
05b31322 ER |
65 | %prep |
66 | %setup -q -n %{pypi_name}-%{version} | |
67 | ||
68 | # Remove bundled egg-info | |
69 | %{__rm} -r %{egg_name}.egg-info | |
70 | ||
71 | %build | |
72 | %if %{with python2} | |
73 | %py_build %{?with_tests:test} | |
91f348ea | 74 | |
05b31322 ER |
75 | %if %{with doc} |
76 | # generate html docs | |
77 | sphinx-build docs html | |
78 | # remove the sphinx-build leftovers | |
79 | %{__rm} -r html/.{doctrees,buildinfo} | |
80 | %endif | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_build %{?with_tests:test} | |
91f348ea | 85 | |
05b31322 ER |
86 | %if %{with doc} |
87 | # generate html docs | |
88 | python3-sphinx-build docs html | |
89 | # remove the sphinx-build leftovers | |
90 | %{__rm} -r html/.{doctrees,buildinfo} | |
91 | %endif | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | %if %{with python2} | |
97 | %py_install | |
98 | %py_postclean | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %py3_install | |
103 | %endif | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %files | |
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 | |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
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 | |
122 | %endif |