From c185770969ccae4093ebab20532297ff8ec4e86b Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Wed, 11 Apr 2018 23:58:26 +0200 Subject: [PATCH 1/2] Update to new upstream version 2.0.50 (BZ 1436178, BZ 1529540, BZ 1529541) Use separate send2trash python module instead of the bundled one (BZ 1173410) Disable internal CA store in favor of global one (BZ 1497504) Use correct shebang for python2 (BZ 1478302) Use %autosetup --- .gitignore | 1 + anki-2.0.50-use-python2-shebang.patch | 18 ++++++++++++++++ anki-2.0.50-use-system-certificates.patch | 12 +++++++++++ anki.spec | 26 +++++++++++++++-------- sources | 2 +- 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 anki-2.0.50-use-python2-shebang.patch create mode 100644 anki-2.0.50-use-system-certificates.patch diff --git a/.gitignore b/.gitignore index c2211c7..9250bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ anki-1.0.1.tgz /anki-2.0.36.tgz /anki-2.0.39-source.tgz /anki-2.0.43-source.tgz +/anki-2.0.50-source.tgz diff --git a/anki-2.0.50-use-python2-shebang.patch b/anki-2.0.50-use-python2-shebang.patch new file mode 100644 index 0000000..4eb51a1 --- /dev/null +++ b/anki-2.0.50-use-python2-shebang.patch @@ -0,0 +1,18 @@ +diff -uNr anki-2.0.50.old/anki/anki anki-2.0.50/anki/anki +--- anki-2.0.50.old/anki/anki 2016-05-12 04:40:52.000000000 +0200 ++++ anki-2.0.50/anki/anki 2018-04-11 00:59:13.901232410 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python2 + + import os, sys + # system-wide install +diff -uNr anki-2.0.50.old/runanki anki-2.0.50/runanki +--- anki-2.0.50.old/runanki 2016-03-21 08:28:07.000000000 +0100 ++++ anki-2.0.50/runanki 2018-04-11 00:58:54.213952994 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python2 + + import sys + sys.path.insert(0, "/usr/share/anki") diff --git a/anki-2.0.50-use-system-certificates.patch b/anki-2.0.50-use-system-certificates.patch new file mode 100644 index 0000000..88e6bed --- /dev/null +++ b/anki-2.0.50-use-system-certificates.patch @@ -0,0 +1,12 @@ +diff -uNr anki-2.0.50.old/anki/sync.py anki-2.0.50/anki/sync.py +--- anki-2.0.50.old/anki/sync.py 2017-08-27 03:51:01.000000000 +0200 ++++ anki-2.0.50/anki/sync.py 2018-04-11 00:30:32.785697476 +0200 +@@ -52,7 +52,7 @@ + if not os.path.exists(certs): + assert 0, "Your distro has not packaged Anki correctly." + return httplib2.Http( +- timeout=HTTP_TIMEOUT, ca_certs=certs, ++ timeout=HTTP_TIMEOUT, + proxy_info=HTTP_PROXY, + disable_ssl_certificate_validation=not not HTTP_PROXY) + diff --git a/anki.spec b/anki.spec index 6ff5442..f27d89d 100644 --- a/anki.spec +++ b/anki.spec @@ -1,8 +1,8 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: anki -Version: 2.0.43 -Release: 2%{?dist} +Version: 2.0.50 +Release: 1%{?dist} Summary: Flashcard program for using space repetition learning Group: Amusements/Games @@ -14,12 +14,19 @@ Source2: anki.appdata.xml # Config change: don't check for new updates. Patch0: anki-2.0.3-noupdate.patch +# The supplied CA store does not include the root CAs for the +# add-ons server when SNI is used by python's httplib2 +Patch1: anki-2.0.50-use-system-certificates.patch +# Use /usr/bin/python2 as shebang as required by +# https://fedoraproject.org/wiki/Packaging:Python +Patch2: anki-2.0.50-use-python2-shebang.patch BuildRequires: python2-devel, python-setuptools, python-sqlalchemy BuildRequires: desktop-file-utils, PyQt4, python-simplejson Requires: hicolor-icon-theme Requires: qt4, PyQt4, PyQt4-webkit Requires: python-sqlalchemy, python-simplejson Requires: python-matplotlib +Requires: python2-send2trash Requires: pygame, python-BeautifulSoup, python-httplib2 Requires: pyaudio, sox BuildArch: noarch @@ -30,24 +37,18 @@ and phrases in a foreign language) as easily, quickly and efficiently as possible. Anki is based on a theory called spaced repetition. %prep -%setup -q -mv thirdparty/send2trash . +%autosetup -p 1 rm -rf thirdparty -rm 'aqt/forms/#about.py#' -%patch0 -p1 -b .noupdate %build %install mkdir -p %{buildroot}%{_datadir}/%{name} -rm -f aqt/*.noupdate -rm -f aqt/*.fix-browserview cp -R aqt %{buildroot}%{_datadir}/%{name}/ cp -R designer %{buildroot}%{_datadir}/%{name}/ cp -R anki %{buildroot}%{_datadir}/%{name}/ cp -R locale %{buildroot}%{_datadir}/%{name}/ mkdir -p %{buildroot}%{_datadir}/%{name}/thirdparty -cp -R send2trash %{buildroot}%{_datadir}/%{name}/thirdparty/ install -d %{buildroot}%{_bindir} install -m 755 runanki %{buildroot}%{_bindir}/anki @@ -119,6 +120,13 @@ fi %{_datadir}/appdata/anki.appdata.xml %changelog +* Mon Apr 09 2018 Christian Krause - 2.0.50-1 +- Update to new upstream version 2.0.50 (BZ 1436178, BZ 1529540, BZ 1529541) +- Use separate send2trash python module instead of the bundled one (BZ 1173410) +- Disable internal CA store in favor of global one (BZ 1497504) +- Use correct shebang for python2 (BZ 1478302) +- Use %%autosetup + * Wed Jul 26 2017 Fedora Release Engineering - 2.0.43-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 5a7dac3..507f72a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (anki-2.0.43-source.tgz) = e50ee4cf6fd7be266b6d38682e28a06b51cc42a2667f35fbafa755152d47bbadb2fbd2baa771d13e73f39973a4102d626fbe7327a5de05efbc3700d7a2c9909c +SHA512 (anki-2.0.50-source.tgz) = e4bd27768937534c6d94530b87269e62b348ca68b4e8cc46841ae7197bd8e02f46a6b328ff470a624ff2acdd1a61cd9435aa5dd4fecebd4fa570529c06955bc0 From af6cccc94b8939324a5fb91fbd7504b4a3bc221a Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Sun, 3 Jun 2018 10:19:57 +0200 Subject: [PATCH 2/2] Update to new upstream version 2.0.52 (BZ 1584661) Remove obsolete directories in %install --- .gitignore | 1 + anki.spec | 8 +++++--- sources | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9250bcb..20278fd 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ anki-1.0.1.tgz /anki-2.0.39-source.tgz /anki-2.0.43-source.tgz /anki-2.0.50-source.tgz +/anki-2.0.52-source.tgz diff --git a/anki.spec b/anki.spec index f27d89d..a8c9d67 100644 --- a/anki.spec +++ b/anki.spec @@ -1,7 +1,7 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: anki -Version: 2.0.50 +Version: 2.0.52 Release: 1%{?dist} Summary: Flashcard program for using space repetition learning @@ -48,7 +48,6 @@ cp -R aqt %{buildroot}%{_datadir}/%{name}/ cp -R designer %{buildroot}%{_datadir}/%{name}/ cp -R anki %{buildroot}%{_datadir}/%{name}/ cp -R locale %{buildroot}%{_datadir}/%{name}/ -mkdir -p %{buildroot}%{_datadir}/%{name}/thirdparty install -d %{buildroot}%{_bindir} install -m 755 runanki %{buildroot}%{_bindir}/anki @@ -112,7 +111,6 @@ fi %{_datadir}/%{name}/aqt/ %{_datadir}/%{name}/designer/ %{_datadir}/%{name}/anki/ -%{_datadir}/%{name}/thirdparty/ %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/scalable/apps/%{name}.* %{_datadir}/mime/packages/anki.xml @@ -120,6 +118,10 @@ fi %{_datadir}/appdata/anki.appdata.xml %changelog +* Thu May 31 2018 Christian Krause - 2.0.52-1 +- Update to new upstream version 2.0.52 (BZ 1584661) +- Remove obsolete directories in %%install + * Mon Apr 09 2018 Christian Krause - 2.0.50-1 - Update to new upstream version 2.0.50 (BZ 1436178, BZ 1529540, BZ 1529541) - Use separate send2trash python module instead of the bundled one (BZ 1173410) diff --git a/sources b/sources index 507f72a..39c4e42 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (anki-2.0.50-source.tgz) = e4bd27768937534c6d94530b87269e62b348ca68b4e8cc46841ae7197bd8e02f46a6b328ff470a624ff2acdd1a61cd9435aa5dd4fecebd4fa570529c06955bc0 +SHA512 (anki-2.0.52-source.tgz) = 5130f6a90860d7e4de6cbf4401ab61c841e3d27cbcb2f62b45f807902e332e37fd7892a8688ad92ef1fae62360076530f480dfd6396b1cc0289ca8a52019ef05