File fricas.spec of Package fricas
#
# spec file for package fricas
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
# lisp=sbcl|clisp|ecl
%global lisp sbcl
%if "%{lisp}" == "sbcl" || "%{lisp}" == "clisp"
%global __os_install_post %{_rpmconfigdir}/brp-compress
%endif
Name: fricas
Version: 1.3.12
Release: 0
Summary: An advanced computer algebra system
License: BSD-3-Clause
Group: Productivity/Scientific/Math
URL: https://%{name}.github.io/
Source0: https://github.com/%{name}/%{name}/archive/refs/tags/%{version}.tar.gz
BuildRequires: %{lisp}
BuildRequires: ImageMagick
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gmp-devel
BuildRequires: gnuplot
BuildRequires: pkgconfig
BuildRequires: texlive-dvips
BuildRequires: texlive-epstopdf-bin
BuildRequires: texlive-latex
BuildRequires: texlive-makeindex
BuildRequires: texlive-pdftex
BuildRequires: xorg-x11-server
BuildRequires: xvfb-run
BuildRequires: pkgconfig(ice)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xpm)
BuildRequires: tex(breqn.sty)
BuildRequires: tex(epsf.sty)
BuildRequires: tex(framed.sty)
BuildRequires: tex(listings.sty)
BuildRequires: tex(microtype.sty)
BuildRequires: tex(mleftright.sty)
BuildRequires: tex(tensor.sty)
Requires: %{lisp}
Requires: emacs
Requires: gnuplot
%if "%{lisp}" == "ecl"
BuildRequires: ecl-devel
BuildRequires: pkgconfig(atomic_ops)
BuildRequires: pkgconfig(libffi)
%endif
%description
FriCAS is an advanced computer algebra system. Its capabilities range from
calculus (integration and differentiation) to abstract algebra. It can plot
functions and has integrated help system.
%package doc
Summary: PDF documentation for %{name}
Group: Documentation/Other
BuildArch: noarch
%description doc
This package contains the documentation for %{name} in PDF format.
%prep
%autosetup
# Reproducible builds
sed -i -e 's/`date`/`date -ud @$${SOURCE_DATE_EPOCH:-$$(date +%%s)}`/' Makefile.in
sed -i -e '/\\title{/ a \\\date{'$(date -ud @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%F)'}' \
src/doc/book.tex
sed -i -e '/\\usepackage{hyperref}/ a \ \
\\usepackage[svgnames]{xcolor}\
\\usepackage{microtype}\
\\definecolor{linkcolor}{named}{DodgerBlue}\
\\hypersetup{dvips,colorlinks,linkcolor=linkcolor}' \
src/doc/%{name}.sty
sed -i -e 's/--dynamic-space-size 4096//' configure.ac
autoreconf
%build
%if "%{lisp}" == "ecl" || "%{lisp}" == "clisp"
%configure --with-x --with-gmp --with-lisp=%{lisp}
%endif
%if "%{lisp}" == "sbcl"
%configure --with-x --with-gmp \
%ifarch %{ix86}
--with-lisp='%{lisp} --dynamic-space-size 2048'
%else
--with-lisp='%{lisp} --dynamic-space-size 4096'
%endif
%endif
%make_build -j1
%make_build -j1 -Csrc/doc MAYBE_VIEWPORTS=viewports book
%install
%make_install
%if "%{lisp}" == "sbcl"
sed -i -e '1 a export SBCL_HOME=%{_libexecdir}/sbcl' %{buildroot}%{_bindir}/%{name}
%endif
install -dm0755 %{buildroot}%{_mandir}/man1
install -m0644 doc/%{name}.1 %{buildroot}%{_mandir}/man1
ln -s %{name}.1%{?ext_man} %{buildroot}%{_mandir}/man1/e%{name}.1%{?ext_man}
install -dm0755 %{buildroot}%{_defaultdocdir}/%{name}
install -m0644 src/doc/book.pdf %{buildroot}%{_defaultdocdir}/%{name}
%fdupes %{buildroot}/%{_libdir}/%{name}
%files
%license LICENSE.txt license/LICENSE.AXIOM
%doc ChangeLog README.rst
%{_libdir}/%{name}
%{_bindir}/*
%{_mandir}/man1/{,e}%{name}.1%{?ext_man}
%files doc
%{_defaultdocdir}/%{name}/*.pdf
%changelog