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