From: Artur Frysiak Date: Mon, 9 Dec 2013 09:24:35 +0000 (+0100) Subject: Up to 1.14.0 X-Git-Tag: auto/th/calibre-1.14.0-1 X-Git-Url: https://git.pld-linux.org/?a=commitdiff_plain;h=2d44714a1ef3f74bba3b0bd4d0441345908fcf02;p=packages%2Fcalibre.git Up to 1.14.0 --- diff --git a/calibre-locales.patch b/calibre-locales.patch index 6e6b41d..7a186cd 100644 --- a/calibre-locales.patch +++ b/calibre-locales.patch @@ -1,6 +1,87 @@ ---- calibre/src/calibre/utils/localization.py.old 2012-10-28 22:07:25.481983550 +0100 -+++ calibre/src/calibre/utils/localization.py 2012-10-28 22:12:17.250402847 +0100 -@@ -73,20 +73,20 @@ def get_lang(): +--- calibre/setup/translations.py.wiget 2013-12-06 05:13:34.000000000 +0100 ++++ calibre/setup/translations.py 2013-12-09 09:28:32.349958101 +0100 +@@ -143,7 +143,7 @@ class Translations(POT): # {{{ + + def mo_file(self, po_file): + locale = os.path.splitext(os.path.basename(po_file))[0] +- return locale, os.path.join(self.DEST, locale, 'messages.mo') ++ return locale, os.path.join(self.DEST, locale, 'LC_MESSAGES', 'messages.mo') + + def run(self, opts): + self.iso639_errors = [] +@@ -152,8 +152,9 @@ class Translations(POT): # {{{ + base = os.path.dirname(dest) + if not os.path.exists(base): + os.makedirs(base) +- self.info('\tCompiling translations for', locale) +- subprocess.check_call(['msgfmt', '-o', dest, f]) ++ if self.newer(dest, f): ++ self.info('\tCompiling translations for', locale) ++ subprocess.check_call(['msgfmt', '-o', dest, f]) + iscpo = {'bn':'bn_IN', 'zh_HK':'zh_CN'}.get(locale, locale) + iso639 = self.j(self.LP_ISO_PATH, '%s.po'%iscpo) + +@@ -174,7 +175,6 @@ class Translations(POT): # {{{ + raise SystemExit(1) + + self.write_stats() +- self.freeze_locales() + + def check_iso639(self, path): + from calibre.utils.localization import langnames_to_langcodes +@@ -198,15 +198,6 @@ class Translations(POT): # {{{ + # raise SystemExit(1) + rmap[msgstr] = msgid + +- def freeze_locales(self): +- zf = self.DEST + '.zip' +- from calibre import CurrentDir +- from calibre.utils.zipfile import ZipFile, ZIP_DEFLATED +- with ZipFile(zf, 'w', ZIP_DEFLATED) as zf: +- with CurrentDir(self.DEST): +- zf.add_dir('.') +- shutil.rmtree(self.DEST) +- + @property + def stats(self): + return self.j(self.d(self.DEST), 'stats.pickle') +--- calibre/src/calibre/translations/dynamic.py.wiget 2013-12-06 05:13:34.000000000 +0100 ++++ calibre/src/calibre/translations/dynamic.py 2013-12-09 09:28:32.349958101 +0100 +@@ -5,10 +5,10 @@ Dynamic language lookup of translations + __license__ = 'GPL v3' + __copyright__ = '2008, Marshall T. Vandegrift ' + ++import os + import cStringIO + from gettext import GNUTranslations + from calibre.utils.localization import get_lc_messages_path +-from zipfile import ZipFile + + __all__ = ['translate'] + +@@ -21,15 +21,10 @@ def translate(lang, text): + else: + mpath = get_lc_messages_path(lang) + if mpath is not None: +- with ZipFile(P('localization/locales.zip', +- allow_user_override=False), 'r') as zf: +- try: +- buf = cStringIO.StringIO(zf.read(mpath + '/messages.mo')) +- except: +- pass +- else: +- trans = GNUTranslations(buf) +- _CACHE[lang] = trans ++ p = os.path.join(mpath, 'messages.mo') ++ if os.path.exists(p): ++ trans = GNUTranslations(open(p, 'rb')) ++ _CACHE[lang] = trans + if trans is None: + return getattr(__builtins__, '_', lambda x: x)(text) + return trans.ugettext(text) +--- calibre/src/calibre/utils/localization.py.wiget 2013-12-06 05:13:34.000000000 +0100 ++++ calibre/src/calibre/utils/localization.py 2013-12-09 09:31:05.694326467 +0100 +@@ -74,20 +74,20 @@ def get_lang(): lang = 'en' return lang @@ -31,9 +112,9 @@ + return messages_path(hlang) + return None - def set_translators(): - # To test different translations invoke as -@@ -110,18 +110,12 @@ def set_translators(): + _lang_trans = None + +@@ -114,18 +114,12 @@ def set_translators(): buf = cStringIO.StringIO(buf.getvalue()) if mpath is not None: @@ -48,7 +129,7 @@ - try: - iso639 = cStringIO.StringIO(zf.read(isof)) - except: -- pass # No iso639 translations for this lang +- pass # No iso639 translations for this lang + if buf is None: + buf = open(os.path.join(mpath, 'calibre.mo'), 'rb') + mpath = mpath.replace(os.sep+'nds'+os.sep, os.sep+'de'+os.sep) @@ -58,84 +139,3 @@ if buf is not None: t = GNUTranslations(buf) ---- calibre/src/calibre/translations/dynamic.py.orig 2012-01-13 05:32:13.000000000 +0100 -+++ calibre/src/calibre/translations/dynamic.py 2012-01-17 09:37:53.594649557 +0100 -@@ -5,10 +5,10 @@ - __license__ = 'GPL v3' - __copyright__ = '2008, Marshall T. Vandegrift ' - -+import os - import cStringIO - from gettext import GNUTranslations - from calibre.utils.localization import get_lc_messages_path --from zipfile import ZipFile - - __all__ = ['translate'] - -@@ -21,15 +21,10 @@ - else: - mpath = get_lc_messages_path(lang) - if mpath is not None: -- with ZipFile(P('localization/locales.zip', -- allow_user_override=False), 'r') as zf: -- try: -- buf = cStringIO.StringIO(zf.read(mpath + '/messages.mo')) -- except: -- pass -- else: -- trans = GNUTranslations(buf) -- _CACHE[lang] = trans -+ p = os.path.join(mpath, 'messages.mo') -+ if os.path.exists(p): -+ trans = GNUTranslations(open(p, 'rb')) -+ _CACHE[lang] = trans - if trans is None: - return getattr(__builtins__, '_', lambda x: x)(text) - return trans.ugettext(text) ---- calibre/setup/translations.py.orig 2011-08-26 18:36:51.000000000 +0200 -+++ calibre/setup/translations.py 2011-08-27 12:55:49.997229244 +0200 -@@ -131,7 +131,7 @@ - - def mo_file(self, po_file): - locale = os.path.splitext(os.path.basename(po_file))[0] -- return locale, os.path.join(self.DEST, locale, 'messages.mo') -+ return locale, os.path.join(self.DEST, locale, 'LC_MESSAGES', 'messages.mo') - - def run(self, opts): - for f in self.po_files(): -@@ -139,8 +139,9 @@ - base = os.path.dirname(dest) - if not os.path.exists(base): - os.makedirs(base) -- self.info('\tCompiling translations for', locale) -- subprocess.check_call(['msgfmt', '-o', dest, f]) -+ if self.newer(dest, f): -+ self.info('\tCompiling translations for', locale) -+ subprocess.check_call(['msgfmt', '-o', dest, f]) - iscpo = {'bn':'bn_IN', 'zh_HK':'zh_CN'}.get(locale, locale) - iso639 = self.j(self.d(self.SRC), 'setup', 'iso_639', - '%s.po'%iscpo) -@@ -155,7 +156,6 @@ - self.warn('No ISO 639 translations for locale:', locale) - - self.write_stats() -- self.freeze_locales() - - def check_iso639(self, path): - from calibre.utils.localization import langnames_to_langcodes -@@ -165,15 +166,6 @@ - os.path.basename(path), msgstr, msgid, rmap[msgstr])) - # raise SystemExit(1) - rmap[msgstr] = msgid -- -- def freeze_locales(self): -- zf = self.DEST + '.zip' -- from calibre import CurrentDir -- from calibre.utils.zipfile import ZipFile, ZIP_DEFLATED -- with ZipFile(zf, 'w', ZIP_DEFLATED) as zf: -- with CurrentDir(self.DEST): -- zf.add_dir('.') -- shutil.rmtree(self.DEST) - - @property - def stats(self): diff --git a/calibre.spec b/calibre.spec index 8b42ea3..8a712a2 100644 --- a/calibre.spec +++ b/calibre.spec @@ -12,12 +12,12 @@ Summary: E-book converter and library management Summary(pl.UTF-8): Konwerter oraz biblioteka dla e-booków Name: calibre -Version: 1.13.0 +Version: 1.14.0 Release: 1 License: GPL v3+ Group: Applications/Multimedia Source0: %{name}-%{version}-nofonts.tar.xz -# Source0-md5: 8751a670aed6e97ea02f1d8b4ddcba64 +# Source0-md5: 05c1d3c11150fcc4a88696f4166d08ee Source1: generate-tarball.sh Source2: %{name}-mount-helper Patch0: %{name}-prefix.patch @@ -161,7 +161,7 @@ Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh. %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 +#patch5 -p1 %patch6 -p1 # 64bit target build fix @@ -263,6 +263,7 @@ fi %attr(755,root,root) %{_bindir}/ebook-device %attr(755,root,root) %{_bindir}/ebook-meta %attr(755,root,root) %{_bindir}/ebook-polish +%attr(755,root,root) %{_bindir}/ebook-tweak %attr(755,root,root) %{_bindir}/ebook-viewer %attr(755,root,root) %{_bindir}/fetch-ebook-metadata %attr(755,root,root) %{_bindir}/lrf2lrs @@ -272,6 +273,7 @@ fi %attr(755,root,root) %{_bindir}/web2disk %{_datadir}/%{name} %{_libdir}/%{name} +%{_desktopdir}/calibre-ebook-tweak.desktop %{_desktopdir}/calibre-ebook-viewer.desktop %{_desktopdir}/calibre-gui.desktop %{_desktopdir}/calibre-lrfviewer.desktop