File libreoffice-languagetool.spec of Package libreoffice-languagetool.627

#
# spec file for package libreoffice-languagetool
#
# Copyright (c) 2012 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/
#


###################################################################
## DO NOT EDIT THIS SPEC FILE
## Generated by:
## perl lo-languagetool-gen-spec libreoffice-languagetool.spec.in lo-languagetool-data
###################################################################
Name:           libreoffice-languagetool
Version:        1.4
Release:        0
#!BuildIgnore:  libreoffice
%define	        ooo_prefix      %{_libdir}
%define	        ooo_home        libreoffice
# ignore cs because of an unlclear license; also unsupported
# ignore sk unknown license; almost empty dictionary
# ignore uk (unsupported)
%define	        langtool_langs  ca de en es fr gl it km pl nl ro ru sk sv
Summary:        Language Checker for LibreOffice
License:        BSD-2-Clause and BSD-3-Clause and BSD-4-Clause and CC-BY-SA-2.0 and CC-BY-SA-3.0 and GPL-2.0 and GPL-3.0 and LGPL-2.0+ and LGPL-2.1 and LGPL-2.1+ and LGPL-3.0 and MPL-1.1 and SUSE-Public-Domain
Group:          Productivity/Office/Suite
Url:            http://www.languagetool.org/
# svn co https://languagetool.svn.sourceforge.net/svnroot/languagetool languagetool
# cd tags/V_1_4/JLanguageTool
# rm src/resource/cs/{*.dict,*.info}  because of unclear licese; also it is not longer supported (only a bachelor's thesis)
# rm src/resource/uk/{*.dict,*.info}  because of unclear licese
# rm src/resource/ml/{*.dict,*.info}  because of unclear licese
# rm -rf libs/ooo
#    + we use these jars from our libreoffice packages
# FIXME: wanted to remove libs/commons-logging-1.1.1.jar but it was not available on SLED11
#        it is small file (60kB) => it is not worth doing special hacks for SLED11 and other distros
# NOTE: jakarta-regexp-1.4.jar uses the Apache License, v2.0, see http://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-1.4.tar.gz
Source0:        JLanguageTool-%{version}.tar.bz2
# helper files to generate the spec file
Source100:      libreoffice-languagetool.spec.in
Source101:      lo-languagetool-data
Source102:      lo-languagetool-gen-spec
# PATCH-FIX-OPENSUSE ignore dictionaries that are not installed; it allows to package them separately
Patch0:         JLanguageTool-1.4-package-dicts-separately.diff
# PATCH-FIX-OPENSUSE use the system libreoffice jars
Patch1:         JLanguageTool-0.9.3-system-ooo-jars.diff
# do not use the broken help; unopkg complained about it when registering extensions
# FIXME: the right fix is to compile the help and produce the .db_, .ht_, and other files
Patch2:         JLanguageTool-1.4-no-broken-help.diff
BuildRequires:  ant
BuildRequires:  java-devel
BuildRequires:  libreoffice >= 3.5
BuildRequires:  unzip
# dependencies for post install scripts
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       jre >= 1.6
Requires:       libreoffice >= 3.5
# the Czech stuff newer worked; the package was created by mistake
Obsoletes:      OpenOffice_org-LanguageTool-cs < 0.9.9
# compat stuff
Provides:       OpenOffice_org-LanguageTool = %{version}
Obsoletes:      OpenOffice_org-LanguageTool <= %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
This package provides the language checker extension for
LibreOffice. 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
libreoffice-languagetool-<lang> packages.

%package -n libreoffice-languagetool-ca
Summary:        Catalan Dictionary for LibreOffice Language Tool
License:        GPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:ca)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-ca = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-ca <= %{version}

%description -n libreoffice-languagetool-ca
The Catalan dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-de
Summary:        German Dictionary for LibreOffice Language Tool
License:        CC-BY-SA-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:de)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-de = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-de <= %{version}

%description -n libreoffice-languagetool-de
The German dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-en
Summary:        English Dictionary for LibreOffice Language Tool
License:        BSD-3-Clause and BSD-4-Clause and SUSE-Public-Domain
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:en)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-en = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-en <= %{version}

%description -n libreoffice-languagetool-en
The English dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-es
Summary:        Spanish Dictionary for LibreOffice Language Tool
License:        GPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:es)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-es = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-es <= %{version}

%description -n libreoffice-languagetool-es
The Spanish dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-fr
Summary:        French Dictionary for LibreOffice Language Tool
License:        GPL-2.0 and LGPL-2.1 and MPL-1.1
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:fr)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-fr = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-fr <= %{version}

%description -n libreoffice-languagetool-fr
The French dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-gl
Summary:        Galician Dictionary for LibreOffice Language Tool
License:        GPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:gl)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-gl = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-gl <= %{version}

%description -n libreoffice-languagetool-gl
The Galician dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-it
Summary:        Italian Dictionary for LibreOffice Language Tool
License:        CC-BY-SA-2.0 and LGPL-2.0+
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:it)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-it = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-it <= %{version}

%description -n libreoffice-languagetool-it
The Italian dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-km
Summary:        Khmer Dictionary for LibreOffice Language Tool
License:        BSD-2-Clause and CC-BY-SA-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:km)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-km = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-km <= %{version}

%description -n libreoffice-languagetool-km
The Khmer dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-nl
Summary:        Dutch Dictionary for LibreOffice Language Tool
License:        LGPL-2.1+
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:nl)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-nl = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-nl <= %{version}

%description -n libreoffice-languagetool-nl
The Dutch dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-pl
Summary:        Polish Dictionary for LibreOffice Language Tool
License:        LGPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:pl)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-pl = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-pl <= %{version}

%description -n libreoffice-languagetool-pl
The Polish dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-ro
Summary:        Romanian Dictionary for LibreOffice Language Tool
License:        LGPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:ro)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-ro = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-ro <= %{version}

%description -n libreoffice-languagetool-ro
The Romanian dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-ru
Summary:        Russian Dictionary for LibreOffice Language Tool
License:        LGPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:ru)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-ru = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-ru <= %{version}

%description -n libreoffice-languagetool-ru
The Russian dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-sk
Summary:        Slovak Dictionary for LibreOffice Language Tool
License:        LGPL-3.0
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:sk)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-sk = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-sk <= %{version}

%description -n libreoffice-languagetool-sk
The Slovak dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.

%package -n libreoffice-languagetool-sv
Summary:        Swedish Dictionary for LibreOffice Language Tool
License:        LGPL-2.1+
Group:          Productivity/Office/Dictionary
%if 0%{?suse_version} > 01120
Requires(post):   coreutils
Requires(post):   grep
Requires(post):   libreoffice >= 3.5
Requires(postun): coreutils
Requires(postun): grep
Requires(postun): libreoffice >= 3.5
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 01120
PreReq:         coreutils
PreReq:         grep
PreReq:         libreoffice >= 3.5
%endif
Requires:       libreoffice-languagetool = %{version}
Provides:       locale(libreoffice-languagetool:sv)
# compat stuff
Provides:       OpenOffice_org-LanguageTool-sv = %{version}
Obsoletes:      OpenOffice_org-LanguageTool-sv <= %{version}

%description -n libreoffice-languagetool-sv
The Swedish dictionary that can be used to check grammar and other more
complex mistakes using the LibreOffice language tool extension.


%prep
%setup -q -n JLanguageTool-%{version}
%patch0
%patch1
%patch2
cp libs/README libs/README-libs.txt

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

%install
# skip the check for java bytecode version; it uses some jar files prebuilt with JRE-1.6
# can't be complied with JDK-1.5; the dependency on JRE-1.5 is solved at runtime
export NO_BRP_CHECK_BYTECODE_VERSION="true"
# main package
oxt=$(pwd)/dist/LanguageTool-%{version}.oxt
mkdir -p %{buildroot}%{_datadir}/%ooo_home/share/extensions/languagetool-%{version}
cd %{buildroot}%{_datadir}/%ooo_home/share/extensions/languagetool-%{version}
unzip "$oxt"
cd - >/dev/null 2>&1
# dictionaries
for lang in %langtool_langs ; do
    # dir
    mkdir -p %{buildroot}%{_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 %{buildroot}%{_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 %{buildroot}%{_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
# we need to create architecture dependent symlinks even for the main package
# create file list for link-to-ooo-home script
find %{buildroot}%{_datadir}/%ooo_home/share/extensions/languagetool-%{version}/ -type d \
     -printf "%%%%dir %{_datadir}/%ooo_home/share/extensions/languagetool-%{version}/%%P\n" \
     >files-langtool.txt
find %{buildroot}%{_datadir}/%ooo_home/share/extensions/languagetool-%{version}/ -type f \
     -printf "%{_datadir}/%ooo_home/share/extensions/languagetool-%{version}/%%P\n" \
     >>files-langtool.txt
cp files-langtool.txt %{buildroot}%{_datadir}/%ooo_home
echo "%{_datadir}/%ooo_home/files-langtool.txt" >>files-langtool.txt

%clean
rm -rf %{buildroot}

%files -f files-langtool.txt
%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/extensions

%pre
if test -f %{_datadir}/ooo3/share/extension/install/LanguageTool-*.oxt ; then
    # unregister the extension that was added by OOo-LanguageTool and LO packages
    if unopkg list --shared | grep -q "org.openoffice.languagetool.oxt" ; then
        unopkg remove --shared org.openoffice.languagetool.oxt || true;
    fi
    # explain errors if extension that was added by OOo-LanguageTool and OOo packages
    echo
    echo "WARNING: Please ignore the following error about the extension:"
    echo "WARNING:     org.openoffice.languagetool.oxt"
    echo "WARNING: It is printed by the old OpenOffice_org package. The extension cannot"
    echo "WARNING: be unregistered from the OOo cache because unopkg tool already"
    echo "WARNING: works with the LO cache. The LO installation will be correct!"
    echo
fi
# the initial libreoffice packages symlinked the whole directory a wrong way (bnc#677354)
home_path="%ooo_home/share/extensions/languagetool-%{version}"
for link in "/usr/lib/$home_path" "/usr/lib64/$home_path" ; do
    test -L "$link" && rm "$link" || true
done

%post
# link to the directory where the extenisons is automatically detected
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool.txt || true

%posttrans
# update UNO cache for bundled extensions
%{_sbindir}/unopkg-sync-bundled || true

%preun
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool.txt %{_datadir}/%ooo_home/files-langtool.txt.postun || true

%postun
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool.txt.postun 2>/dev/null
# update UNO cache for bundled extensions
%{_sbindir}/unopkg-sync-bundled || true

# ca
%posttrans -n libreoffice-languagetool-ca
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-ca.txt || true

%preun -n libreoffice-languagetool-ca
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-ca.txt %{_datadir}/%ooo_home/files-langtool-ca.txt.postun || true

%postun -n libreoffice-languagetool-ca
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-ca.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-ca.txt.postun 2>/dev/null

# de
%posttrans -n libreoffice-languagetool-de
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-de.txt || true

%preun -n libreoffice-languagetool-de
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-de.txt %{_datadir}/%ooo_home/files-langtool-de.txt.postun || true

%postun -n libreoffice-languagetool-de
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-de.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-de.txt.postun 2>/dev/null

# en
%posttrans -n libreoffice-languagetool-en
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-en.txt || true

%preun -n libreoffice-languagetool-en
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-en.txt %{_datadir}/%ooo_home/files-langtool-en.txt.postun || true

%postun -n libreoffice-languagetool-en
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-en.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-en.txt.postun 2>/dev/null

# es
%posttrans -n libreoffice-languagetool-es
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-es.txt || true

%preun -n libreoffice-languagetool-es
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-es.txt %{_datadir}/%ooo_home/files-langtool-es.txt.postun || true

%postun -n libreoffice-languagetool-es
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-es.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-es.txt.postun 2>/dev/null

# fr
%posttrans -n libreoffice-languagetool-fr
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-fr.txt || true

%preun -n libreoffice-languagetool-fr
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-fr.txt %{_datadir}/%ooo_home/files-langtool-fr.txt.postun || true

%postun -n libreoffice-languagetool-fr
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-fr.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-fr.txt.postun 2>/dev/null

# gl
%posttrans -n libreoffice-languagetool-gl
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-gl.txt || true

%preun -n libreoffice-languagetool-gl
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-gl.txt %{_datadir}/%ooo_home/files-langtool-gl.txt.postun || true

%postun -n libreoffice-languagetool-gl
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-gl.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-gl.txt.postun 2>/dev/null

# it
%posttrans -n libreoffice-languagetool-it
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-it.txt || true

%preun -n libreoffice-languagetool-it
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-it.txt %{_datadir}/%ooo_home/files-langtool-it.txt.postun || true

%postun -n libreoffice-languagetool-it
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-it.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-it.txt.postun 2>/dev/null

# km
%posttrans -n libreoffice-languagetool-km
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-km.txt || true

%preun -n libreoffice-languagetool-km
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-km.txt %{_datadir}/%ooo_home/files-langtool-km.txt.postun || true

%postun -n libreoffice-languagetool-km
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-km.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-km.txt.postun 2>/dev/null

# nl
%posttrans -n libreoffice-languagetool-nl
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-nl.txt || true

%preun -n libreoffice-languagetool-nl
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-nl.txt %{_datadir}/%ooo_home/files-langtool-nl.txt.postun || true

%postun -n libreoffice-languagetool-nl
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-nl.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-nl.txt.postun 2>/dev/null

# pl
%posttrans -n libreoffice-languagetool-pl
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-pl.txt || true

%preun -n libreoffice-languagetool-pl
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-pl.txt %{_datadir}/%ooo_home/files-langtool-pl.txt.postun || true

%postun -n libreoffice-languagetool-pl
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-pl.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-pl.txt.postun 2>/dev/null

# ro
%posttrans -n libreoffice-languagetool-ro
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-ro.txt || true

%preun -n libreoffice-languagetool-ro
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-ro.txt %{_datadir}/%ooo_home/files-langtool-ro.txt.postun || true

%postun -n libreoffice-languagetool-ro
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-ro.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-ro.txt.postun 2>/dev/null

# ru
%posttrans -n libreoffice-languagetool-ru
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-ru.txt || true

%preun -n libreoffice-languagetool-ru
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-ru.txt %{_datadir}/%ooo_home/files-langtool-ru.txt.postun || true

%postun -n libreoffice-languagetool-ru
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-ru.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-ru.txt.postun 2>/dev/null

# sk
%posttrans -n libreoffice-languagetool-sk
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-sk.txt || true

%preun -n libreoffice-languagetool-sk
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-sk.txt %{_datadir}/%ooo_home/files-langtool-sk.txt.postun || true

%postun -n libreoffice-languagetool-sk
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-sk.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-sk.txt.postun 2>/dev/null

# sv
%posttrans -n libreoffice-languagetool-sv
%{_datadir}/%ooo_home/link-to-ooo-home %{_datadir}/%ooo_home/files-langtool-sv.txt || true

%preun -n libreoffice-languagetool-sv
test "$1" = "0" && cp %{_datadir}/%ooo_home/files-langtool-sv.txt %{_datadir}/%ooo_home/files-langtool-sv.txt.postun || true

%postun -n libreoffice-languagetool-sv
test "$1" = "0" && %{_datadir}/%ooo_home/link-to-ooo-home --unlink %{_datadir}/%ooo_home/files-langtool-sv.txt.postun || true
rm -f %{_datadir}/%ooo_home/files-langtool-sv.txt.postun 2>/dev/null

%files -f files-langtool-ca.txt -n libreoffice-languagetool-ca
%defattr(-,root,root)
%doc src/resource/ca/README

%files -f files-langtool-de.txt -n libreoffice-languagetool-de
%defattr(-,root,root)
%doc src/resource/de/{errors.txt,tagset.txt}

%files -f files-langtool-en.txt -n libreoffice-languagetool-en
%defattr(-,root,root)
%doc src/resource/en/{12dicts-readme.html,agid-readme.txt,errors.txt,pos-readme.txt}

%files -f files-langtool-es.txt -n libreoffice-languagetool-es
%defattr(-,root,root)
%doc src/resource/es/{README,README.cvs}

%files -f files-langtool-fr.txt -n libreoffice-languagetool-fr
%defattr(-,root,root)
%doc src/resource/fr/README_lexique.txt

%files -f files-langtool-gl.txt -n libreoffice-languagetool-gl
%defattr(-,root,root)
%doc src/resource/gl/{LICENSE,README,README.cvs}

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

%files -f files-langtool-km.txt -n libreoffice-languagetool-km
%defattr(-,root,root)
%doc src/resource/km/README.txt

%files -f files-langtool-nl.txt -n libreoffice-languagetool-nl
%defattr(-,root,root)

%files -f files-langtool-pl.txt -n libreoffice-languagetool-pl
%defattr(-,root,root)

%files -f files-langtool-ro.txt -n libreoffice-languagetool-ro
%defattr(-,root,root)

%files -f files-langtool-ru.txt -n libreoffice-languagetool-ru
%defattr(-,root,root)

%files -f files-langtool-sk.txt -n libreoffice-languagetool-sk
%defattr(-,root,root)
%doc src/resource/sk/README

%files -f files-langtool-sv.txt -n libreoffice-languagetool-sv
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by