packages: translate-toolkit/translate-toolkit-langmodel_dir.patch (NEW), tr...
glen
glen at pld-linux.org
Mon May 10 12:47:37 CEST 2010
Author: glen Date: Mon May 10 10:47:37 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- new, based on fc
---- Files affected:
packages/translate-toolkit:
translate-toolkit-langmodel_dir.patch (NONE -> 1.1) (NEW), translate-toolkit-stoplist.patch (NONE -> 1.1) (NEW), translate-toolkit.spec (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/translate-toolkit/translate-toolkit-langmodel_dir.patch
diff -u /dev/null packages/translate-toolkit/translate-toolkit-langmodel_dir.patch:1.1
--- /dev/null Mon May 10 12:47:37 2010
+++ packages/translate-toolkit/translate-toolkit-langmodel_dir.patch Mon May 10 12:47:31 2010
@@ -0,0 +1,13 @@
+diff -up translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir translate-toolkit-1.5.0/translate/lang/identify.py
+diff -up translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir translate-toolkit-1.5.0/translate/lang/identify.py
+--- translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir 2009-11-24 16:33:22.000000000 +0200
++++ translate-toolkit-1.5.0/translate/lang/identify.py 2009-11-24 16:34:36.000000000 +0200
+@@ -32,7 +32,7 @@ from ngram import NGram
+
+
+ class LanguageIdentifier(object):
+- MODEL_DIR = get_abs_data_filename('langmodels')
++ MODEL_DIR = '/usr/share/translate-toolkit/langmodels'
+ """The directory containing the ngram language model files."""
+ CONF_FILE = 'fpdb.conf'
+ """
================================================================
Index: packages/translate-toolkit/translate-toolkit-stoplist.patch
diff -u /dev/null packages/translate-toolkit/translate-toolkit-stoplist.patch:1.1
--- /dev/null Mon May 10 12:47:37 2010
+++ packages/translate-toolkit/translate-toolkit-stoplist.patch Mon May 10 12:47:31 2010
@@ -0,0 +1,21 @@
+diff -up translate-toolkit-1.5.3/translate/tools/poterminology.py.stoplist translate-toolkit-1.5.3/translate/tools/poterminology.py
+--- translate-toolkit-1.5.3/translate/tools/poterminology.py.stoplist 2010-01-23 01:18:39.000000000 +0200
++++ translate-toolkit-1.5.3/translate/tools/poterminology.py 2010-02-02 15:35:24.000000000 +0200
+@@ -74,7 +74,7 @@ class TerminologyExtractor(object):
+
+ if stopfile is None:
+ try:
+- stopfile = file_discovery.get_abs_data_filename('stoplist-%s' % self.sourcelanguage)
++ stopfile = '/usr/share/translate-toolkit/stoplist-%s' % self.sourcelanguage
+ except:
+ pass
+ self.stopfile = stopfile
+@@ -457,7 +457,7 @@ def main():
+
+ parser.add_option("-S", "--stopword-list", type="string", metavar="STOPFILE", dest="stopfile",
+ help="read stopword (term exclusion) list from STOPFILE (default %s)" %
+- file_discovery.get_abs_data_filename('stoplist-en'))
++ '/usr/share/translate-toolkit/stoplist-en')
+
+ parser.set_defaults(foldtitle = True, ignorecase = False)
+ parser.add_option("-F", "--fold-titlecase", callback=fold_case_option,
================================================================
Index: packages/translate-toolkit/translate-toolkit.spec
diff -u /dev/null packages/translate-toolkit/translate-toolkit.spec:1.1
--- /dev/null Mon May 10 12:47:37 2010
+++ packages/translate-toolkit/translate-toolkit.spec Mon May 10 12:47:31 2010
@@ -0,0 +1,229 @@
+# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without apidocs # do not build and package API docs
+
+Summary: Tools to assist with translation and software localization
+Name: translate-toolkit
+Version: 1.6.0
+Release: 0.1
+License: GPL v2+
+Group: Development/Tools
+URL: http://translate.sourceforge.net/wiki/toolkit/index
+Source0: http://downloads.sourceforge.net/project/translate/Translate%20Toolkit/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 52e4409e72565bb49e7efad235b4a213
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Patch0: %{name}-stoplist.patch
+Patch1: %{name}-langmodel_dir.patch
+BuildRequires: python-devel
+# The following are needed for man page generation
+BuildRequires: python-lxml
+BuildRequires: python-simplejson
+BuildRequires: python-vobject
+Requires: gettext-libs
+Requires: python-Levenshtein
+Requires: python-enchant
+Requires: python-iniparse
+Requires: python-lxml
+%ifarch %{ix86}
+Requires: python-psyco
+%endif
+Requires: python-simplejson
+Requires: python-vobject
+BuildArch: noarch
+
+%description
+A set of tools for managing translation and software localization via
+Gettext PO or XLIFF format files.
+
+Including:
+- Convertors: convert from various formats to PO or XLIFF
+- Formats:
+ - Core localization formats - XLIFF and Gettext PO
+ - Other localization formats - TMX, TBX, Qt Linguist (.ts), Java
+ .properties, Wordfast TM, OmegaT glossary
+ - Compiled formats: Gettext MO, Qt .qm
+ - Other formats - OpenDocument Format (ODF), text, HTML, CSV, INI,
+ wiki (MediaWiki, DokuWiki), iCal
+ - Specialised - OpenOffice.org GSI/SDF, PHP, Mozilla (.dtd,
+ .properties, etc), Symbian, Innosetup, tikiwiki, subtitles
+- Tools: count, search, debug, segment and pretranslate localization
+ files. Extract terminology. Pseudo-localize
+- Checkers: validate translations with over 45 checks
+
+%package apidocs
+Summary: Development API for translate-toolkit applications
+Group: Documentation
+
+%description apidocs
+Translate Toolkit API documentation for developers wishing to build
+new tools for the toolkit or to use the libraries in other
+localization tools.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install \
+ --optimize=2 \
+ --skip-build \
+ --root $RPM_BUILD_ROOT
+
+# create manpages
+install -d $RPM_BUILD_ROOT%{_mandir}/man1
+for program in $RPM_BUILD_ROOT%{_bindir}/*; do
+ case $(basename $program) in
+ pocompendium|poen|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|lookupclient.py|tmserver|build_tmdb)
+ ;;
+ *)
+ LC_ALL=C PYTHONPATH=. $program --manpage \
+ > $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1 \
+ || rm -f $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1
+ ;;
+ esac
+done
+
+%py_postclean
+
+# remove documentation files from site-packages
+rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/doc
+rm $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/{COPYING,ChangeLog,LICENSE,README}
+rm $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/{convert,filters,tools}/TODO
+rm $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/misc/README
+
+# Move data files to %{_datadir}
+mkdir $RPM_BUILD_ROOT%{_datadir}/translate-toolkit
+mv $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/share/stoplist* $RPM_BUILD_ROOT%{_datadir}/translate-toolkit
+mv $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/share/langmodels $RPM_BUILD_ROOT%{_datadir}/translate-toolkit
+rmdir $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/share
+
+# we don't package tests
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/tools/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/convert/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/filters/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/lang/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/misc/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/search/indexing/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/search/test_*.py
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/storage/placeables/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/storage/test_*.py*
+rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/storage/xml_extract/test_*.py*
+
+# build lang file
+echo "%dir %{py_sitescriptdir}/translate/lang" > %{name}.lang
+for a in $RPM_BUILD_ROOT%{py_sitescriptdir}/translate/lang/*.py[co]; do
+ # path file and lang
+ p=${a#$RPM_BUILD_ROOT} f=${a##*/} l=${f%.py*}
+ case $l in
+ code_or|common|data|factory|identify|__init__|ngram|poedit)
+ echo $p >> %{name}.lang
+ ;;
+ *)
+ echo "%lang($l) $p" >> %{name}.lang
+ ;;
+ esac
+done
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc translate/ChangeLog translate/README
+%doc translate/doc/user/toolkit-[a-z]*
+%attr(755,root,root) %{_bindir}/*
+%{_mandir}/man1/*
+%dir %{_datadir}/translate-toolkit
+
+%{_datadir}/%{name}/langmodels
+%{_datadir}/%{name}/langmodels/README
+%{_datadir}/%{name}/stoplist-en
+%{_datadir}/%{name}/langmodels/fpdb.conf
+
+# TODO: %lang
+%{_datadir}/%{name}/langmodels/afrikaans.lm
+%{_datadir}/%{name}/langmodels/albanian.lm
+%{_datadir}/%{name}/langmodels/arabic.lm
+%{_datadir}/%{name}/langmodels/basque.lm
+%{_datadir}/%{name}/langmodels/belarus.lm
+%{_datadir}/%{name}/langmodels/bosnian.lm
+%{_datadir}/%{name}/langmodels/breton.lm
+%{_datadir}/%{name}/langmodels/catalan.lm
+%lang(zh_CN) %{_datadir}/%{name}/langmodels/chinese_simplified.lm
+%lang(zh_tw) %{_datadir}/%{name}/langmodels/chinese_traditional.lm
+%{_datadir}/%{name}/langmodels/croatian.lm
+%lang(cz) %{_datadir}/%{name}/langmodels/czech.lm
+%lang(da) %{_datadir}/%{name}/langmodels/danish.lm
+%lang(nl) %{_datadir}/%{name}/langmodels/dutch.lm
+%lang(en) %{_datadir}/%{name}/langmodels/english.lm
+%{_datadir}/%{name}/langmodels/esperanto.lm
+%lang(et) %{_datadir}/%{name}/langmodels/estonian.lm
+%lang(fi) %{_datadir}/%{name}/langmodels/finnish.lm
+%lang(fr) %{_datadir}/%{name}/langmodels/french.lm
+%{_datadir}/%{name}/langmodels/frisian.lm
+%lang(de) %{_datadir}/%{name}/langmodels/german.lm
+%lang(el) %{_datadir}/%{name}/langmodels/greek.lm
+%{_datadir}/%{name}/langmodels/hebrew.lm
+%lang(hu) %{_datadir}/%{name}/langmodels/hungarian.lm
+%{_datadir}/%{name}/langmodels/icelandic.lm
+%{_datadir}/%{name}/langmodels/indonesian.lm
+%{_datadir}/%{name}/langmodels/irish_gaelic.lm
+%lang(it) %{_datadir}/%{name}/langmodels/italian.lm
+%lang(ja) %{_datadir}/%{name}/langmodels/japanese.lm
+%lang(sr) %{_datadir}/%{name}/langmodels/latin.lm
+%lang(lv) %{_datadir}/%{name}/langmodels/latvian.lm
+%lang(lt) %{_datadir}/%{name}/langmodels/lithuanian.lm
+%{_datadir}/%{name}/langmodels/malay.lm
+%{_datadir}/%{name}/langmodels/manx_gaelic.lm
+%lang(nb) %{_datadir}/%{name}/langmodels/norwegian.lm
+%lang(po) %{_datadir}/%{name}/langmodels/polish.lm
+%lang(pt) %{_datadir}/%{name}/langmodels/portuguese.lm
+%{_datadir}/%{name}/langmodels/quechua.lm
+%{_datadir}/%{name}/langmodels/romanian.lm
+%{_datadir}/%{name}/langmodels/romansh.lm
+%lang(ru) %{_datadir}/%{name}/langmodels/russian.lm
+%{_datadir}/%{name}/langmodels/scots.lm
+%{_datadir}/%{name}/langmodels/scots_gaelic.lm
+%{_datadir}/%{name}/langmodels/serbian_ascii.lm
+%{_datadir}/%{name}/langmodels/slovak_ascii.lm
+%{_datadir}/%{name}/langmodels/slovenian.lm
+%lang(es) %{_datadir}/%{name}/langmodels/spanish.lm
+%{_datadir}/%{name}/langmodels/swahili.lm
+%lang(sv) %{_datadir}/%{name}/langmodels/swedish.lm
+%{_datadir}/%{name}/langmodels/tagalog.lm
+%{_datadir}/%{name}/langmodels/turkish.lm
+%lang(uk) %{_datadir}/%{name}/langmodels/ukrainian.lm
+%{_datadir}/%{name}/langmodels/vietnamese.lm
+%{_datadir}/%{name}/langmodels/welsh.lm
+
+%dir %{py_sitescriptdir}/translate
+%{py_sitescriptdir}/translate/*.py[co]
+%{py_sitescriptdir}/translate/convert
+%{py_sitescriptdir}/translate/filters
+%{py_sitescriptdir}/translate/misc
+%{py_sitescriptdir}/translate/search
+%{py_sitescriptdir}/translate/services
+%{py_sitescriptdir}/translate/storage
+%{py_sitescriptdir}/translate/tools
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/translate_toolkit-*.egg-info
+%endif
+
+%files apidocs
+%defattr(644,root,root,755)
+%doc translate/doc/api/*
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2010/05/10 10:47:31 glen
+- new, based on fc
================================================================
More information about the pld-cvs-commit
mailing list