]> git.pld-linux.org Git - SPECS.git/blob - python-pyliblo.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-pyliblo.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # don't build doc
4 %bcond_without  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          liblo
9 %define         pypi_name       pyliblo
10 Summary:        pyliblo - Python bindings for the liblo OSC library
11 Name:           python-%{pypi_name}
12 Version:        0.10.0
13 Release:        1
14 License:        LGPL 2.1
15 Group:          Libraries/Python
16 Source0:        https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5:  1be68794dedaf8cc60748fe94fdb9628
18 URL:            http://das.nasophon.de/pyliblo/
19 BuildRequires:  liblo-devel >= 0.27
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 %if %{with python2}
23 BuildRequires:  python-devel
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       python-modules
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 Python bindings for the liblo OSC library.
35
36 %package -n python3-%{pypi_name}
37 Summary:        pyliblo - Python bindings for the liblo OSC library
38 Group:          Libraries/Python
39 Requires:       python3-modules
40
41 %description -n python3-%{pypi_name}
42 Python bindings for the liblo OSC library.
43
44 %package -n %{pypi_name}-tools
45 Summary:        OSC tools shipped with pyliblo Python library
46 Group:          Applications
47 %if %{with python3}
48 Requires:       python3-%{pypi_name}
49 %else
50 Requires:       python-%{pypi_name}
51 %endif
52
53 %description -n %{pypi_name}-tools
54 OSC tools shipped with pyliblo Python library.
55
56 %package apidocs
57 Summary:        %{pypi_name} API documentation
58 Summary(pl.UTF-8):      Dokumentacja API %{pypi_name}
59 Group:          Documentation
60
61 %description apidocs
62 API documentation for %{pypi_name}.
63
64 %description apidocs -l pl.UTF-8
65 Dokumentacja API %{pypi_name}.
66
67 %prep
68 %setup -q -n %{pypi_name}-%{version}
69
70 %build
71 %if %{with python2}
72 %py_build %{?with_tests:test}
73 %endif
74
75 %if %{with python3}
76 %py3_build %{?with_tests:test}
77 %endif
78
79 %if %{with doc}
80 cd doc
81 %{__make} -j1 html
82 rm -rf _build/html/_sources
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87 %if %{with python2}
88 %py_install
89 %py_postclean
90 %endif
91
92 %if %{with python3}
93 rm -rf $RPM_BUILD_ROOT%{_bindir}/*
94 %py3_install
95 %endif
96
97 %if %{with python2}
98 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
99 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
100 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
101         | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
102 %endif
103 %if %{with python3}
104 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
105 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
106 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
107         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
108 %endif
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %files
115 %defattr(644,root,root,755)
116 %doc NEWS README
117 %attr(755,root,root) %{py_sitedir}/%{module}.so
118 %{py_sitedir}/%{pypi_name}-%{version}-py*.egg-info
119 %{_examplesdir}/%{name}-%{version}
120 %endif
121
122 %if %{with python3}
123 %files -n python3-%{pypi_name}
124 %defattr(644,root,root,755)
125 %doc NEWS README
126 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
127 %{py3_sitedir}/%{pypi_name}-%{version}-py*.egg-info
128 %{_examplesdir}/python3-%{pypi_name}-%{version}
129 %endif
130
131 %files -n %{pypi_name}-tools
132 %defattr(644,root,root,755)
133 %attr(755,root,root) %{_bindir}/dump_osc
134 %attr(755,root,root) %{_bindir}/send_osc
135 %{_mandir}/man1/dump_osc.1*
136 %{_mandir}/man1/send_osc.1*
137
138 %if %{with doc}
139 %files apidocs
140 %defattr(644,root,root,755)
141 %doc doc/build/html/*
142 %endif
This page took 0.042638 seconds and 3 git commands to generate.