From 1660aa9027b24c654174ac65eecf65efceb009d7 Mon Sep 17 00:00:00 2001 From: gil Date: Fri, 5 Jan 2024 17:51:16 +0100 Subject: [PATCH] update to 2.2.3 [release 2.2.3-1mamba;Thu Mar 10 2011] --- OmegaT-2.0.5-remove-osx-deps.patch | 32 ++++ OmegaT-2.2.3-docsdir.patch | 25 +++ OmegaT-2.2.3-remove-jmyspell.patch | 89 +++++++++ OmegaT-2.2.3-system-hunspell.patch | 43 +++++ OmegaT-2.2.3-use-openjdk-swingworker.patch | 24 +++ OmegaT-build.xml | 152 ++++++++++++++++ OmegaT-lib-mnemonics-build.xml | 47 +++++ OmegaT-script | 13 ++ OmegaT.spec | 198 +++++++++++++++++++++ README.md | 25 +++ omegat.desktop | 11 ++ 11 files changed, 659 insertions(+) create mode 100644 OmegaT-2.0.5-remove-osx-deps.patch create mode 100644 OmegaT-2.2.3-docsdir.patch create mode 100644 OmegaT-2.2.3-remove-jmyspell.patch create mode 100644 OmegaT-2.2.3-system-hunspell.patch create mode 100644 OmegaT-2.2.3-use-openjdk-swingworker.patch create mode 100644 OmegaT-build.xml create mode 100644 OmegaT-lib-mnemonics-build.xml create mode 100644 OmegaT-script create mode 100644 OmegaT.spec create mode 100644 omegat.desktop diff --git a/OmegaT-2.0.5-remove-osx-deps.patch b/OmegaT-2.0.5-remove-osx-deps.patch new file mode 100644 index 0000000..a17761a --- /dev/null +++ b/OmegaT-2.0.5-remove-osx-deps.patch @@ -0,0 +1,32 @@ +--- src/org/omegat/gui/main/MainWindowMenu.java 2010-05-12 12:09:06.000000000 +0200 ++++ src/org/omegat/gui/main/MainWindowMenu.java-gil 2010-12-05 12:17:54.000000000 +0100 +@@ -42,7 +42,6 @@ + import javax.swing.JMenuItem; + import javax.swing.JSeparator; + +-import net.roydesign.mac.MRJAdapter; + + import org.omegat.core.Core; + import org.omegat.core.CoreEvents; +@@ -256,21 +255,6 @@ + * Initialize Mac-specific features. + */ + private void initMacSpecific() { +- try { +- // MacOSX-specific +- MRJAdapter.addQuitApplicationListener(new ActionListener() { +- public void actionPerformed(ActionEvent e) { +- mainWindowMenuHandler.projectExitMenuItemActionPerformed(); +- } +- }); +- MRJAdapter.addAboutListener(new ActionListener() { +- public void actionPerformed(ActionEvent e) { +- mainWindowMenuHandler.helpAboutMenuItemActionPerformed(); +- } +- }); +- } catch (NoClassDefFoundError e) { +- Log.log(e); +- } + } + + /** diff --git a/OmegaT-2.2.3-docsdir.patch b/OmegaT-2.2.3-docsdir.patch new file mode 100644 index 0000000..34d5ee2 --- /dev/null +++ b/OmegaT-2.2.3-docsdir.patch @@ -0,0 +1,25 @@ +diff -Nru src/org/omegat/gui/help/HelpFrame.java src/org/omegat-gil/gui/help/HelpFrame.java +--- src/org/omegat/gui/help/HelpFrame.java 2011-01-18 16:36:16.000000000 +0100 ++++ src/org/omegat-gil/gui/help/HelpFrame.java 2011-03-10 19:08:45.000000000 +0100 +@@ -173,8 +173,7 @@ + } else { + path = filename; + } +- File f = new File(StaticUtils.installDir() + File.separator + OConsts.HELP_DIR + File.separator +- + path); ++ File f = new File(OConsts.HELP_DIR + File.separator + path); + try { + if (f.exists()) { + return f.toURI().toURL(); +diff -Nru src/org/omegat/util/OConsts.java src/org/omegat-gil/util/OConsts.java +--- src/org/omegat/util/OConsts.java 2011-01-18 16:37:04.000000000 +0100 ++++ src/org/omegat-gil/util/OConsts.java 2011-03-10 19:10:32.000000000 +0100 +@@ -58,7 +58,7 @@ + // help + public static final String HELP_HOME = "index.html"; + public static final String HELP_INSTANT_START = "instantStartGuideNoTOC.html"; +- public static final String HELP_DIR = "docs"; ++ public static final String HELP_DIR = "/usr/share/omegat/docs"; + public static final String HELP_LANG_INDEX = "languageIndex.html"; + + // status file consts diff --git a/OmegaT-2.2.3-remove-jmyspell.patch b/OmegaT-2.2.3-remove-jmyspell.patch new file mode 100644 index 0000000..bde527d --- /dev/null +++ b/OmegaT-2.2.3-remove-jmyspell.patch @@ -0,0 +1,89 @@ +diff -Nru src/org/omegat/core/spellchecker/SpellChecker.java src/org/omegat/core/spellchecker-gil/SpellChecker.java +--- src/org/omegat/core/spellchecker/SpellChecker.java 2011-01-18 16:34:24.000000000 +0100 ++++ src/org/omegat/core/spellchecker-gil/SpellChecker.java 2011-03-10 19:18:38.000000000 +0100 +@@ -150,11 +150,6 @@ + Log.log("Error loading hunspell: " + err.getMessage()); + } + if (checker == null) { +- try { +- checker = new SpellCheckerJMySpell(language, dictionaryName, affixName); +- } catch (Exception ex) { +- Log.log("Error loading jmyspell: " + ex.getMessage()); +- } + } + } + if (checker == null) { +diff -Nru src/org/omegat/core/spellchecker/SpellCheckerJMySpell.java src/org/omegat/core/spellchecker-gil/SpellCheckerJMySpell.java +--- src/org/omegat/core/spellchecker/SpellCheckerJMySpell.java 2011-01-18 16:34:24.000000000 +0100 ++++ src/org/omegat/core/spellchecker-gil/SpellCheckerJMySpell.java 1970-01-01 01:00:00.000000000 +0100 +@@ -1,70 +0,0 @@ +-/************************************************************************** +- OmegaT - Computer Assisted Translation (CAT) tool +- with fuzzy matching, translation memory, keyword search, +- glossaries, and translation leveraging into updated projects. +- +- Copyright (C) 2010 Alex Buloichik +- Home page: http://www.omegat.org/ +- Support center: http://groups.yahoo.com/group/OmegaT/ +- +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- **************************************************************************/ +- +-package org.omegat.core.spellchecker; +- +-import java.io.File; +-import java.util.List; +-import java.util.logging.Logger; +- +-import org.dts.spell.dictionary.OpenOfficeSpellDictionary; +-import org.dts.spell.dictionary.SpellDictionary; +- +-/** +- * JMySpell spell checker implementation. +- * +- * @author Alex Buloichik (alex73mail@gmail.com) +- */ +-public class SpellCheckerJMySpell implements ISpellCheckerProvider { +- /** Local logger. */ +- private static final Logger LOGGER = Logger.getLogger(SpellCheckerJMySpell.class.getName()); +- +- private org.dts.spell.SpellChecker jmyspell; +- +- public SpellCheckerJMySpell(String language, String dictionaryName, String affixName) throws Exception { +- +- SpellDictionary dict = new OpenOfficeSpellDictionary(new File(dictionaryName), new File(affixName), +- false); +- jmyspell = new org.dts.spell.SpellChecker(dict); +- jmyspell.setCaseSensitive(false); +- +- LOGGER.finer("Initialize SpellChecker by JMySpell for language '" + language + "' dictionary " +- + dictionaryName); +- } +- +- public void destroy() { +- jmyspell = null; +- } +- +- public boolean isCorrect(String word) { +- return jmyspell.isCorrect(word); +- } +- +- public List suggest(String word) { +- return jmyspell.getDictionary().getSuggestions(word, 20); +- } +- +- public void learnWord(String word) { +- } +-} diff --git a/OmegaT-2.2.3-system-hunspell.patch b/OmegaT-2.2.3-system-hunspell.patch new file mode 100644 index 0000000..615bf27 --- /dev/null +++ b/OmegaT-2.2.3-system-hunspell.patch @@ -0,0 +1,43 @@ +diff -Nru src/org/omegat/core/spellchecker/SpellCheckerHunspell.java src/org/omegat-gil/core/spellchecker/SpellCheckerHunspell.java +--- src/org/omegat/core/spellchecker/SpellCheckerHunspell.java 2011-01-18 16:34:24.000000000 +0100 ++++ src/org/omegat-gil/core/spellchecker/SpellCheckerHunspell.java 2011-03-10 19:25:03.000000000 +0100 +@@ -76,8 +76,7 @@ + libraryPath = Native.getWebStartLibraryPath(OConsts.SPELLCHECKER_LIBRARY_NAME) + + File.separator + mapLibraryName(OConsts.SPELLCHECKER_LIBRARY_NAME); + } else { +- libraryPath = StaticUtils.installDir() + File.separator + OConsts.NATIVE_LIBRARY_DIR +- + File.separator + mapLibraryName(OConsts.SPELLCHECKER_LIBRARY_NAME); ++ libraryPath = OConsts.SPELLCHECKER_LIBRARY_PATH; + } + + hunspell = (Hunspell) Native.loadLibrary(libraryPath, Hunspell.class); +diff -Nru src/org/omegat/core/spellchecker/SpellChecker.java src/org/omegat-gil/core/spellchecker/SpellChecker.java +--- src/org/omegat/core/spellchecker/SpellChecker.java 2011-03-10 19:21:01.000000000 +0100 ++++ src/org/omegat-gil/core/spellchecker/SpellChecker.java 2011-03-10 19:30:24.000000000 +0100 +@@ -115,7 +115,9 @@ + // initialize the spell checker - get the data from the preferences + String language = Core.getProject().getProjectProperties().getTargetLanguage().getLocaleCode(); + +- String dictionaryDir = Preferences.getPreference(Preferences.SPELLCHECKER_DICTIONARY_DIRECTORY); ++ String dictionaryDir = Preferences.getPreferenceDefault( ++ Preferences.SPELLCHECKER_DICTIONARY_DIRECTORY, ++ OConsts.SPELLCHECKER_SYSTEM_DICTIONARY_DIRECTORY); + + if (dictionaryDir != null) { + String affixName = dictionaryDir + File.separator + language + OConsts.SC_AFFIX_EXTENSION; +diff -Nru src/org/omegat/util/OConsts.java src/org/omegat-gil/util/OConsts.java +--- src/org/omegat/util/OConsts.java 2011-03-10 19:21:01.000000000 +0100 ++++ src/org/omegat-gil/util/OConsts.java 2011-03-10 19:28:04.000000000 +0100 +@@ -102,6 +102,12 @@ + /** The name of the spell checking library */ + public static final String SPELLCHECKER_LIBRARY_NAME = "hunspell"; + ++ /** the path of the spell checking library */ ++ public static final String SPELLCHECKER_LIBRARY_PATH = "/usr/lib/libhunspell-1.2.so.0"; ++ ++ /** directory of system dictionaries */ ++ public static final String SPELLCHECKER_SYSTEM_DICTIONARY_DIRECTORY = "/usr/share/myspell/"; // NOI18N ++ + /** the native library directory */ + public static final String NATIVE_LIBRARY_DIR = "native"; + diff --git a/OmegaT-2.2.3-use-openjdk-swingworker.patch b/OmegaT-2.2.3-use-openjdk-swingworker.patch new file mode 100644 index 0000000..632cde9 --- /dev/null +++ b/OmegaT-2.2.3-use-openjdk-swingworker.patch @@ -0,0 +1,24 @@ +diff -Nru src/org/omegat/gui/main/MainWindowMenuHandler.java src/org/omegat/gui/main-gil/MainWindowMenuHandler.java +--- src/org/omegat/gui/main/MainWindowMenuHandler.java 2011-01-18 16:35:36.000000000 +0100 ++++ src/org/omegat/gui/main-gil/MainWindowMenuHandler.java 2011-03-10 19:00:51.000000000 +0100 +@@ -32,7 +32,7 @@ + import javax.swing.JDialog; + import javax.swing.JOptionPane; + +-import org.jdesktop.swingworker.SwingWorker; ++import javax.swing.SwingWorker; + import org.omegat.core.Core; + import org.omegat.core.CoreEvents; + import org.omegat.core.data.SourceTextEntry; +diff -Nru src/org/omegat/gui/main/ProjectUICommands.java src/org/omegat/gui/main-gil/ProjectUICommands.java +--- src/org/omegat/gui/main/ProjectUICommands.java 2011-03-10 19:04:01.000000000 +0100 ++++ src/org/omegat/gui/main-gil/ProjectUICommands.java 2011-03-10 19:03:48.000000000 +0100 +@@ -29,7 +29,7 @@ + import javax.swing.JOptionPane; + import javax.swing.SwingUtilities; + +-import org.jdesktop.swingworker.SwingWorker; ++import javax.swing.SwingWorker; + import org.omegat.core.Core; + import org.omegat.core.data.ProjectFactory; + import org.omegat.core.data.ProjectProperties; diff --git a/OmegaT-build.xml b/OmegaT-build.xml new file mode 100644 index 0000000..3c4c15b --- /dev/null +++ b/OmegaT-build.xml @@ -0,0 +1,152 @@ + + + + + OmegaT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OmegaT-lib-mnemonics-build.xml b/OmegaT-lib-mnemonics-build.xml new file mode 100644 index 0000000..176a145 --- /dev/null +++ b/OmegaT-lib-mnemonics-build.xml @@ -0,0 +1,47 @@ + + + OmegaT lib-mnemonics library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OmegaT-script b/OmegaT-script new file mode 100644 index 0000000..302bd87 --- /dev/null +++ b/OmegaT-script @@ -0,0 +1,13 @@ +#!/bin/sh +. /usr/share/java-utils/java-functions + +BASE_JARS="OmegaT htmlparser1 vldocking jna lib-mnemonics jaxme/jaxme2 jaxme/jaxme2-rt jaxme/jaxmejs jaxme/jaxmepm jaxme/jaxmexs swing-layout" + +MAIN_CLASS=org.omegat.Main + +set_jvm +set_flags $BASE_FLAGS +set_options $BASE_OPTIONS +set_classpath $BASE_JARS + +run "$@" diff --git a/OmegaT.spec b/OmegaT.spec new file mode 100644 index 0000000..498494a --- /dev/null +++ b/OmegaT.spec @@ -0,0 +1,198 @@ +%define rel _03 +Name: OmegaT +Version: 2.2.3 +Release: 1mamba +Summary: OmegaT® - multiplatform CAT tool +Group: Graphical Desktop/Applications/Development +Vendor: openmamba +Distribution: openmamba +Packager: gil +URL: http://www.omegat.org/ +Source0: http://downloads.sourceforge.net/omegat/%{name}_%{version}%{?rel}_Source.zip +Source1: omegat.desktop +Source2: OmegaT-lib-mnemonics-build.xml +Source3: OmegaT-build.xml +Source4: OmegaT-script +Patch0: OmegaT-2.0.5-remove-osx-deps.patch +Patch1: OmegaT-2.2.3-docsdir.patch +Patch2: OmegaT-2.2.3-remove-jmyspell.patch +Patch3: OmegaT-2.2.3-system-hunspell.patch +Patch4: OmegaT-2.2.3-use-openjdk-swingworker.patch +License: GPL +BuildRequires: apache-ant +BuildRequires: apache-ws-jaxme +BuildRequires: desktop-file-utils +BuildRequires: dos2unix +BuildRequires: java-htmlparser1 +BuildRequires: java-jna +BuildRequires: java-junit48 +BuildRequires: java-openjdk +# TODO rebuild in devel BuildRequires: java-sun-jaxb-2.1-impl == 2.1.7 +BuildRequires: java-swing-layout +BuildRequires: java-vldocking +BuildRequires: jpackage-utils +BuildRequires: xmlunit +Requires: apache-ws-jaxme +Requires: hunspell +Requires: java-htmlparser1 +Requires: java-jna +Requires: java-swing-layout +Requires: java-vldocking +Requires: jpackage-utils +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +OmegaT® is a free translation memory application written in Java. +It is a tool intended for professional translators. + +OmegaT® has the following features: + +* Fuzzy matching +* Match propagation +* Simultaneous processing of multiple-file projects +* Simultaneous use of multiple translation memories +* User glossaries with recognition of inflected forms +* Unicode (UTF-8) support: can be used with non-Latin alphabets +* Support for right-to-left languages +* Integral spelling checker +* Compatible with other translation memory applications (TMX) +* Interface to Google Translate + +Document file formats include: +* XHTML and HTML +* Microsoft Office XML +* OpenOffice.org/StarOffice +* XLIFF (Okapi) +* MediaWiki (Wikipedia) +* Plain text + + +%prep +%setup -q -c -n OmegaT-%{version} +%patch0 -p0 +%patch1 -p0 +%patch2 -p0 +%patch3 -p0 +%patch4 -p0 + +for j in $(find . -name "*.jar"); do + mv $j $j.no +done + +ln -sf $(build-classpath junit48) test/lib/junit-4.4.jar +ln -sf $(build-classpath xmlunit) test/lib/xmlunit-1.1.jar + +#ln -sf $(build-classpath vldocking) lib/vldocking_2.1.4.jar +#ln -sf $(build-classpath jna.jar) lib/jna.jar +#ln -sf $(build-classpath swing-layout) lib/swing-layout-1.0.jar +#ln -sf $(build-classpath htmlparser1) lib/htmlparser.jar + +rm -r native/* + +# nbproject/org-netbeans-modules-java-j2seproject-copylibstask.jar +# lib/jmyspell-core-1.0.0-beta-2.jar +# OSX dep +# mv ./lib/MRJAdapter.jar ./lib/MRJAdapter.jar.no +rm lib/sources/MRJAdapter-source.zip + +# TODO jaxb deps +# lib/jaxb-api.jar +# lib/activation.jar +# lib/jsr173_1.0_api.jar +# lib/jaxb-impl.jar +# gen/lib/jaxb-xjc.jar + +# lib/sources/JAXB/jsr173_1.0_src.jar + +rm -rf release/win32-specific + +sed -i '/class-path/I d' manifest-template.mf + +%build + +pushd lib-mnemonics +cp %{SOURCE2} build.xml +ant dist +popd + +cp %{SOURCE3} build.xml +ant dist + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_javadir} +mkdir -p %{buildroot}%{_datadir}/omegat/docs +mkdir -p %{buildroot}%{_datadir}/omegat/images + +install -pm 755 dist/OmegaT.jar %{buildroot}%{_javadir}/OmegaT-%{version}.jar +install -pm 755 lib-mnemonics/dist/lib-mnemonics.jar %{buildroot}%{_javadir}/OmegaT-lib-mnemonics-%{version}.jar + +pushd %{buildroot}%{_javadir} + ln -s OmegaT-%{version}.jar %{buildroot}%{_javadir}/OmegaT.jar + ln -s OmegaT-lib-mnemonics-%{version}.jar %{buildroot}%{_javadir}/OmegaT-lib-mnemonics.jar + ln -s OmegaT-lib-mnemonics-%{version}.jar %{buildroot}%{_javadir}/lib-mnemonics.jar +popd + +cp -pR release/index.html docs/ images/ %{buildroot}%{_datadir}/omegat/ + +install -pm 755 %{SOURCE4} %{buildroot}%{_bindir}/omegat +chmod +x %{buildroot}%{_bindir}/* + +for png in 22x22 16x16; do + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${png}/apps/ + convert -geometry $png images/OmegaT.png %{buildroot}%{_datadir}/icons/hicolor/${png}/apps/omegat.png +done + +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/ +install -pm 644 images/OmegaT.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/omegat.png + +mkdir -p %{buildroot}%{_datadir}/pixmaps +install -pm 644 images/OmegaT.png %{buildroot}%{_datadir}/pixmaps/omegat.png + +mkdir -p %{buildroot}%{_datadir}/applications +desktop-file-install %{SOURCE1} --mode=644 --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/omegat.desktop + +dos2unix -k release/*.txt + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +%{_bindir}/update-desktop-database -q %{_datadir}/applications +touch --no-create %{_datadir}/icons/hicolor + +%postun +if [ $1 -eq 0 ]; then + touch --no-create %{_datadir}/icons/hicolor + %{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || : +fi + +%posttrans +%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || : + +%files +%defattr(-,root,root) +%{_bindir}/omegat +%{_datadir}/applications/omegat.desktop +%{_datadir}/icons/hicolor/*x*/apps/omegat.png +%{_javadir}/OmegaT-%{version}.jar +%{_javadir}/OmegaT.jar +%{_javadir}/OmegaT-lib-mnemonics-%{version}.jar +%{_javadir}/OmegaT-lib-mnemonics.jar +%{_javadir}/lib-mnemonics.jar +%dir %{_datadir}/omegat +%{_datadir}/omegat/*.html +%{_datadir}/omegat/docs +%{_datadir}/omegat/images +%{_datadir}/pixmaps/omegat.png +%doc release/changes.txt release/doc-license.txt +%doc release/license.txt release/readme*.txt release/join.html + +%changelog +* Thu Mar 10 2011 gil 2.2.3-1mamba +- update to 2.2.3 + +* Sun Dec 05 2010 gil 2.0.5-1mamba +- package created by autospec diff --git a/README.md b/README.md index a221339..151f43f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # OmegaT +OmegaT® is a free translation memory application written in Java. +It is a tool intended for professional translators. + +OmegaT® has the following features: + +* Fuzzy matching +* Match propagation +* Simultaneous processing of multiple-file projects +* Simultaneous use of multiple translation memories +* User glossaries with recognition of inflected forms +* Unicode (UTF-8) support: can be used with non-Latin alphabets +* Support for right-to-left languages +* Integral spelling checker +* Compatible with other translation memory applications (TMX) +* Interface to Google Translate + +Document file formats include: +* XHTML and HTML +* Microsoft Office XML +* OpenOffice.org/StarOffice +* XLIFF (Okapi) +* MediaWiki (Wikipedia) +* Plain text + + diff --git a/omegat.desktop b/omegat.desktop new file mode 100644 index 0000000..e4206f9 --- /dev/null +++ b/omegat.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=OmegaT +Exec=omegat +Icon=omegat +Comment=Computer Aid Translation tool +Comment[es]=Herramienta de asistencia a la traducción +Terminal=false +Type=Application +Categories=Development;Translation;Java;Office; +X-AppInstall-Package=omegat \ No newline at end of file