File python3-sympy.spec of Package python3-sympy
#
# spec file for package python3-sympy
#
# Copyright (c) 2015 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-sympy
Version: 0.7.6
Release: 0
Summary: Python library for symbolic mathematics
License: BSD-3-Clause
Group: Development/Libraries/Python
Url: http://code.google.com/p/sympy/
Source0: https://github.com/sympy/sympy/releases/download/sympy-%{version}/sympy-%{version}.tar.gz
BuildRequires: python3-devel
#BuildRequires: python3-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
SymPy is a Python library for symbolic mathematics. It aims to become
a full-featured computer algebra system (CAS) while keeping the code
as simple as possible in order to be comprehensible and easily
extensible. SymPy is written entirely in Python and does not require
any external libraries.
%prep
%setup -q -n sympy-%{version}
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./sympy/mpmath/tests/runtests.py
%build
python3 setup.py build
%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
mv %{buildroot}%{_bindir}/isympy %{buildroot}%{_bindir}/isympy-%{py3_ver}
ln -s %{_bindir}/isympy-%{py3_ver} %{buildroot}%{_bindir}/isympy
mv %{buildroot}%{_mandir}/man1/isympy.1 %{buildroot}%{_mandir}/man1/isympy-%{py3_ver}.1
ln -s %{_mandir}/man1/isympy-%{py3_ver}.1 %{buildroot}%{_mandir}/man1/isympy.1
%pre
# Since /usr/bin/isympy and /usr/share/man/man1/isympy.1.gz became ghosted to be used
# with update-alternatives, we have to get rid of the old binary resulting from the
# non-update-alternativies-ified package:
[ -h %{_bindir}/isympy ] || rm -f %{_bindir}/isympy
[ -h %{_mandir}/man1/isympy.1.gz ] || rm -f %{_mandir}/man1/isympy.1.gz
%post
update-alternatives \
--install %{_bindir}/isympy isympy %{_bindir}/isympy-%{py3_ver} 30 \
--slave %{_mandir}/man1/isympy.1.gz isympy.1 %{_mandir}/man1/isympy-%{py3_ver}.1.gz
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove isympy %{_bindir}/isympy-%{py3_ver}
fi
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%ghost %{_bindir}/isympy
%{_bindir}/isympy-%{py3_ver}
%ghost %{_mandir}/man1/isympy.1.gz
%{_mandir}/man1/isympy-%{py3_ver}.1.gz
%{python3_sitelib}/sympy
%{python3_sitelib}/sympy-%{version}-py%{py3_ver}.egg-info
%changelog