File python3-scikit-image.spec of Package python3-scikit-image

#
# spec file for package python3-scikit-image
#
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           python3-scikit-image
Version:        0.12.3
Release:        0
Summary:        Collection of algorithms for image processing in Python
License:        BSD-3-Clause
Group:          Productivity/Scientific/Other
Url:            http://scikit-image.org/
Source0:        https://files.pythonhosted.org/packages/source/s/scikit-image/scikit-image-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  freeimage-devel
BuildRequires:  python3-Cython >= 0.17
BuildRequires:  python3-devel
BuildRequires:  python3-matplotlib >= 1.0
BuildRequires:  python3-nose
BuildRequires:  python3-numpy-devel >= 1.6
BuildRequires:  python3-qt4-devel
BuildRequires:  python3-scipy >= 0.10
BuildRequires:  python3-setuptools
BuildRequires:  python3-networkx
BuildRequires:  python3-Pillow
Requires:       python3 >= 2.5
Requires:       python3-Cython >= 0.17
Requires:       python3-matplotlib >= 1.0
Requires:       python3-numpy >= 1.6
Requires:       python3-scipy >= 0.10
Requires:       python3-networkx
Requires:       python3-Pillow
Recommends:     libfreeimage3
Recommends:     python3-qt4
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%{py_requires}

%description
%{name} is a collection of algorithms for image processing in Python.
It is available free of charge and free of restriction.

%prep
%setup -q -n scikit-image-%{version}

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes -s %{buildroot}

mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/skivi %{buildroot}%{_bindir}/skivi-%{py3_ver}
ln -s -f %{_sysconfdir}/alternatives/skivi %{buildroot}%{_bindir}/skivi
# create a dummy target for /etc/alternatives/skivi
touch %{buildroot}%{_sysconfdir}/alternatives/skivi

%post
update-alternatives \
   --install %{_bindir}/skivi skivi %{_bindir}/skivi-%{py3_ver} 30

%preun
if [ $1 -eq 0 ] ; then
    update-alternatives --remove skivi %{_bindir}/skivi-%{py3_ver}
fi


%files
%defattr(-,root,root)
%doc CONTRIBUTING.txt CONTRIBUTORS.txt LICENSE.txt TASKS.txt TODO.txt
%{_bindir}/skivi
%{_bindir}/skivi-%{py3_ver}
%ghost %{_sysconfdir}/alternatives/skivi
%{python3_sitearch}/skimage/
%{python3_sitearch}/scikit_image-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by