]> git.pld-linux.org Git - packages/python-gsmmodem-new.git/blame - python-gsmmodem-new.spec
rebuild with python 3.10
[packages/python-gsmmodem-new.git] / python-gsmmodem-new.spec
CommitLineData
103d79ce
AM
1# Conditional build:
2%bcond_without doc # Sphinx documentation
3%bcond_without tests # unit tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module gsmmodem
8%define egg_name python_gsmmodem_new
9%define pypi_name gsmmodem-new
10Summary: GSM modem module for Python
11Name: python-%{pypi_name}
12Version: 0.12
eac710be 13Release: 4
103d79ce
AM
14License: LGPL v3+
15Group: Libraries/Python
16Source0: https://github.com/babca/python-gsmmodem/archive/%{version}.tar.gz
17# Source0-md5: 797db0e6c9068daa4d3c88d8425a3ccd
18URL: https://github.com/babca/python-gsmmodem
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
21%if %{with python2}
22BuildRequires: python-modules
23%{?with_tests:BuildRequires: python-serial}
24BuildRequires: python-setuptools
25%endif
26%if %{with python3}
27BuildRequires: python3-modules
28%{?with_tests:BuildRequires: python3-serial}
29BuildRequires: python3-setuptools
30%endif
31Requires: python-modules
32Requires: python-serial
33BuildArch: noarch
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37Allows easy control of a GSM modem attached to the system. It also
38includes a couple of useful commandline utilities for interacting with
39a GSM modem.
40
41%package -n python3-%{pypi_name}
42Summary: GSM modem module for Python
43Group: Libraries/Python
44Requires: python3-modules
45Requires: python3-serial
46
47%description -n python3-%{pypi_name}
48Allows easy control of a GSM modem attached to the system. It also
49includes a couple of useful commandline utilities for interacting with
50a GSM modem.
51
52%package apidocs
53Summary: API documentation for Python %{module} module
54Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
55Group: Documentation
56
57%description apidocs
58API documentation for Python %{module} module.
59
60%description apidocs -l pl.UTF-8
61Dokumentacja API modułu Pythona %{module}.
62
63%prep
64%setup -q -n python-gsmmodem-%{version}
65
66%build
67%if %{with python2}
68%py_build %{?with_tests:test}
69%endif
70
71%if %{with python3}
72%py3_build %{?with_tests:test}
73%endif
74
75%if %{with doc}
76cd docs
77%{__make} -j1 html
78rm -rf _build/html/_sources
79%endif
80
81%install
82rm -rf $RPM_BUILD_ROOT
83
84%if %{with python2}
85%py_install
86
87%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
88%py_comp $RPM_BUILD_ROOT%{py_sitedir}
89
90%py_postclean
91%endif
92
93%if %{with python3}
94%py3_install
95%endif
96
97# in case there are examples provided
98%if %{with python2}
99install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
100cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version}
101find $RPM_BUILD_ROOT%{_examplesdir}/python-%{pypi_name}-%{version} -name '*.py' \
102 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
103%endif
104%if %{with python3}
105install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
106cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version}
107find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{pypi_name}-%{version} -name '*.py' \
108 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
109%endif
110
111%clean
112rm -rf $RPM_BUILD_ROOT
113
114%if %{with python2}
115%files
116%defattr(644,root,root,755)
117%doc AUTHORS ChangeLog README.rst
118%{py_sitescriptdir}/%{module}
119%{py_sitescriptdir}/gsmtermlib
120%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
121%{_examplesdir}/python-%{pypi_name}-%{version}
122%endif
123
124%if %{with python3}
125%files -n python3-%{pypi_name}
126%defattr(644,root,root,755)
127%attr(755,root,root) %{_bindir}/gsmterm.py
128%attr(755,root,root) %{_bindir}/identify-modem.py
129%attr(755,root,root) %{_bindir}/sendsms.py
130%doc AUTHORS ChangeLog README.rst
131%{py3_sitescriptdir}/%{module}
132%{py3_sitescriptdir}/gsmtermlib
133%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
134%{_examplesdir}/python3-%{pypi_name}-%{version}
135%endif
136
137%if %{with doc}
138%files apidocs
139%defattr(644,root,root,755)
140%doc docs/_build/html/*
141%endif
This page took 0.076322 seconds and 4 git commands to generate.