diff options
author | Vladimir Yatsemirski <7catssmile@gmail.com> | 2012-12-27 18:27:13 +0100 |
---|---|---|
committer | Matteo Bernardini <ponce@slackbuilds.org> | 2012-12-27 18:27:33 +0100 |
commit | 18bc18abd0943f7bac47531e4300c912a8bd769a (patch) | |
tree | e89c0c8fa95101d2034aae924b680ef7874dfd66 /misc/sdcv | |
parent | 7941012fb8d958417582100e82342eafbdeedca6 (diff) | |
download | slackbuilds-18bc18abd0943f7bac47531e4300c912a8bd769a.tar.gz |
misc/sdcv: Added (console dictionary application).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'misc/sdcv')
-rw-r--r-- | misc/sdcv/README | 2 | ||||
-rw-r--r-- | misc/sdcv/patches/01_gettext.patch | 14 | ||||
-rw-r--r-- | misc/sdcv/patches/02_manpage.patch | 143 | ||||
-rw-r--r-- | misc/sdcv/patches/03_c++.patch | 45 | ||||
-rw-r--r-- | misc/sdcv/patches/04_format.patch | 21 | ||||
-rw-r--r-- | misc/sdcv/patches/05_locales.patch | 80 | ||||
-rw-r--r-- | misc/sdcv/patches/06_sk.po.patch | 134 | ||||
-rw-r--r-- | misc/sdcv/patches/07_cs.po.patch | 145 | ||||
-rw-r--r-- | misc/sdcv/patches/08_fr.po.patch | 158 | ||||
-rw-r--r-- | misc/sdcv/patches/09_fix-tests.patch | 53 | ||||
-rw-r--r-- | misc/sdcv/patches/10_use-env-home.patch | 31 | ||||
-rw-r--r-- | misc/sdcv/patches/11_allignment.patch | 27 | ||||
-rw-r--r-- | misc/sdcv/patches/12_fix-formats.patch | 35 | ||||
-rw-r--r-- | misc/sdcv/patches/13_zlib-return-value.patch | 19 | ||||
-rw-r--r-- | misc/sdcv/sdcv.SlackBuild | 107 | ||||
-rw-r--r-- | misc/sdcv/sdcv.info | 10 | ||||
-rw-r--r-- | misc/sdcv/slack-desc | 11 |
17 files changed, 1035 insertions, 0 deletions
diff --git a/misc/sdcv/README b/misc/sdcv/README new file mode 100644 index 0000000000..b2ad8214a6 --- /dev/null +++ b/misc/sdcv/README @@ -0,0 +1,2 @@ +sdcv is a console version of stardict, a cross-platform +and international dictionary. diff --git a/misc/sdcv/patches/01_gettext.patch b/misc/sdcv/patches/01_gettext.patch new file mode 100644 index 0000000000..b64565335a --- /dev/null +++ b/misc/sdcv/patches/01_gettext.patch @@ -0,0 +1,14 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Update gettext version to use newer m4 macros + +--- a/configure.ac ++++ b/configure.ac +@@ -22,7 +22,7 @@ + dnl Gettext stuff. + dnl ================================================================ + AM_GNU_GETTEXT([external]) +-AM_GNU_GETTEXT_VERSION(0.14.1) ++AM_GNU_GETTEXT_VERSION(0.17) + GETTEXT_PACKAGE=sdcv + AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) diff --git a/misc/sdcv/patches/02_manpage.patch b/misc/sdcv/patches/02_manpage.patch new file mode 100644 index 0000000000..cc112d5d24 --- /dev/null +++ b/misc/sdcv/patches/02_manpage.patch @@ -0,0 +1,143 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fix man page to be correct. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125983&group_id=122858&atid=694730 +--- a/doc/uk/sdcv.1 ++++ b/doc/uk/sdcv.1 +@@ -1,14 +1,14 @@ +-..TH SDCV 1 "2004-12-06" "sdcv-0.4" +-..SH NAME ++.TH SDCV 1 "2004-12-06" "sdcv-0.4" ++.SH NAME + sdcv \- консольна версія Зоряного словника [Stardict] +-..SH SYNOPSIS +-..B sdcv ++.SH SYNOPSIS ++.B sdcv + [ +-..BI options ++.BI options + ] + [list of words] +-..SH DESCRIPTION +-..I sdcv ++.SH DESCRIPTION ++.I sdcv + sdcv проста, міжплатформена текстова утиліта для роботи із + словниками у форматі Зоряного словника [StarDict]. + Слово зі "списку слів", може бути рядком з початковим слешем '/' +@@ -19,37 +19,37 @@ + У діалоговому режимі, якщо sdcv був скомпільований з підтримкою + бібліотеки readline, Ви можете використовувати клавіші ДОГОРИ + та ВНИЗ для роботи з хронологією. +-..SH OPTIONS +-..TP 8 +-..B "\-h \-\-help" ++.SH OPTIONS ++.TP 8 ++.B "\-h \-\-help" + відображає повідомлення довідки та виходить +-..TP 8 +-..B "\-v \-\-verbose" ++.TP 8 ++.B "\-v \-\-verbose" + відображає версію та виходить +-..TP 8 +-..B "\-l \-\-list\-dicts" ++.TP 8 ++.B "\-l \-\-list\-dicts" + відображає список доступних словників та виходить +-..TP 8 +-..B "\-u \-\-use\-dict filename" ++.TP 8 ++.B "\-u \-\-use\-dict filename" + для пошуку з використанням лише словника з цим іменем(bookname) +-..TP 8 +-..B "\-n \-\-non\-interactive" ++.TP 8 ++.B "\-n \-\-non\-interactive" + для використання в скриптах +-..TP 8 +-..B "\-\-utf8\-output" ++.TP 8 ++.B "\-\-utf8\-output" + Заставити sdcv розмовляти не в системному кодуванні locale, а робити вивід в utf8 +-..TP 8 +-..B "\-\-utf8\-input" ++.TP 8 ++.B "\-\-utf8\-input" + Заставити sdcv слухати не в системному кодуванні locale, а припускати що це + ввід в utf8 +-..TP 8 +-..B "\-\-data\-dir path/to/directory" ++.TP 8 ++.B "\-\-data\-dir path/to/directory" + Використовуйте цю теку як шлях до теки даних зоряного словника [stardict]. + Це значає, що sdcv шукає словники у теці data-dir/dic. +-..SH FILES +-..TP ++.SH FILES ++.TP + /usr/share/stardict/dic +-..TP ++.TP + $(HOME)/.stardict/dic + + Місце, де sdcv очікує знайти словники. +@@ -57,28 +57,28 @@ + що Ви хочете, лише встановіть змінну оточення STARDICT_DATA_DIR. + Наприклад, якщо Ви маєте словники у теці /mnt/data/stardict-dicts/dic, + встановіть STARDICT_DATA_DIR у /mnt/data/stardict-dicts. +-..TP ++.TP + $(HOME)/.sdcv_history + + Цей файл містить останні $(SDCV_HISTSIZE) слова, які Ви шукали з sdcv. + SDCV використовує цей файл при умові, якщо sdcv був скомпільований + з підтримкою бібліотеки readline. + +-..SH ENVIROMENT ++.SH ENVIROMENT + Змінні оточення для \fIsdcv\fR: +-..TP 20 +-..B STARDICT_DATA_DIR ++.TP 20 ++.B STARDICT_DATA_DIR + Якщо встановлена, sdcv використає цю змінну як теку даних, це означає, + що sdcv шукатиме словники у $\fBSTARDICT_DATA_DIR\fR\dic +-..TP 20 +-..B SDCV_HISTSIZE ++.TP 20 ++.B SDCV_HISTSIZE + Якщо встановлена, sdcv писатиме у $(HOME)/.sdcv_history лише + останні $(SDCV_HISTSIZE) слова, які Ви шукали з sdcv. Якщо не встановлена, + то збірігатиметься останніх 2000 слів у $(HOME)/.sdcv_history. +-..SH BUGS ++.SH BUGS + Звіти про помилки висилайте на адресу dushistov на mail крапка ru. + Не забувайте включати слово "sdcv" десь у полі "Тема:". +-..SH AUTHORS ++.SH AUTHORS + Эвгений А. Душистов, Hu Zheng +-..SH SEE ALSO ++.SH SEE ALSO + stardict(1), http://sdcv.sourceforge.net/, http://stardict.sourceforge.net +--- a/doc/sdcv.1 ++++ b/doc/sdcv.1 +@@ -55,7 +55,7 @@ + + Place, where sdcv expect to find dictionaries. + Instead of /usr/share/stardict/dic you can use everything +-that you want, just set STARDICT_DATA_DIR enviroment variable. ++that you want, just set STARDICT_DATA_DIR environment variable. + For example, if you have dictionaries in /mnt/data/stardict-dicts/dic, + set STARDICT_DATA_DIR to /mnt/data/stardict-dicts. + .TP +@@ -64,7 +64,7 @@ + This file include last $(SDCV_HISTSIZE) words, which you seek with sdcv. + SDCV use this file only if it was compiled with readline library support. + +-.SH ENVIROMENT ++.SH ENVIRONMENT + Environment Variables Used By \fIsdcv\fR: + .TP 20 + .B STARDICT_DATA_DIR diff --git a/misc/sdcv/patches/03_c++.patch b/misc/sdcv/patches/03_c++.patch new file mode 100644 index 0000000000..d8e99e028b --- /dev/null +++ b/misc/sdcv/patches/03_c++.patch @@ -0,0 +1,45 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fixes compilation with recent GCC which is more strict about C++. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125955&group_id=122858&atid=694730 +--- a/src/readline.cpp ++++ b/src/readline.cpp +@@ -23,6 +23,7 @@ + #endif + + #include <cstdio> ++#include <cstdlib> + #ifdef WITH_READLINE + # include <readline/readline.h> + # include <readline/history.h> +--- a/src/libwrapper.cpp ++++ b/src/libwrapper.cpp +@@ -24,6 +24,7 @@ + + #include <glib/gi18n.h> + #include <map> ++#include <cstring> + + #include "utils.hpp" + +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -22,6 +22,8 @@ + # include "config.h" + #endif + ++#include <cstdio> ++#include <cstdlib> + #include <glib.h> + #include <glib/gi18n.h> + +--- a/src/lib/lib.cpp ++++ b/src/lib/lib.cpp +@@ -513,7 +513,7 @@ + { + fseek(idxfile, wordoffset[page_idx], SEEK_SET); + guint32 page_size=wordoffset[page_idx+1]-wordoffset[page_idx]; +- fread(wordentry_buf, std::min(sizeof(wordentry_buf), page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255. ++ fread(wordentry_buf, std::min(sizeof(wordentry_buf), (size_t)page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255. + return wordentry_buf; + } + diff --git a/misc/sdcv/patches/04_format.patch b/misc/sdcv/patches/04_format.patch new file mode 100644 index 0000000000..bbb562363a --- /dev/null +++ b/misc/sdcv/patches/04_format.patch @@ -0,0 +1,21 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fixes displaying of 'g' (gtk markup) entries. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125962&group_id=122858&atid=694730 +--- a/src/libwrapper.cpp ++++ b/src/libwrapper.cpp +@@ -118,7 +118,6 @@ + switch (*p++) { + case 'm': + case 'l': //need more work... +- case 'g': + sec_size = strlen(p); + if (sec_size) { + res+="\n"; +@@ -128,6 +127,7 @@ + } + sec_size++; + break; ++ case 'g': + case 'x': + sec_size = strlen(p); + if (sec_size) { diff --git a/misc/sdcv/patches/05_locales.patch b/misc/sdcv/patches/05_locales.patch new file mode 100644 index 0000000000..3724e3b57e --- /dev/null +++ b/misc/sdcv/patches/05_locales.patch @@ -0,0 +1,80 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fixes typo in program (choise -> choice). +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125953&group_id=122858&atid=694730 +--- a/po/ru.po ++++ b/po/ru.po +@@ -127,7 +127,7 @@ + #: src/libwrapper.cpp:366 + #, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + " .\n" +--- a/po/sdcv.pot ++++ b/po/sdcv.pot +@@ -118,7 +118,7 @@ + #: src/libwrapper.cpp:366 + #, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + +--- a/po/sk.po ++++ b/po/sk.po +@@ -124,7 +124,7 @@ + #: src/libwrapper.cpp:366 + #, fuzzy, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + "Neplatná voľba.\n" +--- a/po/uk.po ++++ b/po/uk.po +@@ -127,7 +127,7 @@ + #: src/libwrapper.cpp:366 + #, fuzzy, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + "Неправильний вибір.\n" +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -118,7 +118,7 @@ + #: src/libwrapper.cpp:366 + #, fuzzy, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + "无效的选择。\n" +--- a/po/zh_TW.po ++++ b/po/zh_TW.po +@@ -120,7 +120,7 @@ + #: src/libwrapper.cpp:366 + #, fuzzy, c-format + msgid "" +-"Invalid choise.\n" ++"Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + "無效的選擇。\n" +--- a/src/libwrapper.cpp ++++ b/src/libwrapper.cpp +@@ -364,7 +364,7 @@ + } else if (choise==-1) + break; + else +- printf(_("Invalid choise.\nIt must be from 0 to %d or -1.\n"), ++ printf(_("Invalid choice.\nIt must be from 0 to %d or -1.\n"), + res_list.size()-1); + } + } else { diff --git a/misc/sdcv/patches/06_sk.po.patch b/misc/sdcv/patches/06_sk.po.patch new file mode 100644 index 0000000000..69a26fd7ec --- /dev/null +++ b/misc/sdcv/patches/06_sk.po.patch @@ -0,0 +1,134 @@ +From: Ivan Masár <helix84@centrum.sk> +Subject: Updates Slovak translation. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125956&group_id=122858&atid=694730 +--- a/po/sk.po ++++ b/po/sk.po +@@ -1,21 +1,21 @@ + # translation of sdcv.po to Slovak + # Copyright (C) + # Zdenko Podobný <zdpo@mailbox.sk>, 2004, 2005. +-# ++# Ivan Masár <helix84@centrum.sk>, 2007. ++ + msgid "" + msgstr "" + "Project-Id-Version: sdcv 0.3.2\n" + "Report-Msgid-Bugs-To: dushistov@mail.ru\n" + "POT-Creation-Date: 2006-04-24 15:18+0400\n" +-"PO-Revision-Date: 2005-01-04 20:19+0100\n" +-"Last-Translator: Zdenko Podobný <zdpo@mailbox.sk>\n" +-"Language-Team: Slovak <<sk-i18n@lists.linux.sk>>\n" ++"PO-Revision-Date: 2007-09-11 00:22+0100\n" ++"Last-Translator: Ivan Masár <helix84@centrum.sk>\n" ++"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "X-Generator: KBabel 1.9.1\n" +-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" ++"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + + #: src/sdcv.cpp:127 + #, c-format +@@ -24,7 +24,7 @@ + "Try '%s --help' for more information.\n" + msgstr "" + "Neznáma voľba.\n" +-"Skúste `%s --help'.\n" ++"Skúste „%s --help“.\n" + + #: src/sdcv.cpp:134 + #, c-format +@@ -43,15 +43,12 @@ + + #: src/sdcv.cpp:137 + #, c-format +-msgid "" +-"-l, --list-dicts display list of available dictionaries and exit\n" +-msgstr "" +-"-l, --list-dicts zobrazí zoznam dostupných slovníkov a skončí\n" ++msgid "-l, --list-dicts display list of available dictionaries and exit\n" ++msgstr "-l, --list-dicts zobrazí zoznam dostupných slovníkov a skončí\n" + + #: src/sdcv.cpp:138 + #, c-format +-msgid "" +-"-u, --use-dict bookname for search use only dictionary with this bookname\n" ++msgid "-u, --use-dict bookname for search use only dictionary with this bookname\n" + msgstr "-u, --use-dict názov použiť pre hľadanie iba zvolený slovník\n" + + #: src/sdcv.cpp:139 +@@ -71,12 +68,8 @@ + + #: src/sdcv.cpp:142 + #, c-format +-msgid "" +-"--data-dir path/to/dir use this directory as path to stardict data " +-"directory\n" +-msgstr "" +-"--data-dir path/to/dir použiť tento priečinok ako cestu pre stardict " +-"dátový priečinok\n" ++msgid "--data-dir path/to/dir use this directory as path to stardict data directory\n" ++msgstr "--data-dir path/to/dir použiť tento priečinok ako cestu pre stardict dátový priečinok\n" + + #: src/sdcv.cpp:148 + #, c-format +@@ -84,14 +77,14 @@ + msgstr "Konzolová verzia StarDict, verzia %s\n" + + #: src/sdcv.cpp:169 +-#, fuzzy, c-format ++#, c-format + msgid "Dictionary's name Word count\n" +-msgstr "názov počet slov\n" ++msgstr "názov slovníka počet slov\n" + + #: src/sdcv.cpp:191 + #, c-format + msgid "g_mkdir failed: %s\n" +-msgstr "" ++msgstr "g_mkdir zlyhalo: %s\n" + + #: src/sdcv.cpp:207 + msgid "Enter word or phrase: " +@@ -104,7 +97,7 @@ + + #: src/libwrapper.cpp:245 + msgid "popen failed" +-msgstr "" ++msgstr "popen zlyhalo" + + #: src/libwrapper.cpp:282 + #, c-format +@@ -117,18 +110,18 @@ + msgstr "Nájdené %d položiek, podobných %s,\n" + + #: src/libwrapper.cpp:352 +-#, fuzzy, c-format ++#, c-format + msgid "Your choice[-1 to abort]: " +-msgstr "Vaša voľba: " ++msgstr "Vaša voľba[-1 zruší]: " + + #: src/libwrapper.cpp:366 +-#, fuzzy, c-format ++#, c-format + msgid "" + "Invalid choice.\n" + "It must be from 0 to %d or -1.\n" + msgstr "" + "Neplatná voľba.\n" +-"Musí byť od 0 po %d.\n" ++"Musí byť od 0 do %d alebo -1.\n" + + #: src/libwrapper.cpp:382 + #, c-format +@@ -137,6 +130,6 @@ + + #~ msgid "Can not convert %s to current locale.\n" + #~ msgstr "Nie je možné konvertovať %s na aktuálne locale.\n" +- + #~ msgid "There is no dictionary with this bookname: %s.\n" + #~ msgstr "Neexistuje slovník s takýmto názvom: %s.\n" ++ diff --git a/misc/sdcv/patches/07_cs.po.patch b/misc/sdcv/patches/07_cs.po.patch new file mode 100644 index 0000000000..300727dd57 --- /dev/null +++ b/misc/sdcv/patches/07_cs.po.patch @@ -0,0 +1,145 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Add Czech translation. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125958&group_id=122858&atid=694730 +--- a/po/LINGUAS ++++ b/po/LINGUAS +@@ -1,2 +1,2 @@ + # Set of available languages. +-sk zh_CN ru uk zh_TW ++cs sk zh_CN ru uk zh_TW +--- /dev/null ++++ b/po/cs.po +@@ -0,0 +1,133 @@ ++# Czech translations for sdcv package. ++# Copyright (C) 2008 Free Software Foundation, Inc. ++# This file is distributed under the same license as the sdcv package. ++# Michal Čihař <michal@cihar.com>, 2008. ++msgid "" ++msgstr "" ++"Project-Id-Version: sdcv 0.4.2\n" ++"Report-Msgid-Bugs-To: dushistov@mail.ru\n" ++"POT-Creation-Date: 2008-09-24 10:54+0200\n" ++"PO-Revision-Date: 2008-09-24 10:42+0200\n" ++"Last-Translator: Michal Čihař <michal@cihar.com>\n" ++"Language-Team: Czech <cs@li.org>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" ++ ++#: src/sdcv.cpp:127 ++#, c-format ++msgid "" ++"Unknown option.\n" ++"Try '%s --help' for more information.\n" ++msgstr "" ++"Neznámý parametr.\n" ++"Zkuste '%s --help' pro nápovědu.\n" ++ ++#: src/sdcv.cpp:134 ++#, c-format ++msgid "Usage: %s [OPTIONS] words\n" ++msgstr "Použití: %s [PARAMETRY] slova\n" ++ ++#: src/sdcv.cpp:135 ++#, c-format ++msgid "-h, --help display this help and exit\n" ++msgstr "-h, --help zobrazí tuto nápovědu a skončí\n" ++ ++#: src/sdcv.cpp:136 ++#, c-format ++msgid "-v, --version display version information and exit\n" ++msgstr "-v, --version zobrazí informace o verzi a skončí\n" ++ ++#: src/sdcv.cpp:137 ++#, c-format ++msgid "" ++"-l, --list-dicts display list of available dictionaries and exit\n" ++msgstr "-l, --list-dicts zobrazí seznam dostupných slovníků a skončí\n" ++ ++#: src/sdcv.cpp:138 ++#, c-format ++msgid "" ++"-u, --use-dict bookname for search use only dictionary with this bookname\n" ++msgstr "-u, --use-dict jméno vyhledávat jen v zadaném slovníku\n" ++ ++#: src/sdcv.cpp:139 ++#, c-format ++msgid "-n, --non-interactive for use in scripts\n" ++msgstr "-n, --non-interactive pro použití ve skriptech\n" ++ ++#: src/sdcv.cpp:140 ++#, c-format ++msgid "--utf8-output output must be in utf8\n" ++msgstr "--utf8-output výstup musí být v utf8\n" ++ ++#: src/sdcv.cpp:141 ++#, c-format ++msgid "--utf8-input input of sdcv in utf8\n" ++msgstr "--utf8-input vstup musí být v utf8\n" ++ ++#: src/sdcv.cpp:142 ++#, c-format ++msgid "" ++"--data-dir path/to/dir use this directory as path to stardict data " ++"directory\n" ++msgstr "" ++"--data-dir cesta/někam použít tento adresář jako cestu ke slovníkům " ++"stardict\n" ++ ++#: src/sdcv.cpp:148 ++#, c-format ++msgid "Console version of Stardict, version %s\n" ++msgstr "Konzolová verze Stardictu, verze %s\n" ++ ++#: src/sdcv.cpp:169 ++#, c-format ++msgid "Dictionary's name Word count\n" ++msgstr "Jméno slovníku Počet slov\n" ++ ++#: src/sdcv.cpp:191 ++#, c-format ++msgid "g_mkdir failed: %s\n" ++msgstr "g_mkdir selhalo: %s\n" ++ ++#: src/sdcv.cpp:207 ++msgid "Enter word or phrase: " ++msgstr "Zadejte slovo nebo frázi: " ++ ++#: src/sdcv.cpp:215 ++#, c-format ++msgid "There are no words/phrases to translate.\n" ++msgstr "Nebyla zadáno nic k přeložení.\n" ++ ++#: src/libwrapper.cpp:246 ++msgid "popen failed" ++msgstr "popen selhalo" ++ ++#: src/libwrapper.cpp:283 ++#, c-format ++msgid "Can not convert %s to utf8.\n" ++msgstr "Nepodařilo se převést %s do utf8.\n" ++ ++#: src/libwrapper.cpp:340 src/libwrapper.cpp:372 ++#, c-format ++msgid "Found %d items, similar to %s.\n" ++msgstr "Nalezeno %d záznamů podobných %s.\n" ++ ++#: src/libwrapper.cpp:353 ++#, c-format ++msgid "Your choice[-1 to abort]: " ++msgstr "Vaše volba [-1 pro ukončení]: " ++ ++#: src/libwrapper.cpp:367 ++#, c-format ++msgid "" ++"Invalid choice.\n" ++"It must be from 0 to %d or -1.\n" ++msgstr "" ++"Chybná volba.\n" ++"Musí být mezi 0 a %d nebo -1.\n" ++ ++#: src/libwrapper.cpp:383 ++#, c-format ++msgid "Nothing similar to %s, sorry :(\n" ++msgstr "Nic podobného %s nenalezeno, promiň :(\n" diff --git a/misc/sdcv/patches/08_fr.po.patch b/misc/sdcv/patches/08_fr.po.patch new file mode 100644 index 0000000000..498772d751 --- /dev/null +++ b/misc/sdcv/patches/08_fr.po.patch @@ -0,0 +1,158 @@ +From: Vincent Petry <PVince81@yahoo.fr> +Subject: This patch adds a french translation. +--- /dev/null ++++ b/po/fr.po +@@ -0,0 +1,147 @@ ++# French translations for sdcv package ++# Traduction française pour le paquet sdcv. ++# Copyright (C) 2004 THE sdcv'S COPYRIGHT HOLDER ++# This file is distributed under the same license as the sdcv package. ++# <dushistov@mail.ru>, 2004. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: sdcv 0.4.2\n" ++"Report-Msgid-Bugs-To: dushistov@mail.ru\n" ++"POT-Creation-Date: 2009-06-15 23:20+0800\n" ++"PO-Revision-Date: 2009-06-15 23:20+0800\n" ++"Last-Translator: <PVince81@yahoo.fr>\n" ++"Language-Team: Vincent Petry <PVince81@yahoo.fr>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" ++"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" ++ ++#: src/sdcv.cpp:127 ++#, c-format ++msgid "" ++"Unknown option.\n" ++"Try '%s --help' for more information.\n" ++msgstr "" ++"Option inconnue.\n" ++"Essayez '%s --help' pour plus d'informations.\n" ++ ++#: src/sdcv.cpp:134 ++#, c-format ++msgid "Usage: %s [OPTIONS] words\n" ++msgstr "Usage: %s [OPTIONS] mots\n" ++ ++#: src/sdcv.cpp:135 ++#, c-format ++msgid "-h, --help display this help and exit\n" ++msgstr "-h, --help afficher cet aide et sortir\n" ++ ++#: src/sdcv.cpp:136 ++#, c-format ++msgid "-v, --version display version information and exit\n" ++msgstr "" ++"-v, --version afficher les informations de version et sortir\n" ++ ++#: src/sdcv.cpp:137 ++#, c-format ++msgid "" ++"-l, --list-dicts display list of available dictionaries and exit\n" ++msgstr "" ++"-l, --list-dicts afficher la liste des dictionnaires disponibles et " ++"sortir\n" ++ ++#: src/sdcv.cpp:138 ++#, c-format ++msgid "" ++"-u, --use-dict bookname for search use only dictionary with this bookname\n" ++msgstr "" ++"-u, --use-dict nom_dict pour chercher seulement en utilisant le dictionnaire " ++"spécifié\n" ++ ++#: src/sdcv.cpp:139 ++#, c-format ++msgid "-n, --non-interactive for use in scripts\n" ++msgstr "-n, --non-interactive pour l'utilisation dans des scripts\n" ++ ++#: src/sdcv.cpp:140 ++#, c-format ++msgid "--utf8-output output must be in utf8\n" ++msgstr "--utf8-output force la sortie au format utf8\n" ++ ++#: src/sdcv.cpp:141 ++#, c-format ++msgid "--utf8-input input of sdcv in utf8\n" ++msgstr "--utf8-input force l'entrée de sdcv au format utf8\n" ++ ++#: src/sdcv.cpp:142 ++#, c-format ++msgid "" ++"--data-dir path/to/dir use this directory as path to stardict data " ++"directory\n" ++msgstr "" ++"--data-dir chemin utiliser ce chemin pour trouver les données de " ++"stardict\n" ++ ++#: src/sdcv.cpp:148 ++#, c-format ++msgid "Console version of Stardict, version %s\n" ++msgstr "Version console de Stardict, version %s\n" ++ ++#: src/sdcv.cpp:169 ++#, c-format ++msgid "Dictionary's name Word count\n" ++msgstr "Nom dictionnaire Nombre de mots\n" ++ ++#: src/sdcv.cpp:191 ++#, c-format ++msgid "g_mkdir failed: %s\n" ++msgstr "Échec de g_mkdir : %s\n" ++ ++#: src/sdcv.cpp:207 ++msgid "Enter word or phrase: " ++msgstr "Entrez un mot ou une phrase: " ++ ++#: src/sdcv.cpp:215 ++#, c-format ++msgid "There are no words/phrases to translate.\n" ++msgstr "Il n'y a pas de mots/phrases à traduire.\n" ++ ++#: src/libwrapper.cpp:245 ++msgid "popen failed" ++msgstr "Échec de popen" ++ ++#: src/libwrapper.cpp:282 ++#, c-format ++msgid "Can not convert %s to utf8.\n" ++msgstr "Ne peut convertir %s au format utf8.\n" ++ ++#: src/libwrapper.cpp:339 src/libwrapper.cpp:371 ++#, c-format ++msgid "Found %d items, similar to %s.\n" ++msgstr "Trouvé %d éléments similaires à %s.\n" ++ ++#: src/libwrapper.cpp:352 ++#, c-format ++msgid "Your choice[-1 to abort]: " ++msgstr "Votre choix[-1 pour abandonner] : " ++ ++#: src/libwrapper.cpp:366 ++#, c-format ++msgid "" ++"Invalid choise.\n" ++"It must be from 0 to %d or -1.\n" ++msgstr "" ++"Selection invalide.\n" ++"Veuillez choisir un nombre entre 0 et %d, ou -1.\n" ++ ++#: src/libwrapper.cpp:382 ++#, c-format ++msgid "Nothing similar to %s, sorry :(\n" ++msgstr "Aucun mot/phrase similaire à %s, désolé :(\n" ++ ++#~ msgid "Can not convert %s to current locale.\n" ++#~ msgstr "Ne peut pas convertir %s dans la locale courante.\n" ++ ++#~ msgid "There is no dictionary with this bookname: %s.\n" ++#~ msgstr "Pas de dictionnaire : %s.\n" +--- a/po/LINGUAS ++++ b/po/LINGUAS +@@ -1,2 +1,2 @@ + # Set of available languages. +-cs sk zh_CN ru uk zh_TW ++cs sk zh_CN ru uk zh_TW fr diff --git a/misc/sdcv/patches/09_fix-tests.patch b/misc/sdcv/patches/09_fix-tests.patch new file mode 100644 index 0000000000..cc93890280 --- /dev/null +++ b/misc/sdcv/patches/09_fix-tests.patch @@ -0,0 +1,53 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fixes tests so that they can be executed using dash as /bin/sh. +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2125959&group_id=122858&atid=694730 +--- a/tests/t_datadir ++++ b/tests/t_datadir +@@ -2,11 +2,11 @@ + + unset SDCV_PAGER + have=`../src/sdcv --data-dir ./ -l | wc -l` +-let have=have-1 ++have=$(($have-1)) + ndicts=`find "${HOME}"/.stardict/dic -name "*.ifo" -print | wc -l` +-let ndicts=ndicts+1 ++ndicts=$(($ndicts+1)) + if [ $have -ne $ndicts ]; then +- let ndicts=ndicts-1 ++ ndicts=$(($ndicts-1)) + echo "test failed: sdcv says: we have: $have, but really we have: $ndicts" >&2 + exit 1 + fi +--- a/tests/t_list ++++ b/tests/t_list +@@ -1,10 +1,10 @@ + #!/bin/sh + + ndicts=`../src/sdcv -l | wc -l` +-let ndicts=ndicts-1 ++ndicts=$(($ndicts-1)) + ncom=`find /usr/share/stardict/dic -name "*.ifo" | wc -l` + nspe=`find "${HOME}"/.stardict/dic -name "*.ifo" | wc -l` +-let nmy=ncom+nspe ++nmy=$(($ncom+$nspe)) + + if [ $nmy -ne $ndicts ]; then + echo "should be: $nmy, we have: $ndicts" >&2 +--- a/tests/t_utf8input ++++ b/tests/t_utf8input +@@ -9,13 +9,13 @@ + " + j=0 + for i in `../src/sdcv --utf8-input -n человек 2>&1`; do +- let j=j+1 ++ j=$(($j+1)) + if [ $j -ne 1 ]; then + break; + fi + done + +-if [ $j -eq 1 ]; then ++if [ $j -ne 1 ]; then + echo "empty results of search: test failed" >&2 + exit 1 + fi diff --git a/misc/sdcv/patches/10_use-env-home.patch b/misc/sdcv/patches/10_use-env-home.patch new file mode 100644 index 0000000000..e912c68268 --- /dev/null +++ b/misc/sdcv/patches/10_use-env-home.patch @@ -0,0 +1,31 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Use environment variable HOME to get home directory. g_get_home_dir does ignore it. +Index: sdcv-0.4.2/src/sdcv.cpp +=================================================================== +--- sdcv-0.4.2.orig/src/sdcv.cpp 2008-10-03 09:15:26.000000000 +0200 ++++ sdcv-0.4.2/src/sdcv.cpp 2008-10-03 09:16:25.000000000 +0200 +@@ -157,11 +157,14 @@ + data_dir="/usr/share/stardict/dic"; + } + ++ const char *homedir = g_getenv ("HOME"); ++ if (!homedir) ++ homedir = g_get_home_dir (); + + + strlist_t dicts_dir_list; + +- dicts_dir_list.push_back(std::string(g_get_home_dir())+G_DIR_SEPARATOR+ ++ dicts_dir_list.push_back(std::string(homedir)+G_DIR_SEPARATOR+ + ".stardict"+G_DIR_SEPARATOR+"dic"); + dicts_dir_list.push_back(data_dir); + +@@ -186,7 +189,7 @@ + } + + +- string conf_dir = string(g_get_home_dir())+G_DIR_SEPARATOR+".stardict"; ++ string conf_dir = string(homedir)+G_DIR_SEPARATOR+".stardict"; + if (g_mkdir(conf_dir.c_str(), S_IRWXU)==-1 && errno!=EEXIST) + fprintf(stderr, _("g_mkdir failed: %s\n"), strerror(errno)); + diff --git a/misc/sdcv/patches/11_allignment.patch b/misc/sdcv/patches/11_allignment.patch new file mode 100644 index 0000000000..dd719f6b7f --- /dev/null +++ b/misc/sdcv/patches/11_allignment.patch @@ -0,0 +1,27 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Fix unalligned access to buffer. + +On several architectures (arm, armel, sparc and ia64), unalligned access to +integers is not allowed. Buffer in this function is not alligned at all and +attempt to read integer from it causes crash of application on such +architectures. + +Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2149388&group_id=122858&atid=694730 +--- a/src/lib/lib.cpp ++++ b/src/lib/lib.cpp +@@ -496,9 +496,13 @@ + entries[i].keystr=p; + len=strlen(p); + p+=len+1; +- entries[i].off=g_ntohl(*reinterpret_cast<guint32 *>(p)); ++ /* ++ * Can not use typecasting here, because *data does not have ++ * to be alligned and unalligned access fails on some architectures. ++ */ ++ entries[i].off=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3]; + p+=sizeof(guint32); +- entries[i].size=g_ntohl(*reinterpret_cast<guint32 *>(p)); ++ entries[i].size=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3]; + p+=sizeof(guint32); + } + } diff --git a/misc/sdcv/patches/12_fix-formats.patch b/misc/sdcv/patches/12_fix-formats.patch new file mode 100644 index 0000000000..2d8fcc3025 --- /dev/null +++ b/misc/sdcv/patches/12_fix-formats.patch @@ -0,0 +1,35 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Printing of size_t type should use %zd. +--- a/src/libwrapper.cpp ++++ b/src/libwrapper.cpp +@@ -337,13 +337,13 @@ + }//if (!force) + + if (!show_all_results && !force) { +- printf(_("Found %d items, similar to %s.\n"), res_list.size(), ++ printf(_("Found %zd items, similar to %s.\n"), res_list.size(), + utf8_output ? str : utf8_to_locale_ign_err(str).c_str()); + for (size_t i=0; i<res_list.size(); ++i) { + string loc_bookname, loc_def; + loc_bookname=utf8_to_locale_ign_err(res_list[i].bookname); + loc_def=utf8_to_locale_ign_err(res_list[i].def); +- printf("%d)%s-->%s\n", i, ++ printf("%zd)%s-->%s\n", i, + utf8_output ? res_list[i].bookname.c_str() : loc_bookname.c_str(), + utf8_output ? res_list[i].def.c_str() : loc_def.c_str()); + } +@@ -364,12 +364,12 @@ + } else if (choise==-1) + break; + else +- printf(_("Invalid choice.\nIt must be from 0 to %d or -1.\n"), ++ printf(_("Invalid choice.\nIt must be from 0 to %zd or -1.\n"), + res_list.size()-1); + } + } else { + sdcv_pager pager(force); +- fprintf(pager.get_stream(), _("Found %d items, similar to %s.\n"), ++ fprintf(pager.get_stream(), _("Found %zd items, similar to %s.\n"), + res_list.size(), utf8_output ? str : utf8_to_locale_ign_err(str).c_str()); + for (PSearchResult ptr=res_list.begin(); ptr!=res_list.end(); ++ptr) + print_search_result(pager.get_stream(), *ptr); diff --git a/misc/sdcv/patches/13_zlib-return-value.patch b/misc/sdcv/patches/13_zlib-return-value.patch new file mode 100644 index 0000000000..171ac15538 --- /dev/null +++ b/misc/sdcv/patches/13_zlib-return-value.patch @@ -0,0 +1,19 @@ +From: Michal Čihař <nijel@debian.org> +Subject: Zlib can return negative value, but gulong is unsigned, so it can not catch the error state. +--- a/src/lib/lib.cpp ++++ b/src/lib/lib.cpp +@@ -751,12 +751,12 @@ + + idxdatabuf = (gchar *)g_malloc(fsize); + +- gulong len = gzread(in, idxdatabuf, fsize); ++ ssize_t len = gzread(in, idxdatabuf, fsize); + gzclose(in); + if (len < 0) + return false; + +- if (len != fsize) ++ if (len != (ssize_t)fsize) + return false; + + wordlist.resize(wc+1); diff --git a/misc/sdcv/sdcv.SlackBuild b/misc/sdcv/sdcv.SlackBuild new file mode 100644 index 0000000000..467d8648a3 --- /dev/null +++ b/misc/sdcv/sdcv.SlackBuild @@ -0,0 +1,107 @@ +#!/bin/sh + +# Slackware build script for sdcv + +# Copyright 2012 Vladimir Yatsemirski <7catssmile@gmail.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=sdcv +VERSION=${VERSION:-0.4.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Apply Debian patches +for i in $CWD/patches/* ; do patch -p1 < $i ; done + +autoreconf -fi + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --with-readline \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO\ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/misc/sdcv/sdcv.info b/misc/sdcv/sdcv.info new file mode 100644 index 0000000000..0415f46a7d --- /dev/null +++ b/misc/sdcv/sdcv.info @@ -0,0 +1,10 @@ +PRGNAM="sdcv" +VERSION="0.4.2" +HOMEPAGE="http://sdcv.sourceforge.net" +DOWNLOAD="http://downloads.sourceforge.net/sdcv/sdcv-0.4.2.tar.bz2" +MD5SUM="f624662b333daa5da2d3e99cef519f17" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Vladimir Yatsemirski" +EMAIL="7catssmile@gmail.com" diff --git a/misc/sdcv/slack-desc b/misc/sdcv/slack-desc new file mode 100644 index 0000000000..b2dca734bf --- /dev/null +++ b/misc/sdcv/slack-desc @@ -0,0 +1,11 @@ +sdcv: sdcv (console dictionary application) +sdcv: +sdcv: sdcv is a console version of stardict, a cross-platform +sdcv: and international dictionary. +sdcv: +sdcv: homepage: http://sdcv.sourceforge.net +sdcv: +sdcv: +sdcv: +sdcv: +sdcv: |