File mnemosyne.spec of Package Mnemosyne

#
# spec file for package mnemosyne
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


Name:           mnemosyne
Version:        2.9
Release:        0
Summary:        Flash-card learning tool
License:        GPL-2.0-or-later
Group:          Productivity/Other
URL:            http://www.mnemosyne-proj.org/
Source0:        https://sourceforge.net/projects/%{name}-proj/files/%{name}/%{name}-%{version}/Mnemosyne-%{version}.tar.gz
Source1:        %{name}.png
Source2:        %{name}.desktop
BuildRequires:  dos2unix
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       python3-cheroot >= 5.0.0
Requires:       python3-CherryPy
Requires:       python3-Pillow
Requires:       python3-WebOb
Requires:       python3-matplotlib
Requires:       python3-matplotlib-qt5
Requires:       python3-qt5 >= 5.8.2
Requires:       python3-qtwebengine-qt5
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
%if 0%{?suse_version}
Recommends:     texlive-latex
%endif

%description
Mnemosyne resembles a traditional flash-card program but with an
important twist: it uses a sophisticated algorithm to schedule the best
time for a card to come up for review.

%lang_package

%prep
%setup -q -n Mnemosyne-%{version}
# rpmlint
find -name "*.py" | xargs -r dos2unix
find -name "README.md" | xargs -r dos2unix
find -name "ChangeLog" | xargs -r dos2unix

%build
cp %{SOURCE3} ./
env CFLAGS="%{optflags}" \
python3 setup.py build

%install
python3 setup.py install \
        --root=%{buildroot} \
        --prefix="%{_prefix}" \
        --install-lib="%{python3_sitelib}"

install -Dm644 %{SOURCE2} %{buildroot}/%{_datadir}/applications/%{name}.desktop
test -d %{buildroot}/%{_datadir}/icons && rm -rf %{buildroot}/%{_datadir}/icons

%find_lang mnemosyne
%if 0%{?suse_version}
%suse_update_desktop_file -i -n -r %{name} Education Languages
%endif

%files
%doc ChangeLog README AUTHORS
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/mnemosyne.png
%{python3_sitelib}/%{name}
%{python3_sitelib}/Mnemosyne*
%{python3_sitelib}/openSM2sync

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by