File OpenOffice_org-LanguageTool.spec of Package OpenOffice_org-LanguageTool

#
# spec file for package OpenOffice_org-LanguageTool (Version 0.9.3)
#
# Copyright (c) 2008 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:           OpenOffice_org-LanguageTool
Version:        0.9.3
Release:        1
BuildRequires:  OpenOffice_org-ure ant java-devel
#!BuildIgnore:  OpenOffice_org
%define	        ooo_prefix	%_libdir
%define	        ooo_home		ooo3
# ignore cs because of an unlclear license; also unsupported
# ignore ru (empty dictionary, unsupported)
# ignore uk (unsupported)
%define	        langtool_langs  de en es fr it nl pl sv
License:        BSD 3-Clause; BSD 4-Clause; LGPL v2.0 or later; LGPL v2.1 or later; Other uncritical OpenSource License; Public Domain, Freeware; The Apache Software License
Group:          Productivity/Office/Suite
AutoReqProv:    on
PreReq:         OpenOffice_org >= 2.99
Requires:       OpenOffice_org >= 2.99
Summary:        Language Checker for OpenOffice.org
Url:            http://www.languagetool.org/
# cvs -z3 -d:pserver:anonymous@languagetool.cvs.sourceforge.net:/cvsroot/languagetool co -r V_0_9_3 -P JLanguageTool
# rm src/resource/cs/{*.dict,*.info}  because of unclear licese; also it is not longer supported (only a bachelor's thesis)
# the missing src/resource/en/english_synth.dict taken from the prebuilt LanguageTool-0.9.3.oxt (was not tagged in cvs or so)
Source0:        JLanguageTool-0.9.3.tar.bz2
# helper script and data file to create pieces of the spec file
Source100:      ooo-LanguageTool-data
Source101:      ooo-LanguageTool-gen-spec
Patch0:         JLanguageTool-0.9.3-package-dicts-separately.diff
Patch1:         JLanguageTool-0.9.3-system-ooo-jars.diff
Patch2:         JLanguageTool-0.9.3-find-junit-jar.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
This package provides the language checker extension for
OpenOffice.org. It allows to detect errors that a simple spell checker
cannot detect, e.g. mixing up there/their, no/now etc. It can also
detect some grammar mistakes. It does not include spell checking.

The language checker uses special dictionaries that are provided by the
OpenOffice_org-LanguageTool-<lang> packages.



%package -n OpenOffice_org-LanguageTool-de
License:        Other uncritical OpenSource License
Summary:        German Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:de)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-de
The German dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-en
License:        BSD 3-Clause; BSD 4-Clause; Public Domain, Freeware
Summary:        English Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:en)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-en
The English dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-es
License:        LGPL v2.0 or later
Summary:        Spanish Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:es)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-es
The Spanish dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-fr
License:        LGPL v2.0 or later
Summary:        French Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:fr)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-fr
The French dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-it
License:        LGPL v2.0 or later
Summary:        Italian Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:it)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-it
The Italian dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-nl
License:        LGPL v2.0 or later
Summary:        Dutch Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:nl)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-nl
The Dutch dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-pl
License:        LGPL v2.0 or later
Summary:        Polish Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:pl)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-pl
The Polish dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%package -n OpenOffice_org-LanguageTool-sv
License:        LGPL v2.1 or later
Summary:        Swedish Dictionary for OpenOffice.org Language Tool
Group:          Productivity/Office/Dictionary
Provides:       locale(OpenOffice_org-LanguageTool:sv)
PreReq:         OpenOffice_org-ure >= 2.99
Requires:       OpenOffice_org-LanguageTool

%description -n OpenOffice_org-LanguageTool-sv
The Swedish dictionary that can be used to check grammar and other more
complex mistakes using the OpenOffice.org language tool extension.



%prep
%setup -q -n JLanguageTool-%version
%patch0
%patch1
%patch2

%build
ant -Dsys.ooo.dir=%{_libdir}/%ooo_home dist

%install
# main package
mkdir -p $RPM_BUILD_ROOT%_datadir/%ooo_home/share/extension/install
cp dist/LanguageTool-%version.oxt $RPM_BUILD_ROOT%_datadir/%ooo_home/share/extension/install
# dictionaries
for lang in %langtool_langs ; do
    # dir
    mkdir -p $RPM_BUILD_ROOT%_datadir/%ooo_home/ure/lib/resource/$lang
    echo "%dir %_datadir/%ooo_home" >files-langtool-$lang.txt
    echo "%dir %_datadir/%ooo_home/ure" >>files-langtool-$lang.txt
    echo "%dir %_datadir/%ooo_home/ure/lib" >>files-langtool-$lang.txt
    echo "%dir %_datadir/%ooo_home/ure/lib/resource" >>files-langtool-$lang.txt
    echo "%dir %_datadir/%ooo_home/ure/lib/resource/$lang" >>files-langtool-$lang.txt
    # files
    for file in src/resource/$lang/{*.dict,*.info} ; do
	filename=${file#src/resource/$lang/}
	cp $file $RPM_BUILD_ROOT%_datadir/%ooo_home/ure/lib/resource/$lang/$filename
	echo "%_datadir/%ooo_home/ure/lib/resource/$lang/$filename" >>files-langtool-$lang.txt
    done
    cp files-langtool-$lang.txt $RPM_BUILD_ROOT%_datadir/%ooo_home
    echo "%_datadir/%ooo_home/files-langtool-$lang.txt" >>files-langtool-$lang.txt
    # common README.txt
    echo "%doc README.txt" >>files-langtool-$lang.txt
done

%clean
#rm -rf $RPM_BUILD_ROOT

%pre
if test $1 = 2 ; then
    echo "Unregistering the older LangTool extension from OpenOffice.org..."
    unopkg remove --shared org.openoffice.languagetool.oxt || true;
fi

%post
echo "Registering the LangTool extension in OpenOffice.org..."
unopkg add --shared %_datadir/%ooo_home/share/extension/install/LanguageTool-%version.oxt || true;

%preun 
if test $1 = 0 ; then
    echo "Unregistering the LangTool extension from OpenOffice.org..."
    unopkg remove --shared org.openoffice.languagetool.oxt || true;
fi

%files
%defattr(-,root,root)
%doc CHANGES.txt COPYING.txt README.txt libs/*.txt libs/build/junit-license.txt
%dir %_datadir/%ooo_home
%dir %_datadir/%ooo_home/share
%dir %_datadir/%ooo_home/share/extension
%dir %_datadir/%ooo_home/share/extension/install
%_datadir/%ooo_home/share/extension/install/LanguageTool-%version.oxt
########################################################
# Start of a section generated by ooo-langtool-gen-spec
# Do not edit!
########################################################
#
# langtool dictionaries
#
# de
%posttrans -n OpenOffice_org-LanguageTool-de
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-de.txt || true

%preun -n OpenOffice_org-LanguageTool-de
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-de.txt || true
# en
%posttrans -n OpenOffice_org-LanguageTool-en
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-en.txt || true

%preun -n OpenOffice_org-LanguageTool-en
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-en.txt || true
# es
%posttrans -n OpenOffice_org-LanguageTool-es
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-es.txt || true

%preun -n OpenOffice_org-LanguageTool-es
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-es.txt || true
# fr
%posttrans -n OpenOffice_org-LanguageTool-fr
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-fr.txt || true

%preun -n OpenOffice_org-LanguageTool-fr
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-fr.txt || true
# it
%posttrans -n OpenOffice_org-LanguageTool-it
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-it.txt || true

%preun -n OpenOffice_org-LanguageTool-it
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-it.txt || true
# nl
%posttrans -n OpenOffice_org-LanguageTool-nl
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-nl.txt || true

%preun -n OpenOffice_org-LanguageTool-nl
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-nl.txt || true
# pl
%posttrans -n OpenOffice_org-LanguageTool-pl
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-pl.txt || true

%preun -n OpenOffice_org-LanguageTool-pl
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-pl.txt || true
# sv
%posttrans -n OpenOffice_org-LanguageTool-sv
%_datadir/%ooo_home/link-to-ooo-home %_datadir/%ooo_home/files-langtool-sv.txt || true

%preun -n OpenOffice_org-LanguageTool-sv
test "$1" = "0" && %_datadir/%ooo_home/link-to-ooo-home --unlink %_datadir/%ooo_home/files-langtool-sv.txt || true
#
# langtool dictionaries
#

%files -f files-langtool-de.txt -n OpenOffice_org-LanguageTool-de
%defattr(-,root,root)
%doc src/resource/de/errors.txt

%files -f files-langtool-en.txt -n OpenOffice_org-LanguageTool-en
%defattr(-,root,root)
%doc src/resource/en/{12dicts-readme.html,agid-readme.txt,errors.txt,filter-minus.txt,manually_added.txt,pos-readme.txt}

%files -f files-langtool-es.txt -n OpenOffice_org-LanguageTool-es
%defattr(-,root,root)

%files -f files-langtool-fr.txt -n OpenOffice_org-LanguageTool-fr
%defattr(-,root,root)
%doc src/resource/fr/readme.txt

%files -f files-langtool-it.txt -n OpenOffice_org-LanguageTool-it
%defattr(-,root,root)
%doc src/resource/it/readme-morph-it.txt

%files -f files-langtool-nl.txt -n OpenOffice_org-LanguageTool-nl
%defattr(-,root,root)

%files -f files-langtool-pl.txt -n OpenOffice_org-LanguageTool-pl
%defattr(-,root,root)

%files -f files-langtool-sv.txt -n OpenOffice_org-LanguageTool-sv
%defattr(-,root,root)
######################################################
# End of a section generated by ooo-langtool-gen-spec
######################################################
%changelog
* Mon Sep 22 2008 pmladek@suse.cz
- package created, version 0.9.3 (fate#304616, fate#304618, fate#304619,
  fate#304620, fate#304621)
openSUSE Build Service is sponsored by