File wxMaxima.spec of Package wxMaxima

#
# spec file for package wxMaxima
#
# Copyright (c) 2015 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/
#


%define tarname wxmaxima

Name:           wxMaxima
Version:        15.08.2
Release:        0
Summary:        Graphical User Interface for the maxima Computer Algebra System
License:        GPL-2.0+
Group:          Productivity/Scientific/Math
Url:            http://wxmaxima.sourceforge.net/
Source0:        http://download.sourceforge.net/wxmaxima/%{tarname}-%{version}.tar.gz
Source1:        wxMaxima.desktop
Source2:        %{name}-rpmlintrc
BuildRequires:  hicolor-icon-theme
# REQUIRED TO GENERATE HI-RES ICONS
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  inkscape
BuildRequires:  maxima >= 5.30.0
BuildRequires:  wxWidgets-devel >= 3
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
# gnuplot is needed for plotting
Requires:       gnuplot
# libgnomeprint is needed for printing
Requires:       libgnomeprint
Requires:       maxima >= 5.30.0
Requires(post): %install_info_prereq
Requires(preun): %install_info_prereq
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
wxMaxima is a cross platform GUI for the computer algebra system maxima
based on wxWidgets.

wxMaxima features include:

    * 2D formatted math display: wxMaxima implements its own math display
      engine to nicely display maxima output.
    * Menu system: most maxima commands are available through menus. Most
      used functions are also available through a button panel at below
      the input line.
    * Dialogs: commands which require more that one argument can be entered
      through dialogs so that there is no need to remember the exact syntax.
    * Command line history: the input line has command history and command
      completion based on previous input.
    * Create documents: text can be mixed with math calculations to create
      documents. See the howto for tips on how to use these features.
      Documents can be saved and edited again later.

%prep
%setup -q -n %{tarname}-%{version}

%build
%configure \
           --enable-printing \
           --enable-unicode-glyphs \
           --docdir=%{_docdir}/%{name}
make %{?_smp_mflags}

%install
%makeinstall
# REMOVE UPSTREAM INSTALLED DESKTOP FILE BECAUSE IT IS INCOMPLETE...
rm %{buildroot}%{_datadir}/applications/wxMaxima.desktop
# ...THEN INSTALL OURS
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/wxMaxima.desktop

# INSTALL HI-RES ICONS GENERATED OUT OF UPSTREAM SVG ICON
for i in 24 32 48 64 128 256 512
do
  inkscape -w ${i} data/wxmaxima.svg -e wxmaxima-${i}.png
  install -D -m 0644 wxmaxima-${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/wxmaxima.png
done
install -D -m 0644 data/wxmaxima.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/wxmaxima.svg

# REMOVE UNNECESSARY ICONS OUT OF PIXMAPS
rm %{buildroot}%{_datadir}/pixmaps/wxmaxima*

# REMOVE UNNECESSARY MENU FILE
rm %{buildroot}/%{_datadir}/menu/wxmaxima.menu

%if 0%{?suse_version}
%suse_update_desktop_file wxMaxima
%endif

%if 0%{?suse_version}
%fdupes %{buildroot}%{_prefix}
%endif

%find_lang %name

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post
%install_info --info-dir=%{_infodir} %{_infodir}/wxmaxima.info.gz

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/wxmaxima.info.gz

%files -f %name.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README.md ChangeLog
%{_bindir}/*
%{_datadir}/wxMaxima/
%dir %{_datadir}/icons/hicolor/512x512
%dir %{_datadir}/icons/hicolor/512x512/apps
%{_datadir}/icons/hicolor/*/apps/wxmaxima.*
%{_datadir}/applications/wxMaxima.desktop
%if 0%{?suse_version} == 1315
%dir %{_datadir}/appdata
%endif
%{_datadir}/bash-completion/completions/wxmaxima
%{_datadir}/appdata/wxmaxima.appdata.xml
%{_mandir}/man1/wxmaxima*.gz
%{_infodir}/wxmaxima.info.gz
%{_datadir}/mime/packages/*.xml
%{_datadir}/pixmaps/*.svg

%changelog
openSUSE Build Service is sponsored by