File cantor.spec of Package cantor
#
# spec file for package cantor
#
# Copyright (c) 2017 SUSE LINUX 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/
#
%bcond_without lang
%global libMAJOR 18
Name: cantor
Version: 18.04.3
Release: 0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
Summary: Worksheet GUI for mathematical software
License: GPL-2.0+
Group: Amusements/Teaching/Mathematics
Url: http://edu.kde.org
Source0: %{name}-%{version}.tar.xz
BuildRequires: R-base
BuildRequires: R-base-devel
BuildRequires: analitza-devel
BuildRequires: extra-cmake-modules
BuildRequires: fdupes
BuildRequires: gcc-fortran
BuildRequires: help2man
BuildRequires: karchive-devel
BuildRequires: kconfig-devel
BuildRequires: kcoreaddons-devel
BuildRequires: kdelibs4support-devel
BuildRequires: kf5-filesystem
BuildRequires: knewstuff-devel
BuildRequires: kparts-devel
BuildRequires: kpty-devel
BuildRequires: ktexteditor-devel
BuildRequires: libspectre-devel
BuildRequires: perl
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: python3-devel
BuildRequires: xz
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5XmlPatterns)
Recommends: maxima
Recommends: octave
Obsoletes: %{name}5 < %{version}
Provides: %{name}5 = %{version}
%if %{with lang}
Recommends: %{name}-lang
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A frontend to several existing mathematical software such as R, Sage
and Maxima: Cantor. Cantor offers a worksheet as a nice GUI for all
those backends and is not targeted to kids but to scientists.
%package devel
Summary: Worksheet GUI for mathematical software
Group: Development/Libraries/KDE
Requires: libcantorlibs%{libMAJOR} = %{version}
%description devel
A frontend to several existing mathematical software such as R, Sage
and Maxima: Cantor. Cantor offers a worksheet as a nice GUI for all
those backends and is not targeted to kids but to scientists.
%package -n libcantorlibs%{libMAJOR}
Summary: Shared libraries for Cantor
Group: System/Libraries
%description -n libcantorlibs%{libMAJOR}
Shared libraries for package cantor.
%if %{with lang}
%lang_package
%endif
%prep
%setup -q
mkdir .doc
cd src/backends
for d in *
do ! ln -T "${d}/DESIGN" "../../.doc/${d}"
done
%build
export RPM_OPT_FLAGS="%{optflags}"
%ifarch ppc ppc64
export RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
%endif
# Julia uses <> instead of "" in some files, so it has to be a system include
# export RPM_OPT_FLAGS="%{optflags} -isystem %{_includedir}/julia -isystem $PWD/src/lib/test -isystem %{_includedir}/qt5/QtTest"
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
%cmake_kf5 -d build
%make_jobs
%install
%kf5_makeinstall -C build
%if %{with lang}
%find_lang %{name} --with-man --all-name
%kf5_find_htmldocs
%endif
%post -n libcantorlibs%{libMAJOR} -p /sbin/ldconfig
%postun -n libcantorlibs%{libMAJOR} -p /sbin/ldconfig
%files devel
%defattr(-,root,root)
%license COPYING*
%{_kf5_libdir}/libcantorlibs.so
%{_kf5_prefix}/include/cantor/
%files
%defattr(-,root,root)
%doc README.md TODO DESIGN .doc/*
%license COPYING*
%(config) %{_kf5_configdir}/*.knsrc
%doc %lang(en) %{_kf5_htmldir}/en/*/
%{_kf5_applicationsdir}/org.kde.cantor.desktop
%{_kf5_appstreamdir}/
%{_kf5_bindir}/cantor
%{_kf5_bindir}/cantor_python3server
%{_kf5_bindir}/cantor_rserver
%{_kf5_bindir}/cantor_scripteditor
%{_kf5_configkcfgdir}/
%{_kf5_iconsdir}/hicolor/*/apps/*
%{_kf5_kxmlguidir}/cantor/
%{_kf5_libdir}/libcantor_config.so
%{_kf5_libdir}/libcantor_pythonbackend.so
%{_kf5_plugindir}/
%{_kf5_sharedir}/cantor/
%files -n libcantorlibs%{libMAJOR}
%defattr(-,root,root)
%license COPYING*
%{_kf5_libdir}/libcantorlibs.so.*
%if %{with lang}
%files lang -f %{name}.lang
%license COPYING*
%endif
%changelog