File virtaal.spec of Package virtaal
#
# spec file for virtaal (Version 0.6.1)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: virtaal
Version: 0.6.1
Release: 1
License: GPLv2+
Summary: Translation Tool
Url: http://translate.sourceforge.net/wiki/virtaal/index
Group: Development/Tools/Other
Source: %{name}-%{version}.tar.bz2
Source1: %{name}.desktop
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python-devel
BuildRequires: licenses
BuildRequires: python-lxml-doc
BuildRequires: translate-toolkit >= 1.5.3
BuildRequires: update-desktop-files
BuildRequires: python-curl >= 7.19.0
BuildRequires: gtk2
BuildRequires: python-gtk
BuildRequires: libtranslate0
BuildRequires: libglade2
Requires: %{name}-lang = %{version}
# Requires: libcurl4 >= 7.19.0
Requires: python-curl >= 7.19.0
Requires: translate-toolkit >= 1.5.3
#Requires: python-gtk
Requires: python-gobject2
Requires: python-lxml
Requires: gtkspell
Requires: licenses
Requires: python-gnome-extras
# psyco doesn't build on python 2.7
%if 0%{?suse_version} <= 1130
%ifarch %{ix86}
Requires: python-psyco
%endif
%endif
Requires: python-Levenshtein
Requires: python-psycopg2
Requires: python-simplejson
Requires: xdg-utils
%{py_requires}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%lang_package
%description
A program for Computer Aided Translation (CAT) and localization.
Virtaal includes features that allow a localizer to work effectively including:
syntax highlighting, autocomplete and autocorrect. By showing only
the data that is needed through its simple and effective user interface it
ensures that translators can focus on their current translation task.
A rich set of Translation Memory (TM) plugins provide valuable suggestions to
the translator from sources such as Open-Tran.eu, the current file, and the
translators own TM server. Similarly Machine Translation (MT) suggestions can
come from Apertium, libtranslate, Google and Moses.
The terminology plugin system will provide terminology hints from Open-Tran.eu,
local terminology files and remote terminology repositories.
Placeholders such as variables, abbreviations, URLs, emails and special
punctutions are highlighted for easy insertion into the translations.
Virtaal is able to edit any of the following formats: XLIFF, Gettext PO and
.mo, Qt .ts, .qph and .qm, Wordfast TM, TMX, OmegaT glossaries and TBX. The
Translate Toolkit converters allow translators to edit: OpenDocument
Format (ODF), OpenOffice.org SDF, Java (and Mozilla) .properties, Mozilla
DTD files, subtitles, and other formats.
%prep
%setup -q
%build
%{__python} setup.py build
# Build the translations
./maketranslations %{name}
pushd po
for po in $(ls *.po | egrep -v de_DE)
do
mkdir -p locale/$(basename $po .po)/LC_MESSAGES/
msgfmt $po --output-file=locale/$(basename $po .po)/LC_MESSAGES/%{name}.mo
done
popd
%install
# Avoid duplication of license files as explained in http://en.opensuse.org/Licenses
for FILE in COPYING LICENSE ; do
MD5SUM=$(md5sum $FILE | sed 's/ .*//')
if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
fi
done
%{__python} setup.py install \
--prefix=%{_prefix} \
--root=%{buildroot} \
# Install .desktop file and app icon
mkdir -p %{buildroot}%{_datadir}/pixmaps/
mv %{buildroot}%{_datadir}/icons/%{name}.png %{buildroot}%{_datadir}/pixmaps
%suse_update_desktop_file -r %{name} Development Translation
pushd %{buildroot}%{_datadir}/icons/hicolor
for size in $(ls -d *)
do
pushd $size/mimetypes
ext=png
if [ "$size" == "scalable" ]; then
ext=svg
fi
for mimetype in \
text-x-gettext-translation \
text-x-gettext-translation-template \
application-x-xliff+xml application-x-xliff \
text-x-wordfast
do
ln -s x-translation.$ext $mimetype.$ext
done
popd
done
popd
cp -a po/locale %{buildroot}%{_datadir}/
# Temporary fix
sed -i 's/\r//' %{buildroot}%{python_sitelib}/virtaal/support/libi18n/locale.py
# Delete unnecessary files (inc translations not shipped)
rm -r %{buildroot}%{_datadir}/virtaal/autocorr
rm -r %{buildroot}%{_datadir}/locale/{ak,en_ZA,son,ast,sw}
%find_lang %{name}
# create symlinks for man pages
%fdupes -s $RPM_BUILD_ROOT/%_mandir
# create hardlinks for the rest
%fdupes $RPM_BUILD_ROOT
%clean
rm -rf %{buildroot}
%files lang -f %{name}.lang
%files
%defattr(-,root,root)
%doc ChangeLog README LICENSE
%{_bindir}/virtaal
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/applications/virtaal.desktop
%{_datadir}/icons/virtaal.ico
%{_datadir}/icons/x-translation.ico
%{_datadir}/mime/packages/virtaal-mimetype.xml
%{_datadir}/pixmaps/virtaal.png
%{_datadir}/virtaal/
%{python_sitelib}/virtaal/
%{python_sitelib}/virtaal-%{version}-py%{py_ver}.egg-info
%changelog