]> git.pld-linux.org Git - packages/python-rtmidi.git/blame - python-rtmidi.spec
disable tests
[packages/python-rtmidi.git] / python-rtmidi.spec
CommitLineData
4d102708
JK
1#
2# Conditional build:
3%bcond_without doc # don't build doc
86269b32 4%bcond_with tests # run tests
4d102708
JK
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
8%define module rtmidi
9%define pypi_name python-rtmidi
10Summary: A Python wrapper for the RtMidi C++ library
11Name: python-%{module}
12Version: 1.1.0
13Release: 1
14License: MIT
15Group: Libraries/Python
16Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.zip
17# Source0-md5: dac7edb268a8dcd454fbeeb19ac6fb07
18URL: http://trac.chrisarndt.de/code/wiki/python-rtmidi
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
21%if %{with python2}
22BuildRequires: python-devel
23BuildRequires: python-setuptools
24%endif
25%if %{with python3}
26BuildRequires: python3-devel
27BuildRequires: python3-setuptools
28%endif
29%if %{with doc}
30BuildRequires: sphinx-pdg
31%endif
32BuildRequires: rtmidi-devel
33Requires: python-modules
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37python-rtmidi is a Python binding for RtMidi implemented with ​Cython
38and provides a thin wrapper around the RtMidi C++ interface. The API
39is basically the same as the C++ one but with the naming scheme of
40classes, methods and parameters adapted to the Python PEP-8
41conventions and requirements of the Python package naming structure.
42
43%package -n python3-%{module}
44Summary: A Python wrapper for the RtMidi C++ library
45Group: Libraries/Python
46Requires: python3-modules
47
48%description -n python3-%{module}
49python-rtmidi is a Python binding for RtMidi implemented with ​Cython
50and provides a thin wrapper around the RtMidi C++ interface. The API
51is basically the same as the C++ one but with the naming scheme of
52classes, methods and parameters adapted to the Python PEP-8
53conventions and requirements of the Python package naming structure.
54
55%package apidocs
56Summary: %{module} API documentation
57Summary(pl.UTF-8): Dokumentacja API %{module}
58Group: Documentation
59
60%description apidocs
61API documentation for %{module}.
62
63%description apidocs -l pl.UTF-8
64Dokumentacja API %{module}.
65
66%prep
67%setup -q
68
69%build
70%if %{with python2}
71%py_build %{?with_tests:test}
72%endif
73
74%if %{with python3}
75%py3_build %{?with_tests:test}
76%endif
77
78%if %{with doc}
79cd docs
80%{__make} -j1 html
81rm -rf _build/html/_sources
82%endif
83
84%install
85rm -rf $RPM_BUILD_ROOT
86%if %{with python2}
87%py_install
88%py_postclean
89%endif
90
91%if %{with python3}
92%py3_install
93%endif
94
95%if %{with python2}
96install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
97cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
98find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
99 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
100%endif
101%if %{with python3}
102install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
103cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
104find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
105 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
106%endif
107
108%clean
109rm -rf $RPM_BUILD_ROOT
110
111%if %{with python2}
112%files
113%defattr(644,root,root,755)
114%doc AUTHORS.rst CHANGELOG.rst README.rst
115%dir %{py_sitedir}/%{module}
116%{py_sitedir}/%{module}/*.py[co]
117%attr(755,root,root) %{py_sitedir}/%{module}/*.so
118%{py_sitedir}/python_rtmidi-%{version}-py*.egg-info
119%{_examplesdir}/%{name}-%{version}
120%endif
121
122%if %{with python3}
123%files -n python3-%{module}
124%defattr(644,root,root,755)
125%doc AUTHORS.rst CHANGELOG.rst README.rst
126%dir %{py3_sitedir}/%{module}
127%{py3_sitedir}/%{module}/*.py
128%attr(755,root,root) %{py3_sitedir}/%{module}/*.so
129%{py3_sitedir}/%{module}/__pycache__
130%{py3_sitedir}/python_rtmidi-%{version}-py*.egg-info
131%{_examplesdir}/python3-%{module}-%{version}
132%endif
133
134%if %{with doc}
135%files apidocs
136%defattr(644,root,root,755)
137%doc docs/_build/html/*
138%endif
This page took 0.065664 seconds and 4 git commands to generate.