From a732548e78a0b988d9aba25c3fed30d86354dcd5 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 22 Jul 2015 18:06:10 +0000 Subject: [PATCH] - make sane conditional, default: off --- python-PIL.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python-PIL.spec b/python-PIL.spec index eec4813..2dcdf89 100644 --- a/python-PIL.spec +++ b/python-PIL.spec @@ -1,13 +1,14 @@ # # 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 @@ -26,7 +27,7 @@ BuildRequires: python-devel >= 1:2.5 %{?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 @@ -110,8 +111,10 @@ export CFLAGS="%{rpmcflags}" %{__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 @@ -119,11 +122,13 @@ 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} @@ -157,6 +162,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -165,6 +171,7 @@ rm -rf $RPM_BUILD_ROOT %if "%{py_ver}" > "2.4" %{py_sitedir}/pysane-*.egg-info %endif +%endif %if %{with tk} %files tk -- 2.37.3