File OpenOffice_org-voikko.spec of Package OpenOffice_org-voikko
#
# spec file for package OpenOffice_org-voikko (Version 3.1)
#
# Copyright (c) 2009 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/
#
%define ooo3 %{_libdir}/ooo3
Name: OpenOffice_org-voikko
BuildRequires: OpenOffice_org OpenOffice_org-sdk gcc-c++ java-devel libvoikko-devel unzip update-alternatives zip
Summary: OpenOffice.org spellchecker/hyphenator for finnish language
Version: 3.1
Release: 4
License: GPL
Group: Productivity/Text/Spell
PreReq: OpenOffice_org, coreutils, grep, zip
Provides: locale(OpenOffice_org:fi)
Url: http://voikko.sourceforge.net
Source: openoffice.org-voikko-%{version}.tar.bz2
Patch: openoffice.org-voikko-3.1-link-as-needed.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
OpenOffice.org spellchecker/hyphenator for finnish language, which uses
libvoikko as backend.
%prep
%setup -q -n openoffice.org-voikko-%{version}
%patch
%build
. %{ooo3}/basis-link/sdk/setsdkenv_unix.sh
make oxt
%install
cd build
voikkoPackage=$(pwd)/voikko.oxt
mkdir -p $RPM_BUILD_ROOT/%{ooo3}/voikko
cd $RPM_BUILD_ROOT/%{ooo3}/voikko
unzip "$voikkoPackage"
%post
# remove
if [ $(unopkg list --shared |grep -c "Identifier: org.puimula.ooovoikko") -ne 0 ];then
unopkg remove --shared org.puimula.ooovoikko
fi
# install
if [ -f %{ooo3}/voikko/description.xml ];then
tempdir=`mktemp -d /tmp/voikko-XXXXXX`
cd %{ooo3}/voikko
zip -r -9 $tempdir/voikko-%{version}.oxt * &>/dev/null
unopkg add --shared $tempdir/voikko-%{version}.oxt
rm -rf $tempdir
fi
exit 0
%postun
# remove
if [ $(unopkg list --shared |grep -c "Identifier: org.puimula.ooovoikko") -ne 0 ];then
unopkg remove --shared org.puimula.ooovoikko
fi
# install
if [ -f %{ooo3}/voikko/description.xml ];then
tempdir=`mktemp -d /tmp/voikko-XXXXXX`
cd %{ooo3}/voikko
zip -r -9 $tempdir/voikko-%{version}.oxt * &>/dev/null
unopkg add --shared $tempdir/voikko-%{version}.oxt
rm -rf $tempdir
fi
exit 0
%files
%defattr(-,root,root,0755)
%{ooo3}/voikko
%changelog