]> git.pld-linux.org Git - packages/python-sane.git/blame - python-sane.spec
rebuild with python 3.10
[packages/python-sane.git] / python-sane.spec
CommitLineData
239079b5
JB
1#
2# Conditional build:
3%bcond_without doc # Sphinx documentation
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7Summary: Python 2 SANE module
8Summary(pl.UTF-8): Moduł SANE dla Pythona 2
9Name: python-sane
7786fb33 10# keep 2.8.x here for python2 support
239079b5 11Version: 2.8.3
221dfe8b 12Release: 4
239079b5
JB
13License: MIT-like
14Group: Libraries/Python
15#Source0Download: https://github.com/python-pillow/Sane/releases
16Source0: https://github.com/python-pillow/Sane/archive/v%{version}/Sane-%{version}.tar.gz
17# Source0-md5: 96877da43524fdab2c367541da547d2b
18URL: https://github.com/python-pillow/Sane
19%if %{with python2}
20BuildRequires: python-devel >= 1:2.6
21%endif
22%if %{with python3}
23BuildRequires: python3-devel >= 1:3.2
24%endif
7786fb33 25BuildRequires: rpm-build >= 4.6
239079b5
JB
26BuildRequires: rpm-pythonprov
27BuildRequires: rpmbuild(macros) >= 1.714
28BuildRequires: sane-backends-devel
29%if %{with doc}
30# mocking _sane module doesn't work with python 3.8, so use python2 here
31BuildRequires: python-mock
32BuildRequires: sphinx-pdg-2
33%endif
34Requires: python-modules >= 1:2.6
35Requires: python-numpy
36Requires: python-pillow
37Obsoletes: python-PIL-sane < 1:2.0
38Obsoletes: python-pysane < 2.7.0
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42The SANE module provides an interface to the SANE scanner and frame
43grabber interface for Linux.
44
45%description -l pl.UTF-8
46Moduł SANE udostępnia interfejs do biblioteki SANE będącej interfejsem
47do skanerów i urządzeń przechwytujących ramki obrazu dla Linuksa.
48
49%package -n python3-sane
50Summary: Python 3 SANE module
51Summary(pl.UTF-8): Moduł SANE dla Pythona 3
52Group: Libraries/Python
53Requires: python3-modules >= 1:3.2
54Requires: python3-numpy
55Requires: python3-pillow
56
57%description -n python3-sane
58The SANE module provides an interface to the SANE scanner and frame
59grabber interface for Linux.
60
61%description -n python3-sane -l pl.UTF-8
62Moduł SANE udostępnia interfejs do biblioteki SANE będącej interfejsem
63do skanerów i urządzeń przechwytujących ramki obrazu dla Linuksa.
64
65%package apidocs
66Summary: API documentation for Python SANE module
67Summary(pl.UTF-8): Dokumentacja API modułu Pythona SANE
68Group: Documentation
239079b5 69BuildArch: noarch
239079b5
JB
70
71%description apidocs
72API documentation for Python SANE module.
73
74%description apidocs -l pl.UTF-8
75Dokumentacja API modułu Pythona SANE.
76
77%prep
78%setup -q -n Sane-%{version}
79
80%build
81%if %{with python2}
82%py_build
83%endif
84
85%if %{with python3}
86%py3_build
87%endif
88
89%if %{with doc}
90PYTHONPATH=$(pwd) \
91%{__make} -C doc html \
92 SPHINXBUILD=sphinx-build-2
93%endif
94
95%install
96rm -rf $RPM_BUILD_ROOT
97
98%if %{with python2}
99%py_install
100
101%py_postclean
102%endif
103
104%if %{with python3}
105%py3_install
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 CHANGES.rst COPYING README.rst sanedoc.txt
115%attr(755,root,root) %{py_sitedir}/_sane.so
116%{py_sitedir}/sane.py[co]
117%{py_sitedir}/python_sane-%{version}-py*.egg-info
118%endif
119
120%if %{with python3}
121%files -n python3-sane
122%defattr(644,root,root,755)
123%doc CHANGES.rst COPYING README.rst sanedoc.txt
124%attr(755,root,root) %{py3_sitedir}/_sane.cpython-*.so
125%{py3_sitedir}/sane.py
126%{py3_sitedir}/__pycache__/sane.cpython-*.py[co]
127%{py3_sitedir}/python_sane-%{version}-py*.egg-info
128%endif
129
130%if %{with doc}
131%files apidocs
132%defattr(644,root,root,755)
133%doc doc/_build/html/{_static,*.html,*.js}
134%endif
This page took 0.151667 seconds and 4 git commands to generate.