File OpenOffice_org-ure.spec of Package OpenOffice_org-ure

#
# spec file for package OpenOffice_org-ure (Version 3.1.1.4)
#
# 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/
#

# norootforbuild


Name:           OpenOffice_org-ure
Version:        3.1.1.4
Release:        1.<RELEASE1>
%define         ooo_build_version 3.1.1.4
%define         piece ure
#!BuildIgnore:  OpenOffice_org
BuildRequires:  OpenOffice_org-bootstrap = %version
BuildRequires:  ImageMagick ant ant-apache-regexp bison boost-devel ccache cups-devel curl-devel db-devel flac-devel flex gnome-vfs2-devel gperf gtk2-devel icu java-devel kdelibs3-devel krb5 libexif mono-devel neon-devel openldap2-devel pam-devel perl-Archive-Zip perl-Compress-Zlib python-devel recode unixODBC-devel unzip xml-commons-apis xorg-x11 zip
%define	      ooo_prefix	%_libdir
%define	      ooo_home		ooo3
%define	      ooo_build_tag     ooo310-m19
License:        Artistic License .. ; BSD 3-clause (or similar) ; GPL v2 or later ; LPPL .. ; LGPL v2.1 or later ; LGPL v3 only ; MPL .. ; MIT License (or similar)
Group:          Productivity/Office/Suite
AutoReqProv:    on
%ifarch %ix86
# libstlport_gcc4 improves compatibility with the upstream extensions (bnc#458952)
Recommends:     libstlport_gcc4
%endif
Summary:        OpenOffice.org UNO Runtime Environment
Url:            http://www.openoffice.org/
Source0:        %ooo_build_tag-%piece.tar.bz2
Source1:        %ooo_build_tag-sdk.tar.bz2
# prebuilt mono dlls for older distributions and ppc
Source100:      ooo-cli-prebuilt-3.1.1.tar.bz2
# necessary for SDK, http://udk.openoffice.org/common/man/spec/transparentofficecomponents.html
# FIXME: can be built using mingw32 C++ compiler
Source101:      unowinreg.dll
# FIXME: this patch is needed to build ure and sdk pieces at the same time
Patch990:       ooo-build-3.0.99.4-piece-sdk-with-ure.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64 ppc

%description
UNO is the basic technology used by OpenOffice.org. It allows to
integrate modules written in various programming languages.



%package -n OpenOffice_org-mono
License:        LGPL v3 only
Summary:        Mono UNO Bridge for OpenOffice.org
Group:          Productivity/Office/Suite
Requires:       mono-core
Requires:       %name = %version

%description -n OpenOffice_org-mono
The Mono/UNO binding allows a Mono application to access the complete
set of APIs exposed by OpenOffice.org via UNO. A trivial example
use-case might be a small mono application to create a spreadsheet,
populate it with data, charts, formatting, then save that in Excel
format.

Currently the use of Mono for add-ins & scripting inside OO.o itself is
not supported.



%package -n OpenOffice_org-pyuno
License:        LGPL v3 only
Summary:        Python UNO Bridge for OpenOffice.org
Group:          Productivity/Office/Suite
Provides:       OpenOffice_org:%ooo_prefix/%ooo_home/program/pyuno.so
Requires:       %name = %version

%description -n OpenOffice_org-pyuno
The Python-UNO bridge allows to use the standard OpenOffice.org API
from the well known Python scripting language. It can be used to
develop UNO components in python, thus python UNO components may be run
within the OpenOffice.org process and can be called from Java, C++ or
the built in StarBasic scripting language. You can create and invoke
scripts with the office scripting framework (OOo 2.0 and later) with
it. For example, it is used for the mail merge functionality.

You can find the more information at
http://udk.openoffice.org/python/python-bridge.html



%package devel
Requires:       %name = %version
Requires:       OpenOffice_org-mono = %version
Requires:       OpenOffice_org-pyuno = %version
Requires:       OpenOffice_org-bootstrap = %version
Provides:       OpenOffice_org-sdk = %version
Obsoletes:      OpenOffice_org-sdk <= %version
License:        Artistic License .. ; BSD 3-clause (or similar) ; GPL v2 or later ; LPPL .. ; LGPL v2.1 or later ; LGPL v3 only ; MPL .. ; MIT License (or similar)
Summary:        OpenOffice.org URE Development
Group:          Productivity/Office/Suite
AutoReqProv:    off

%description devel
This package allows developement based on the OpenOffice.org UNO
runtime environment API.



%package devel-doc
Requires:       %name-devel = %version
Provides:       OpenOffice_org-sdk-doc = %version
Obsoletes:      OpenOffice_org-sdk-doc <= %version
License:        Artistic License .. ; BSD 3-clause (or similar) ; GPL v2 or later ; LPPL .. ; LGPL v2.1 or later ; LGPL v3 only ; MPL .. ; MIT License (or similar)
Summary:        OpenOffice.org URE Development
Group:          Productivity/Office/Suite
AutoReqProv:    off

%description devel-doc
This package allows developement based on the OpenOffice.org UNO
runtime environment API.



%prep
%setup -q -b1 -n %ooo_build_tag-%piece
mv ../%ooo_build_tag-sdk/* .
# prebuilt stuff
mkdir -p external/cli
tar -xjf %{S:100} -C external/cli
cp %{S:101} odk/source/unowinreg/win
# FIXME: create fake prj stuff to make build happy
mkdir -p external/prj
touch external/prj/build.lst
touch external/prj/d.lst
# hotfixes
mkdir -p ooo-build/hotfixes
cp %{P:990} ooo-build/hotfixes

%build
# setup env.
export OO_INSTDIR=%{_libdir}/%ooo_home
export OO_TOOLSDIR=$OO_INSTDIR/ooo-build/bin
export VERBOSE=1
export EXTRA_BUILD_FLAGS=%{?jobs:-P%jobs}
export EXTRA_DMAKE_FLAGS="%{?jobs:-- -P%jobs}"
$OO_TOOLSDIR/piece/build-generic %piece %ooo_build_tag || $OO_TOOLSDIR/piece/build-generic %piece %ooo_build_tag || $OO_TOOLSDIR/piece/build-generic %piece %ooo_build_tag

%install
# setup env.
export OO_INSTDIR=%{_libdir}/%ooo_home
export OO_TOOLSDIR=$OO_INSTDIR/ooo-build/bin
export DESTDIR=$RPM_BUILD_ROOT
# install SDK first because it removes solver
$OO_TOOLSDIR/piece/install-generic sdk    %ooo_build_tag
$OO_TOOLSDIR/piece/install-generic %piece %ooo_build_tag
# bin the SDK-related zip files from solver; they were installed together with URE
find $RPM_BUILD_ROOT%ooo_prefix/%ooo_home/solver -name "*.zip" -exec rm -f {} \;
%ifarch %ix86
# helper script to create compat link needed to run upstream extensions (bnc#458952)
cat << EOF > $RPM_BUILD_ROOT%ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links
#!/bin/sh
# helper script to create compat link needed to run upstream extensions (bnc#458952)
if ! test -L %_libdir/libstlport_gcc.so -a -r %_libdir/libstlport_gcc.so ; then
    lib_name=\`ls /usr/lib/libstlport_gcc.so.4* 2>/dev/null | tail -n 1\`
    if test -n "\$lib_name" -a -r "\$lib_name" ; then
	lib_name=\`basename \$lib_name\`
	rm -f %_libdir/libstlport_gcc.so
	ln -sf \$lib_name %_libdir/libstlport_gcc.so
    fi
fi
EOF
chmod 755 $RPM_BUILD_ROOT%ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# crazy hack for the ugly extensions
if test $1 -gt 1 ; then
    if test -d %{_libdir}/%ooo_home/share/uno_packages/cache -a \
            -n "`find %{_libdir}/%ooo_home/share/uno_packages/cache -name LanguageTool-0.9.3.oxt`" ; then
	# try to remove the LangTool extension by the older URE; it can't be
	# removed with OOo-3.1 and higher
	echo "Unregistering the LangTool extension from OpenOffice.org..."
	unopkg remove --shared org.openoffice.languagetool.oxt || true;
	# clear disk cache
	unopkg list --shared > /dev/null 2>&1 || true;
    fi
fi

%post
/sbin/ldconfig
# clean the UNO cache if there is a broken extension
unopkg-regenerate-cache %{_libdir}/%ooo_home LanguageTool-0.9.3.oxt || true
# FIXME: remove this in OOo-3.3; people should have cleaned system by the update
# to OOo-3.2, OOo-3.2.1, or they do not care
# an older version created invalid symlink /libstlport_gcc.so by mistake
# we remove it because it looks quite ugly
if test -L /libstlport_gcc.so ; then
    rm -f /libstlport_gcc.so
fi

%postun
/sbin/ldconfig
%ifarch %ix86
if test $1 = 0 ; then
    # OOo is removed => remove the link as well if it is not created by stlport-devel package (bnc#458952)
    if test -L %_libdir/libstlport_gcc.so -a ! -r %_prefix/include/stlport/ctime ; then
	rm -f %_libdir/libstlport_gcc.so
    fi
fi
%endif
%ifarch %ix86

%posttrans
# the compat link was %%ghost in old OOo-ure packages, so it might be removed also during OOo-ure update (bnc#458952)
if test -f %ooo_prefix/%ooo_home/ure/bin/javaldx ; then
    %ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links || true;
fi
%endif
%ifarch %ix86

%triggerin -- libstlport_gcc4
# create compat link needed to run upstream extensions (bnc#458952)
%ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links || true;
%endif
%ifarch %ix86

%triggerpostun -- libstlport_gcc4-devel
# create compat link needed to run upstream extensions (bnc#458952)
%ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links || true;
%endif
%ifarch %ix86

%triggerpostun -- libstlport_gcc4
# remove compat link needed to run upstream extensions (bnc#458952)
if test $2 = 0 ; then
    if test -L %_libdir/libstlport_gcc.so -a ! -r %_libdir/libstlport_gcc.so ; then
	rm -f %_libdir/libstlport_gcc.so
    fi
fi
exit 0
%endif

%post devel
/sbin/ldconfig

%postun devel
/sbin/ldconfig

%files -f files-%piece.txt
%defattr(-,root,root)
%ifarch %ix86
%ooo_prefix/%ooo_home/ure/bin/create-libstlport-compat-links
%endif

%files -f files-mono.txt -n OpenOffice_org-mono
%defattr(-,root,root)

%files -f files-pyuno.txt -n OpenOffice_org-pyuno
%defattr(-,root,root)

%files -f files-sdk.txt devel
%defattr(-,root,root)
%dir %ooo_prefix/%ooo_home/solver
%ooo_prefix/%ooo_home/solver/*

%files -f files-sdk-doc.txt devel-doc
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by