]> git.pld-linux.org Git - SPECS.git/blob - python-pymediainfo.spec
SPECS updated Sat 31 Jul 20:27:02 CEST 2021
[SPECS.git] / python-pymediainfo.spec
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
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}
14 Version:        2.2.0
15 Release:        4
16 License:        MIT
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
24 %if %{with python2}
25 BuildRequires:  python-devel
26 BuildRequires:  python-setuptools
27 %if %{with tests}
28 BuildRequires:  python-pytest
29 BuildRequires:  python-pytest-runner
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-devel
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-pytest
37 BuildRequires:  python3-pytest-runner
38 %endif
39 %endif
40 %if %{with doc}
41 BuildRequires:  sphinx-pdg
42 %endif
43 Requires:       libmediainfo
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
50 %description -l pl.UTF-8
51 Mały pakiet obudowujący bibliotekę MediaInfo.
52
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
58
59 %description -n python3-%{pypi_name}
60 This small package is a wrapper around the MediaInfo library.
61
62 %description -n python3-%{pypi_name} -l pl.UTF-8
63 Mały pakiet obudowujący bibliotekę MediaInfo.
64
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}
74
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}
85
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
This page took 0.100032 seconds and 3 git commands to generate.