33979b7
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
66e4a68
66e4a68
Name:		anki
924a345
Version:	2.0.33
e83196f
Release:	2%{?dist}
66e4a68
Summary:	Flashcard program for using space repetition learning
66e4a68
66e4a68
Group:		Amusements/Games
c9a7f58
License:	AGPLv3+ and GPLv3+ and MIT and BSD
06a4456
URL:		http://ankisrs.net/
c9a7f58
Source0:	http://ankisrs.net/download/mirror/anki-%{version}.tgz
d8841fa
Source1:	anki.svg
30377cb
Source2:	anki.appdata.xml
5a75dcb
66e4a68
# Config change: don't check for new updates.
c9a7f58
Patch0:		anki-2.0.3-noupdate.patch
33979b7
BuildRequires:	python2-devel, python-setuptools, python-sqlalchemy
32a56e8
BuildRequires:	desktop-file-utils, PyQt4, python-simplejson
89c3057
Requires:	hicolor-icon-theme
66e4a68
Requires:	qt4, PyQt4
33979b7
Requires:	python-sqlalchemy, python-simplejson
68f63ae
Requires:	python-matplotlib
c9a7f58
Requires:	pygame, python-BeautifulSoup, python-httplib2
1f47a9d
Requires:	pyaudio, sox
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
1d0c0cc
%setup -q
d8224fa
mv thirdparty/send2trash .
d8224fa
rm -rf thirdparty
c9a7f58
%patch0 -p1 -b .noupdate
66e4a68
66e4a68
%build
1d0c0cc
c9a7f58
%install
c9a7f58
mkdir -p %{buildroot}%{_datadir}/%{name}
7a21ffc
rm -f aqt/*.noupdate
693bc9c
rm -f aqt/*.fix-browserview
c9a7f58
cp -R aqt %{buildroot}%{_datadir}/%{name}/
c9a7f58
cp -R designer %{buildroot}%{_datadir}/%{name}/
c9a7f58
cp -R anki %{buildroot}%{_datadir}/%{name}/
c9a7f58
cp -R locale %{buildroot}%{_datadir}/%{name}/
d8224fa
mkdir -p %{buildroot}%{_datadir}/%{name}/thirdparty
d8224fa
cp -R send2trash %{buildroot}%{_datadir}/%{name}/thirdparty/
66e4a68
c9a7f58
install -d %{buildroot}%{_bindir}
c9a7f58
install -m 755 runanki %{buildroot}%{_bindir}/anki
66e4a68
3940c87
install -d %{buildroot}%{_pkgdocdir}
3940c87
install -m 644 LICENSE* %{buildroot}%{_pkgdocdir}/
3940c87
install -m 644 README* %{buildroot}%{_pkgdocdir}/
c9a7f58
c9a7f58
install -d %{buildroot}%{_datadir}/mime/packages
c9a7f58
install -m 644 anki.xml %{buildroot}%{_datadir}/mime/packages
c9a7f58
89c3057
install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
89c3057
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
66e4a68
c9a7f58
install -d %{buildroot}%{_mandir}/man1
c9a7f58
install -m 644 anki.1 %{buildroot}%{_mandir}/man1/
66e4a68
30377cb
mkdir -p %{buildroot}%{_datadir}/appdata
30377cb
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/appdata/
30377cb
66e4a68
desktop-file-install \
66e4a68
  --remove-category=KDE \
89c3057
  --set-key=Keywords --set-value="learn;education;memorizing;language;flashcard;spaced repetition;" \
66e4a68
  --dir %{buildroot}%{_datadir}/applications \
66e4a68
  %{name}.desktop
66e4a68
e0c09e2
find %{buildroot} -type f -o -type l|sed '
e0c09e2
s:'"%{buildroot}"'::
c9a7f58
s:\(.*/share/anki/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
c9a7f58
s:\(.*/share/anki/locale/qt_\)\([^.]\+\)\(\.qm\):%lang(\2) \1\2\3:
e0c09e2
s:^\([^%].*\)::
e0c09e2
s:%lang(C) ::
e0c09e2
/^$/d' > anki.lang
e0c09e2
c9a7f58
find %{buildroot}/usr/share/anki/locale -type d|sed '
c9a7f58
s:'"%{buildroot}"'::
c9a7f58
s:\(.*\):%dir \1:' >>anki.lang
e0c09e2
c9a7f58
%post
Rex Dieter bc4c495
/bin/touch --no-create %{_datadir}/mime/packages &> /dev/null || :
c9a7f58
/usr/bin/update-desktop-database &> /dev/null || :
89c3057
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
e0c09e2
c9a7f58
%postun
c9a7f58
/usr/bin/update-desktop-database &> /dev/null || :
Rex Dieter bc4c495
if [ $1 -eq 0 ] ; then
Rex Dieter bc4c495
  /bin/touch --no-create %{_datadir}/mime/packages &> /dev/null || :
Rex Dieter bc4c495
  /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
89c3057
  /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
89c3057
  /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
Rex Dieter bc4c495
fi
Rex Dieter bc4c495
Rex Dieter bc4c495
%posttrans
Rex Dieter bc4c495
/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
89c3057
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
66e4a68
e0c09e2
%files -f %{name}.lang
924a345
%doc LICENSE* README*
66e4a68
%{_bindir}/anki
c9a7f58
%dir %{_datadir}/%{name}/
c9a7f58
%{_datadir}/%{name}/aqt/
c9a7f58
%{_datadir}/%{name}/designer/
c9a7f58
%{_datadir}/%{name}/anki/
d8224fa
%{_datadir}/%{name}/thirdparty/
66e4a68
%{_datadir}/applications/%{name}.desktop
89c3057
%{_datadir}/icons/hicolor/scalable/apps/%{name}.*
c9a7f58
%{_datadir}/mime/packages/anki.xml
c9a7f58
%{_mandir}/man1/%{name}.*
30377cb
%{_datadir}/appdata/anki.appdata.xml
66e4a68
66e4a68
%changelog
e83196f
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.33-2
e83196f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e83196f
924a345
* Mon Nov 30 2015 Christian Krause <chkr@fedoraproject.org> - 2.0.33-1
924a345
- Update to new upstream version 2.0.33 (BZ 1270574)
924a345
- Correct files list entry for LICENSE files
924a345
982fd42
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.32-2
982fd42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
982fd42
89c3057
* Sun Apr 05 2015 Christian Krause <chkr@fedoraproject.org> - 2.0.32-1
89c3057
- Update to new upstream version 2.0.32 (BZ 1205471)
89c3057
- Move icon to %%{_datadir}/icons/hicolor/scalable/apps
89c3057
- Modify svg icon to use only the subset of the SVG specification
89c3057
  which is implemented by Qt's SVG library
89c3057
- Add keywords to desktop file
89c3057
aab19b0
* Mon Nov 03 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.31-1
aab19b0
- Update to new upstream version 2.0.31 (BZ 1144973)
aab19b0
52d288d
* Wed Jul 30 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.28-1
52d288d
- Update to new upstream version 2.0.28 (BZ 1123961)
52d288d
Rex Dieter bc4c495
* Tue Jul 08 2014 Rex Dieter <rdieter@fedoraproject.org> 2.0.26-3
Rex Dieter bc4c495
- optimize mimeinfo scriptlet
Rex Dieter bc4c495
cbf668b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.26-2
cbf668b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cbf668b
30377cb
* Tue May 20 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.26-1
30377cb
- Update to new upstream version 2.0.26 (BZ 1090863)
30377cb
- Add appdata
30377cb
b0d3836
* Fri Apr 18 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.25-1
b0d3836
- Update to new upstream version 2.0.25 (BZ 1087211)
b0d3836
9bda471
* Fri Jan 31 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.22-1
9bda471
- Update to new upstream version 2.0.22 (BZ 1057013)
9bda471
a348a34
* Tue Jan 14 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.20-2
a348a34
- Fix typo in changelog
a348a34
6635423
* Tue Jan 14 2014 Christian Krause <chkr@fedoraproject.org> - 2.0.20-1
a348a34
- Update to new upstream version 2.0.20 (BZ 1040134)
6635423
dfba3f3
* Wed Nov 20 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.18-1
dfba3f3
- Update to new upstream version 2.0.18 (BZ 1027704)
dfba3f3
de8d882
* Fri Nov 01 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.16-1
de8d882
- Update to new upstream version 2.0.16
de8d882
6ba9786
* Fri Oct 11 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.13-1
6ba9786
- Update to new upstream version 2.0.13
6ba9786
3940c87
* Sun Aug 04 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.12-1
3940c87
- Update to new upstream version 2.0.12 (BZ 989901)
3940c87
- Install docs to %%{_pkgdocdir} (BZ 991962)
3940c87
- Install additional LICENSE file
3940c87
a19f60e
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.11-2
a19f60e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a19f60e
8b004fc
* Mon Jun 24 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.11-1
8b004fc
- Update to new upstream version 2.0.11 (BZ 973523)
8b004fc
d8224fa
* Mon Jun 03 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.9-1
d8224fa
- Update to new upstream version 2.0.9 (BZ 970052)
d8224fa
- Remove patch (issue was fixed upstream)
d8224fa
693bc9c
* Mon Apr 01 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.8-2
693bc9c
- Add patch to fix filter selection in browser view:
693bc9c
  https://anki.lighthouseapp.com/projects/100923/tickets/729-browser-filter-tree-doesnt-filter
693bc9c
e287209
* Sun Feb 24 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.8-1
e287209
- Update to new upstream version 2.0.8
e287209
7a21ffc
* Sat Feb 02 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.7-1
7a21ffc
- Update to new upstream version 2.0.7
7a21ffc
c9a7f58
* Thu Jan 10 2013 Christian Krause <chkr@fedoraproject.org> - 2.0.4-1
c9a7f58
- Update to anki-2.0.4 (based on work from Christophe Fergeau <cfergeau@redhat.com>)
c9a7f58
- Update license to AGPLv3+
c9a7f58
- Update noupdate patch
c9a7f58
- Add man page
c9a7f58
- Add post/postun scripts (needed for MimeType key in anki.desktop and for
c9a7f58
  /usr/share/mime/packages/anki.xml)
c9a7f58
- Spec file cleanup
c9a7f58
ef352f5
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.11-2
ef352f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
ef352f5
2857987
* Sun Jul 01 2012 Christian Krause <chkr@fedoraproject.org> - 1.2.11-1
2857987
- Update to new upstream version 1.2.11 (BZ 819821)
2857987
- Remove patch (issue was fixed upstream)
2857987
33979b7
* Wed Feb  8 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.9-4
33979b7
- Remove python-sqlite2 dep as anki will work with the stdlib sqlite3 module
33979b7
1c06289
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.9-3
1c06289
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1c06289
d8841fa
* Sun Jul 24 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.9-2
d8841fa
- Add and install  svg version of anki's icon
d8841fa
(extracted from anki-1.2.9/icons/anki-logo.svg)
d8841fa
a59a7d8
* Thu Jun 30 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.9-1
a59a7d8
- Update to new upstream version 1.2.9 (BZ 717584) to fix more
a59a7d8
  compatibility issues with python-sqlalchemy-0.7.x
a59a7d8
- Remove upstreamed patches
a59a7d8
- Add patch to avoid unicode error messages on startup
a59a7d8
94e1e3e
* Tue Jun 28 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.8-2
94e1e3e
- Fix FTBFS issue (BZ 715813)
94e1e3e
- Adding two upstream patches to support python-sqlalchemy-0.7.x
94e1e3e
54a3a6b
* Tue Apr 05 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.8-1
54a3a6b
- Update to new upstream version 1.2.8 (BZ 691342)
54a3a6b
1f47a9d
* Sun Feb 27 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.7-1
1f47a9d
- Update to new upstream version 1.2.7 (BZ 678848)
1f47a9d
- Add sox as requirement for audio recording (BZ 674493)
1f47a9d
cb69fa3
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.6-2
cb69fa3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
cb69fa3
41d7947
* Sat Feb 05 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.6-1
41d7947
- Update to new upstream version 1.2.6 (BZ 665163)
41d7947
f73c755
* Thu Jan 27 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.5-1
f73c755
- Update to new upstream version 1.2.5 (BZ 665163)
f73c755
807f335
* Sun Jan 23 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.4-1
807f335
- Update to new upstream version 1.2.4 (BZ 665163)
807f335
937a540
* Fri Jan 14 2011 Christian Krause <chkr@fedoraproject.org> - 1.2.2-1
937a540
- Update to new upstream version 1.2.2 (BZ 665163)
937a540
06a4456
* Tue Dec 14 2010 Christian Krause <chkr@fedoraproject.org> - 1.1.10-1
06a4456
- Update to new upstream version 1.1.10 (BZ 655939)
06a4456
0d7c78f
* Sat Aug 21 2010 Christian Krause <chkr@fedoraproject.org> - 1.0.1-1
0d7c78f
- Update to new upstream version 1.0.1
0d7c78f
bbbd4f1
* Mon Aug 02 2010 Christian Krause <chkr@fedoraproject.org> - 1.0-1
bbbd4f1
- Update to new upstream version 1.0
bbbd4f1
- Use original upstream tgz since upstream doesn't ship the problematic
bbbd4f1
  example files anymore
bbbd4f1
- Remove upstreamed patches
bbbd4f1
- Update noupdate patch
32a56e8
- Add BR python-simplejson
bbbd4f1
1cd017d
* Sun Jul 25 2010 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.6-5
1cd017d
- Generalized generation of anki.lang to support any python 2.* release
1cd017d
25c0c3a
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.9.9.8.6-4
25c0c3a
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
25c0c3a
98c7de8
* Thu May 13 2010 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.6-3
98c7de8
- Add pyaudio as requirement for audio recording
98c7de8
- Add upstream patch to prevent anki hanging during audio recording
98c7de8
bc05b6a
* Sun Feb 28 2010 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.6-2
bc05b6a
- Add a patch to fix a crash when sys tray icon is enabled (BZ 567672)
bc05b6a
1d0c0cc
* Fri Feb 19 2010 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.6-1
1d0c0cc
- Update to new upstream version
1d0c0cc
- Remove example files from upstream tarball due to unknown license
1d0c0cc
- Updated noupdate patch
1d0c0cc
e0c09e2
* Wed Jan 20 2010 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.5-3.git20100120
e0c09e2
- Update to git snapshot
e0c09e2
- Includes fix for BZ 546331
e0c09e2
a4181ed
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9.8.5-2
a4181ed
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
a4181ed
ecbc047
* Sun Jul 12 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.5-1
ecbc047
- Update to new upstream version 0.9.9.8.5
ecbc047
8c07f13
* Thu Jul 02 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.8.4-1
8c07f13
- Update to new upstream version 0.9.9.8.4
8c07f13
- fix one %%lang tag
8c07f13
3e71278
* Sun May 24 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.9b-1
3e71278
- Update to new upstream version 0.9.9.7.9b to fix a syncing bug
3e71278
ba4f4ca
* Tue May 12 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.9-1
ba4f4ca
- Update to new upstream version 0.9.9.7.9 to fix an update problem of the 
ba4f4ca
statusbar and of the titlebar
ba4f4ca
1281e42
* Thu May 07 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.8-2
1281e42
- Bump release
1281e42
96274bb
* Wed May 06 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.8-1
96274bb
- Update to new upstream version 0.9.9.7.8
96274bb
68f63ae
* Sat Apr 11 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.4-1
68f63ae
- Update to new upstream version 0.9.9.7.4 (BZ 494598)
68f63ae
- Require python-matplotlib instead of numpy (BZ 495232)
68f63ae
5a75dcb
* Wed Apr 01 2009 Christian Krause <chkr@fedoraproject.org> - 0.9.9.7.1-1
5a75dcb
- Update to new upstream version 0.9.9.7.1
5a75dcb
- Drop unihaninstall patch (applied upstream)
5a75dcb
- Updated noupdate patch
5a75dcb
- Use original upstream tgz since upstream doesn't ship the example files
5a75dcb
anymore
5a75dcb
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