File wxMaxima.spec of Package wxMaxima

#
# spec file for package wxMaxima
#
# Copyright (c) 2018 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:        18.02.0
Release:        0
Summary:        Graphical User Interface for the maxima Computer Algebra System
License:        GPL-2.0+
Group:          Productivity/Scientific/Math
Url:            http://andrejv.github.io/wxmaxima/
Source0:        https://github.com/andrejv/wxmaxima/archive/Version-%{version}.tar.gz
Source1:        wxMaxima.desktop
Source2:        %{name}-rpmlintrc
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  maxima >= 5.30.0
BuildRequires:  rsvg-view
BuildRequires:  update-desktop-files
BuildRequires:  wxWidgets-devel >= 3
# 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
ExcludeArch:    ppc64 ppc64le

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

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

%build
%cmake

make %{?_smp_mflags}

%install
%cmake_install
# 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
  rsvg-convert -w ${i} data/wxmaxima.svg -o 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 README.md AND COPYING FILES INSTALLED BY mak install, WE INCLUDE THEM BY USING %%doc
rm %{buildroot}%{_datadir}/%{name}/README.md
rm %{buildroot}%{_datadir}/%{name}/COPYING

%suse_update_desktop_file wxMaxima

%fdupes %{buildroot}%{_prefix}

%find_lang %{name}

%post
%if 0%{?suse_version} < 1500
%desktop_database_post
%icon_theme_cache_post
%mime_database_post
%endif
%install_info --info-dir=%{_infodir} %{_infodir}/wxmaxima.info%{ext_info}

%postun
%if 0%{?suse_version} < 1500
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun
%endif
%install_info_delete --info-dir=%{_infodir} %{_infodir}/wxmaxima.info%{ext_info}

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README.md ChangeLog
%{_datadir}/doc/%{tarname}/
%{_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
%dir %{_datadir}/metainfo
%{_datadir}/metainfo/wxMaxima.appdata.xml
%{_mandir}/man1/wxmaxima*%{ext_man}
%{_datadir}/mime/packages/*.xml
%{_datadir}/pixmaps/*.svg

%changelog
openSUSE Build Service is sponsored by