File anki.spec of Package anki

#
# spec file for package
#
# Copyright (c) 2010 SUSE LINUX Products 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/
#


Name:           anki
Version:        1.2.4
Release:        0
License:        GNU GPL v3
Summary:        Intelligent Spaced-Repetition Memory Training Program
Url:            http://ichi2.net/anki/
Group:          Productivity/Text/Utilities
Source:         %{name}-%{version}.tar.bz2

BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-qt4
BuildRequires:  python-qt4-devel
BuildRequires:  python-setuptools
BuildRequires:  python-simplejson
BuildRequires:  python-sqlalchemy
BuildRequires:  update-desktop-files

Requires:       python-numpy
Requires:       python-qt4
Requires:       python-simplejson
Requires:       python-sqlalchemy
Requires:       python-sqlite2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%py_requires

%description
Anki is a spaced repetition system (SRS). It helps you remember things by
intelligently scheduling reviews, so that you can learn a lot of information
with the minimum amount of effort.

%prep
%setup -q

%build
pushd libanki
python setup.py build
popd
python setup.py build

%install
pushd libanki
python setup.py install --root=%{buildroot} --prefix=%{_prefix}
popd
python setup.py install --root=%{buildroot} --prefix=%{_prefix}

install -Dm 0644 anki.desktop %{buildroot}%{_datadir}/applications/anki.desktop
install -Dm 0644 icons/anki.png %{buildroot}%{_datadir}/pixmaps/anki.png

%suse_update_desktop_file -r anki Education Languages

for lang_file in libanki ankiqt;
do
    %find_lang $lang_file anki.lang
done
%fdupes %{buildroot}

%clean
test %{buildroot} != "/" && rm -rf %{buildroot}

%files -f anki.lang
%defattr(-,root,root)
%doc COPYING CREDITS ChangeLog README*

# libankiqt
%dir %{python_sitelib}/ankiqt
%{python_sitelib}/ankiqt/*.py*
%{python_sitelib}/ankiqt/ui
%{python_sitelib}/ankiqt/forms

# libanki
%dir %{python_sitelib}/anki
%{python_sitelib}/anki/*.py*
%{python_sitelib}/anki/importing

%{python_sitelib}/anki-%{version}-py%{py_ver}.egg-info
%{python_sitelib}/ankiqt-%{version}-py%{py_ver}.egg-info
%{_bindir}/anki
%{_datadir}/applications/anki.desktop
%{_datadir}/pixmaps/anki.png

%changelog
openSUSE Build Service is sponsored by