66e4a68
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
66e4a68
66e4a68
Name:		anki
66e4a68
Version:	0.9.9.6
9234dd6
Release:	4%{?dist}
66e4a68
Summary:	Flashcard program for using space repetition learning
66e4a68
66e4a68
Group:		Amusements/Games
66e4a68
# the file anki-%{version}/libanki/anki/features/chinese/unihan.db 
66e4a68
# was created out of  Unihan.txt from www.unicode.org (MIT license)
66e4a68
License:	GPLv3+ and MIT
66e4a68
URL:		http://www.ichi2.net/anki
66e4a68
Source0:	%{name}-%{version}-nosamples.tgz
66e4a68
# anki contains a sample with an unclear license
66e4a68
# this script to remove all samples since they are not installed anyway
66e4a68
# Download the upstream tarball and invoke this script while in the
66e4a68
# tarball's directory:
66e4a68
# ./generate-anki-tarball.sh 0.9.9.6
66e4a68
# upstream tarball: http://ichi2.net/anki/download/%{name}-%{version}.tgz
66e4a68
Source1:	generate-anki-tarball.sh
66e4a68
# Config change: don't check for new updates.
66e4a68
Patch0:		anki-0.9.9.6-noupdate.patch
66e4a68
# install issue tracked upstream:
66e4a68
# http://code.google.com/p/anki/issues/detail?id=561
66e4a68
Patch1:		anki-0.9.9.6-unihaninstall.patch
66e4a68
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
66e4a68
BuildRequires:	python-devel, python-setuptools, python-sqlalchemy
66e4a68
BuildRequires:	PyQt4-devel
66e4a68
BuildRequires:  desktop-file-utils
66e4a68
Requires:	qt4, PyQt4
66e4a68
Requires:	python-sqlalchemy, python-simplejson, python-sqlite2
66e4a68
Requires:	numpy
66e4a68
Requires:	pygame
66e4a68
BuildArch:	noarch
66e4a68
66e4a68
%description
66e4a68
Anki is a program designed to help you remember facts (such as words
66e4a68
and phrases in a foreign language) as easily, quickly and efficiently
66e4a68
as possible. Anki is based on a theory called spaced repetition.
66e4a68
66e4a68
%prep
66e4a68
%setup -q
66e4a68
%patch0 -p1 -b .noupdate
66e4a68
%patch1 -p1 -b .unihaninstall
66e4a68
66e4a68
%build
66e4a68
pushd libanki
66e4a68
%{__python} setup.py build
66e4a68
popd
66e4a68
66e4a68
%{__python} setup.py build
66e4a68
66e4a68
66e4a68
%install
66e4a68
rm -rf %{buildroot}
66e4a68
pushd libanki
66e4a68
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
66e4a68
popd
66e4a68
66e4a68
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
66e4a68
66e4a68
install -d %{buildroot}%{_datadir}/applications
66e4a68
desktop-file-install \
66e4a68
  --remove-category=KDE \
66e4a68
  --dir %{buildroot}%{_datadir}/applications \
66e4a68
  %{name}.desktop
66e4a68
66e4a68
install -d %{buildroot}%{_datadir}/pixmaps
66e4a68
install -m 644 icons/anki.png %{buildroot}%{_datadir}/pixmaps/
66e4a68
66e4a68
%clean
66e4a68
rm -rf %{buildroot}
66e4a68
66e4a68
66e4a68
%files
66e4a68
%defattr(-,root,root,-)
66e4a68
%doc COPYING ChangeLog CREDITS README*
66e4a68
# libankiqt
66e4a68
%dir %{python_sitelib}/ankiqt
66e4a68
%{python_sitelib}/ankiqt/*.py*
66e4a68
%{python_sitelib}/ankiqt/ui
66e4a68
%{python_sitelib}/ankiqt/forms
66e4a68
66e4a68
# libanki
66e4a68
%dir %{python_sitelib}/anki
66e4a68
%{python_sitelib}/anki/*.py*
66e4a68
%{python_sitelib}/anki/importing
66e4a68
%{python_sitelib}/anki/features
66e4a68
66e4a68
# locale
66e4a68
%dir %{python_sitelib}/ankiqt/locale/
66e4a68
%dir %{python_sitelib}/anki/locale/
66e4a68
%lang(cs) %{python_sitelib}/*/locale/cs_*/
66e4a68
%lang(de) %{python_sitelib}/*/locale/de_*/
66e4a68
%lang(es) %{python_sitelib}/*/locale/es_*/
66e4a68
%lang(fi) %{python_sitelib}/*/locale/fi_*/
66e4a68
%lang(fr) %{python_sitelib}/*/locale/fr_*/
66e4a68
%lang(it) %{python_sitelib}/*/locale/it_*/
66e4a68
%lang(ja) %{python_sitelib}/*/locale/ja_*/
66e4a68
%lang(ko) %{python_sitelib}/*/locale/ko_*/
66e4a68
%lang(pl) %{python_sitelib}/*/locale/pl_*/
66e4a68
%lang(zh) %{python_sitelib}/anki/locale/zh_*/
66e4a68
66e4a68
%{python_sitelib}/*egg-info
66e4a68
%{_bindir}/anki
66e4a68
%{_datadir}/applications/%{name}.desktop
66e4a68
%{_datadir}/pixmaps/%{name}.png
66e4a68
66e4a68
%changelog
9234dd6
* Sun Mar 01 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.6-4
9234dd6
- Bump release
9234dd6
6eae781
* Fri Feb 27 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.6-3
6eae781
- Proper packaging of locale files
66e4a68
6eae781
* Fri Feb 13 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.6-2
66e4a68
- Fixed license field
66e4a68
- Install unihan.db
66e4a68
6eae781
* Wed Feb 11 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.6-1
6eae781
- First spec file for anki