#
# Conditional build:
%bcond_without tk # build without tkinter support
+%bcond_with sane # build with sane support
%define module PIL
Summary: Python's own image processing library
Summary(pl.UTF-8): Biblioteka do przetwarzania obrazu w Pythonie
Name: python-%{module}
Version: 1.1.7
-Release: 7
+Release: 8
Epoch: 1
License: BSD-like
Group: Libraries/Python
%{?with_tk:BuildRequires: python-tkinter}
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
-BuildRequires: sane-backends-devel
+%{?with_sane:BuildRequires: sane-backends-devel}
%{?with_tk:BuildRequires: tk-devel}
BuildRequires: zlib-devel >= 1.2.3
%pyrequires_eq python-libs
%{__python} setup.py build_ext -i
%{__python} selftest.py
+%if %{with sane}
cd Sane
%{__python} setup.py build
+%endif
%install
rm -rf $RPM_BUILD_ROOT
--optimize=2 \
--root=$RPM_BUILD_ROOT
+%if %{with sane}
cd Sane
%{__python} setup.py install \
--optimize=2 \
--root=$RPM_BUILD_ROOT
cd ..
+%endif
install -d $RPM_BUILD_ROOT%{py_incdir}
cp -a libImaging/Im{Platform,aging}.h $RPM_BUILD_ROOT%{py_incdir}
%exclude %{py_sitedir}/%{module}/_imagingtk.so
%endif
+%if %{with sane}
%files sane
%defattr(644,root,root,755)
%doc Sane/CHANGES Sane/demo*.py Sane/sanedoc.txt
%if "%{py_ver}" > "2.4"
%{py_sitedir}/pysane-*.egg-info
%endif
+%endif
%if %{with tk}
%files tk