Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > by-pkgid > ec17dd363b618fda75bdbf8241b136ce > files > 2

openoffice.org-voikko-1.1-2.1mdv2007.1.src.rpm


%define srcname	openoffice.org
%define ooname	%srcname
%define unopkg	%{_libdir}/%{ooodir}/program/unopkg
%define binpkg	%nil
%define ooodir	ooo-2.0

# This is a hack, but we have to follow openoffice.org.spec naming
%ifarch x86_64
%define ooname %{srcname}64
%define ooodir	ooo-2.0_64
%define binpkg -n %{binname}
%endif

%define binname	%{ooname}-voikko
%define name	%{srcname}-voikko
%define tarname	oo2-voikko
%define version	1.1
%define release	2
%define subrel 1

%ifarch %ix86
%define unopkgname	oo2-voikko-Linux_x86-%version.uno.pkg
%else
%define unopkgname	oo2-voikko-Linux_%_arch-%version.uno.pkg
%endif

%define ooo_version	%(rpm -q --qf '%%{version}' %{ooname}-devel 2>/dev/null)

# NOTE: There is a duplicate package section below for openoffice.org64 naming
#       hack.

Summary:	Finnish spellchecker and hyphenator for OpenOffice.org
Name:		%name
Version:	%version
Release:	%mkrel %release
ExcludeArch: x86_64
License:	LGPL
Group:		Office
URL:		http://www.hunspell-fi.org/
Source:		http://www.hunspell-fi.org/files/%tarname-%version.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-root
BuildRequires:	%ooname-devel
BuildRequires:	zip
BuildRequires:	voikko-devel
Requires:	locales-fi
# Binaries are hidden inside a zip, so automatic dependencies don't work
Requires:	%{mklibname voikko 1}
Requires:	voikko-dictionary
Requires:	%ooname = %ooo_version
Requires(pre):	%ooname = %ooo_version
Requires(post):	%ooname = %ooo_version
Requires(preun):	%ooname = %ooo_version

%description
Finnish spellchecker and hyphenator component for OpenOffice.org.

Usually Voikko is automatically activated after the installation. If
that won't happen, you can manually activate it from the Writing
Aids section of the OpenOffice.org options.

%package -n openoffice.org64-voikko
Summary:        Finnish spellchecker and hyphenator for OpenOffice.org
Group:		Office
Requires:       locales-fi
# Binaries are hidden inside a zip, so automatic dependencies don't work
Requires:       %{mklibname voikko 1}
Requires:       voikko-dictionary
Requires:       %ooname = %ooo_version
Requires(pre):  %ooname = %ooo_version
Requires(preun):        %ooname = %ooo_version

%description -n openoffice.org64-voikko
Finnish spellchecker and hyphenator component for OpenOffice.org.

Usually Voikko is automatically activated after the installation. If
that won't happen, you can manually activate it from the Writing
Aids section of the OpenOffice.org options.

%prep
%setup -q -n unopkg

%build
# Calling setsdkenv_unix requires user input, so we use the
# setsdkenv_unix.sh which appears to be preset correctly.
# However, it doesn't seem to be exporting the variables properly
# so we source it and set shell options temporarily to normal
# behaviour. HOME is reset, as setsdkenv_unix.sh sets some output
# path to $HOME.
set +xe
HOME=$(pwd) . %{_libdir}/%{ooodir}/sdk/setsdkenv_unix.sh
set -xe

# Build fails otherwise
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_libdir}/%{ooodir}/program

%make

%install
rm -rf %{buildroot}

install -d -m755 %{buildroot}%{_libdir}/%{name}
install -m644 build/%{unopkgname} %{buildroot}%{_libdir}/%{name}

%clean
rm -rf %{buildroot}

%pre %binpkg
if ! [ -x %unopkg ]; then
	echo "ERROR: Compatible version of OpenOffice.org is not installed, aborting the"
	echo "       installation or upgrade of oo2-voikko!"
	exit 1
fi

%posttrans %binpkg
if [ -x %unopkg ]; then
	for pkg in $(%unopkg list --shared 2>/dev/null | sed -ne 's/^Name: \(oo2-voikko.*\)/\1/p'); do
		%unopkg remove --shared $pkg
	done
	%unopkg add --shared %{_libdir}/%{name}/%{unopkgname}
fi

%preun %binpkg
if [ -x %unopkg ]; then
	%unopkg remove --shared %{unopkgname}
fi

%files %binpkg
%defattr(-,root,root)
%doc COPYING.gpl
%{_libdir}/%{name}


%changelog
* Sun Jan 14 2007 Anssi Hannula <anssi@mandriva.org> 1.1-2.1mdv2007.1
+ Revision: 108610
- do not build x86_64 as 64-bit OOo does not exist in 2007.0
- rebuild for new openoffice.org
- import to updates tree
- Import openoffice.org-voikko



* Fri Sep 15 2006 Anssi Hannula <anssi@mandriva.org> 1.1-2mdv2007.0
- change ooodir to match latest openoffice.org on x86_64

* Sat Sep 02 2006 Anssi Hannula <anssi@mandriva.org> 1.1-1mdv2007.0
- 1.1 (bugfixes)

* Fri Sep 01 2006 Anssi Hannula <anssi@mandriva.org> 1.0-4mdv2007.0
- more robust update handling with posttrans

* Fri Aug 25 2006 Anssi Hannula <anssi@mnadriva.org> 1.0-3mdv2007.0
- report correct src.rpm name on x86_64
- fix no-documentation

* Wed Aug 23 2006 Anssi Hannula <anssi@mandriva.org> 1.0-2mdv2007.0
- use openoffice.org naming on x86_64

* Tue Aug 22 2006 Anssi Hannula <anssi@mandriva.org> 1.0-1mdv2007.0
- initial Mandriva release