- make sane conditional, default: off master
authorMarcin Krol <hawk@tld-linux.org>
Wed, 22 Jul 2015 18:06:10 +0000 (18:06 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Wed, 22 Jul 2015 18:06:10 +0000 (18:06 +0000)
python-PIL.spec

index eec48134eefd3557f19e2b4d9a2d5f9a34251b3a..2dcdf8909f319bf45d8ae8e8a4f40e8531432f16 100644 (file)
@@ -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