%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: translate-toolkit
Version: 1.7.0
Release: 1%{?dist}
Summary: Tools to assist with translation and software localization
Group: Development/Tools
License: GPLv2+
URL: http://translate.sourceforge.net/wiki/toolkit/index
Source0: http://downloads.sourceforge.net/project/translate/Translate%20Toolkit/%{version}/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Fedora patches
Patch0: translate-toolkit-1.5.3-stoplist.patch
Patch1: translate-toolkit-1.5.0-langmodel_dir.patch
# EL patches
BuildArch: noarch
BuildRequires: python-devel
# The following are needed for man page generation
# gaupol not packaged for EL-5, sub2po not available
#BuildRequires: gaupol
BuildRequires: python-iniparse
BuildRequires: python-lxml
BuildRequires: python-simplejson
# python-vobject is not packaged for EL-5
#BuildRequires: python-vobject
# EL-5 has gettext = 0.14.6. cPO and new fPO need libgettextpo which was introduced in
# 0.14.2. Some of the improvements since then won't work
Requires: gettext
# python-enchant is not yet built for EL-5, spell checking tests will be unavailable
#Requires: python-enchant
Requires: python-iniparse
Requires: python-Levenshtein
Requires: python-lxml
# python-psyco is not packaged for EL-5
#Requires: python-psyco
Requires: python-simplejson
# python-vobject is not packaged for EL-5, ical2po is unavailable
#Requires: python-vobject
%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 devel
Summary: Development API for %{name} applications
Group: Development/Tools
License: GPLv2+
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains 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 -b .stoplist
%patch1 -p1 -b .langmodel_dir
%build
%{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
# Cleanup some applications that won't work because of missing dependencies
rm $RPM_BUILD_ROOT/%{_bindir}/{ical2po,po2ical,sub2po,po2sub}
# create manpages
mkdir -p $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|\
junitmsgfmt)
;;
*)
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
# remove documentation files from site-packages
rm -r $RPM_BUILD_ROOT/%{python_sitelib}/translate/doc
rm $RPM_BUILD_ROOT/%{python_sitelib}/translate/{COPYING,ChangeLog,LICENSE,README}
rm $RPM_BUILD_ROOT/%{python_sitelib}/translate/{convert,filters,tools}/TODO
rm $RPM_BUILD_ROOT/%{python_sitelib}/translate/misc/README
# Move data files to /usr/share
mkdir $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit
mv $RPM_BUILD_ROOT/%{python_sitelib}/translate/share/stoplist* $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit
mv $RPM_BUILD_ROOT/%{python_sitelib}/translate/share/langmodels $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit
rmdir $RPM_BUILD_ROOT/%{python_sitelib}/translate/share
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc translate/ChangeLog translate/COPYING translate/README
%doc translate/doc/user/toolkit-[a-z]*
%{_bindir}/*
%{_mandir}/man1/*
%{_datadir}/translate-toolkit
%{python_sitelib}/translate*
%files devel
%defattr(-,root,root,-)
%doc translate/doc/api/*
%changelog
* Thu May 13 2010 Dwayne Bailey <dwayne@translate.org.za> - 1.7.0-1
- Update to 1.7.0
- Support for Array constructs in the PHP converter
- Detect the target language from the PO team header
- Improvements in detecting languages for many other formats
- Correctly migrate the header comments from the old PO file in pot2po
- Handle certain malformed PO files better
- Reliability improvements for Qt TS and XLIFF
- Support for longer terminology entries
- New plural information: Sinhala (si), Aragonese (an),
Catalan (Valencia) (ca@valencia), Romansh (rm), Tatar (tt)
- Some language specific customisations for Sinhala and Thai.
- New: junitmsgfmt, runs msgfmt and provides junit-type output for use
in continuous integration systems such as Hudson.
- Reliability improvements for Lucene when Pootle is under Apache
- Correctly use the header encoding when opening .mo files
- Avoid adding an extra type comment line (#,) (bug 1400)
- Support any delimiter (=, : or space) in po2prop as we do in prop2po
- Better handling of non-default encodings for .rc files
* Fri Mar 19 2010 Dwayne Bailey <dwayne@translate.org.za> - 1.6.0-1
- Update to 1.6.0
- Improvements to quality tests for speed and accuracy
- Improvements to language specific quality checks
- Small improvements to the handling of incorrect PO files
- Better support for the newer comment types in TS
- Several small improvements and corrections to XLIFF and TS
- Many API improvements and cleanups for the upcoming Pootle and Virtaal
- Fix a bug when Virtaal opened files in paths with non-ASCII characters
- The Toolkit now always creates headers for PO files
- A better XML placeable with support for XML namespaces
- A small bug with a single space unit as seen in abrt (bug 1370). This
also fixes the resulting error in Virtaal.
- Update to 1.5.3
- Plural information for more languages
- Cleaner language names (for the benefit of Pootle and Virtaal)
- Skype support for prop2po and po2prop [by Filip Miletić]
- Small improvement to Qt .ts support
- Other small bugfixes
- Redo stoplist patch
- Update to 1.5.2
- Initial support for '#' type comments in the PHP converters (#1298)
- Reliability improvements for Pootle concerning Xapian and Python 2.4
- A small fix affecting searching in Virtaal
- Classify XML tags as editable placeables for Virtaal (#1287)
- Correctly handle language codes with '@' in them (like ca@valencia)
- Don't unnecessarily add empty 'note' nodes in XLIFF (#1319)
- Allow for the translation of 'title' attributes in XML (#1294)
- Drop LRU patch
* Thu Nov 26 2009 Dwayne Bailey <dwayne@translate.org.za> - 1.5.1-2
- Make lru.py exception handling work in Python 2.4
* Thu Nov 26 2009 Dwayne Bailey <dwayne@translate.org.za> - 1.5.1-1
- Update to 1.5.1
- Support for OmegaT glossary files
- Fixes for the fast (but still experimental) C PO parser
- Fixes for the LRU cache
- Fixes for correct and faster language identification
- Update to 1.5.0
- The tmserver will now be multithreaded if cherrypy is installed
- New faster PO parser for testing
- Optionally preserve HTML comments in html2po. Bug #1183
- Many reliability and API improvements for the upcoming versions of Pootle and Virtaal
- Move langmodels into /usr/share/translate-toolkit
- Update to 1.4.1
- Better support for printf (including numbered) variables (bug 1118)
- Fixes for the upcoming Pootle, including combined searches (bug 1036)
- subtle bug in tmserver handling of the percent sign (%) (bug 1101)
- obsolete messages seen as translatable (bug 1114)
- Update to 1.4.0 final
- Remove old excludes for /usr/bin/*.py{o,c}
- Refresh poterminology patch
- Rebuild using %%{ix86} instead of i386
* Mon Nov 17 2008 Dwayne Bailey <dwayne@translate.org.za> - 1.2.0-2
- Remove dependeny: python-enchant
* Sun Nov 16 2008 Dwayne Bailey <dwayne@translate.org.za> - 1.2.0-1
- Update to 1.2.0
- Patch poterminology to read stoplist-en from /usr/share/
- Add devel package to include generated Translate Toolkit API documentation
- Add dependencies: python-iniparse, python-Levenshtein, python-lxml,
- Drop iCal support
* Thu Nov 09 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.10.1-1
- Update to upstream 0.10.1
- Cleanup based on latest Python packaging guidelines
* Wed Nov 08 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-2
- Rebuild to get into Rawhide
* Mon Feb 20 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-1
- Update to final 0.8
* Sun Feb 19 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.10.rc6
- Fix a typo in po2dtd that made po2moz fail
* Tue Feb 14 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.9.rc6
- Rebuild for Fedora Extras 5
* Tue Feb 07 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.8.rc6
- Require python-enchant for spellchecking support in pofilter
* Sat Feb 04 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.7.rc6
- Rebuild
* Sat Feb 04 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.6.rc6
- Update to 0.8rc6
* Sat Jan 21 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.5.rc5
- Use sed instead of dos2unix
* Mon Jan 09 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.4.rc5
- Own forgotten subdirectories
* Mon Jan 09 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.3.rc5
- Fix the jToolkit requirement
* Sun Jan 08 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.2.rc5
- Add %%{?dist} tag
* Sat Jan 07 2006 Roozbeh Pournader <roozbeh@farsiweb.info> - 0.8-0.1.rc5
- Initial packaging