2017-12-18 08:30:55 +00:00
#
# spec file for package python-Mathics
#
2021-04-24 07:52:52 +00:00
# Copyright (c) 2021 SUSE LLC
2017-12-18 08:30:55 +00:00
#
# 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.
2020-03-17 13:46:29 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-12-18 08:30:55 +00:00
#
2020-03-17 13:46:29 +00:00
2017-12-18 08:30:55 +00:00
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
2020-11-19 16:31:45 +00:00
# Upstream no longer supports python2
%define skip_python2 1
2021-04-24 07:52:52 +00:00
%define skip_python36 1
2020-11-19 16:31:45 +00:00
%define pyname Mathics3
2017-12-18 08:30:55 +00:00
Name : python-Mathics
2021-01-06 12:09:36 +00:00
Version : 1.1.1
2017-12-18 08:30:55 +00:00
Release : 0
Summary : A general-purpose computer algebra system
2017-12-20 15:25:13 +00:00
# Mathics itself is licensed as GPL-3.0 but it includes third-party software with MIT, BSD-3-Clause, and Apache-2.0 Licensing; also includes data from wikipedia licensed under CC-BY-SA-3.0 and GFDL-1.3
2021-04-24 07:52:52 +00:00
License : Apache-2.0 AND BSD-3-Clause AND GPL-3.0-only AND MIT
2020-03-17 13:46:29 +00:00
URL : https://mathics.github.io/
2020-11-19 16:31:45 +00:00
Source : https://github.com/mathics/Mathics/archive/%{version} /%{pyname} -%{version} .tar.gz
2020-03-17 13:46:29 +00:00
BuildRequires : %{python_module Django >= 1.8}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module colorama}
BuildRequires : %{python_module devel}
BuildRequires : %{python_module mpmath >= 0.19}
2020-03-17 13:46:29 +00:00
BuildRequires : %{python_module numpy}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module pexpect}
BuildRequires : %{python_module python-dateutil}
BuildRequires : %{python_module setuptools}
BuildRequires : %{python_module six >= 1.10}
2020-11-19 16:31:45 +00:00
BuildRequires : %{python_module sympy >= 1.6}
2020-03-17 13:46:29 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2017-12-18 08:30:55 +00:00
Requires : python-Django >= 1.8
Requires : python-mpmath >= 0.19
Requires : python-python-dateutil
Requires : python-six >= 1.10
2021-01-06 12:09:36 +00:00
Requires : python-sympy >= 1.7.1
2020-11-19 16:31:45 +00:00
# SECTION For tests
BuildRequires : %{python_module Pint}
BuildRequires : %{python_module chardet}
BuildRequires : %{python_module palettable}
BuildRequires : %{python_module pytest}
BuildRequires : %{python_module requests}
# /SECTION
2020-05-25 12:16:19 +00:00
Requires(post) : update-alternatives
2021-04-24 07:52:52 +00:00
Requires(postun) : update-alternatives
2017-12-18 08:30:55 +00:00
%python_subpackages
%description
Mathics is a general-purpose computer algebra system (CAS). It is meant to be a free, lightweight alternative to Mathematica.
%prep
2020-11-19 16:31:45 +00:00
%setup -q -n Mathics-%{version}
2020-03-17 13:46:29 +00:00
%autopatch -p1
2017-12-18 08:30:55 +00:00
# FIX SPURIOUS EXEC PERMISSIONS
find ./mathics/web/media/js -name " * . j s " -exec chmod -x '{}' \;
find ./mathics/web/media/js -name " * . s v g " -exec chmod -x '{}' \;
chmod -x ./mathics/data/ExampleData/{numberdata.csv,InventionNo1.xml}
# WRONG END-OF-FILE ENCODING
sed -i " s / \r $ / / " ./mathics/data/ExampleData/numberdata.csv
# REMOVE SHEBANGS FROM FILES INSTALLED TO NON-EXEC LOCATIONS
pushd mathics
for d in `find ./ -prune -type d`
do
find ${d} -name " * . p y " -exec sed -i " 1 , 4 { / \ / u s r \ / b i n \ / e n v / d } " '{}' \;
done
popd
%build
%python_build
%install
%python_install
2021-01-06 12:09:36 +00:00
%python_clone -a %{buildroot} %{_bindir} /dmathicsserver
%python_clone -a %{buildroot} %{_bindir} /dmathicsscript
2020-05-25 12:16:19 +00:00
%python_clone -a %{buildroot} %{_bindir} /mathics
%python_clone -a %{buildroot} %{_bindir} /mathicsserver
2020-03-17 13:46:29 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2017-12-18 08:30:55 +00:00
2020-03-17 13:46:29 +00:00
%check
2020-11-19 16:31:45 +00:00
# Home page tests require django server up and running
%pytest -k 'not test_home_page'
2017-12-18 08:30:55 +00:00
2020-05-25 12:16:19 +00:00
%post
2021-01-06 12:09:36 +00:00
%python_install_alternative dmathicsserver
%python_install_alternative dmathicsscript
2020-05-25 12:16:19 +00:00
%python_install_alternative mathics
%python_install_alternative mathicsserver
%postun
2021-01-06 12:09:36 +00:00
%python_install_alternative dmathicsserver
%python_install_alternative dmathicsscript
%python_install_alternative mathics
%python_install_alternative mathicsserver
2020-05-25 12:16:19 +00:00
2020-03-17 13:46:29 +00:00
%files %{python_files}
%license COPYING.txt
%doc README.rst AUTHORS.txt
2017-12-18 08:30:55 +00:00
%{python_sitelib} /mathics/
2020-03-17 13:46:29 +00:00
%{python_sitelib} /%{pyname} -%{version} -py%{python_version} .egg-info/
2021-01-06 12:09:36 +00:00
%python_alternative %{_bindir} /dmathicsscript
%python_alternative %{_bindir} /dmathicsserver
2020-05-25 12:16:19 +00:00
%python_alternative %{_bindir} /mathics
2021-01-06 12:09:36 +00:00
%python_alternative %{_bindir} /mathicsserver
2017-12-18 08:30:55 +00:00
%changelog