[Erp5-report] r11992 - /spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jan 10 14:00:21 CET 2007
Author: kevin
Date: Wed Jan 10 14:00:18 2007
New Revision: 11992
URL: http://svn.erp5.org?rev=11992&view=rev
Log:
Third release:
- Dynamic patch of OpenOffice depending of installed version
- Dynamic oood configuration depending of OpenOffice version
- OpenOffice.org package naming was moved to standard lower-case starting from 2.0 branch, so require at v2.0 of openoffice for oood (this void strange behaviour on Mandriva 2006 where both v1 and v2 are present).
Modified:
spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec
Modified: spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec
URL: http://svn.erp5.org/spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec?rev=11992&r1=11991&r2=11992&view=diff
==============================================================================
--- spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec (original)
+++ spec/mandriva/2006.0/openoffice.org-oood/openoffice.org-oood.spec Wed Jan 10 14:00:18 2007
@@ -2,7 +2,7 @@
%define deamon_name oood
%define version 0.1.9
-%define release 2
+%define release 3
%define server_user oood
%define config_dir %{_sysconfdir}/oood
@@ -22,7 +22,7 @@
Patch2: openoffice.org-2.0.3-skip-registration.patch
URL: http://svn.erp5.org/erp5/trunk/utils/ooodoc_server/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-rootdir
-Requires: python >= 2.4, openoffice.org-pyuno, xorg-x11-Xvfb
+Requires: python >= 2.4, openoffice.org-pyuno >= 2.0.0, xorg-x11-Xvfb
Requires(pre): rpm-helper
BuildRequires: python >= 2.4
@@ -98,15 +98,37 @@
%post
-# Hack: Silent patch 1
+# Hack - Silent patch 1.
+# This patch python XML-RPC server. This patch was commited upstream in official
+# python project, so this patch should be deleted from this spec file for Mandriva 2007.
%define patches_dir %{server_dir}/patches
%{__cp} -a %{py_libdir}/SimpleXMLRPCServer.py %{py_libdir}/SimpleXMLRPCServer.py.rpmsave
%{__patch} %{py_libdir}/SimpleXMLRPCServer.py --input=%{patches_dir}/SimpleXMLRPCServer.patch
-# Hack: Silent patch 2
-%define ooo_setup_path /opt/openoffice.org2.0/share/registry/data/org/openoffice/
-%define ooo_setup_file Setup.xcu
-%{__cp} -a %{ooo_setup_path}%{ooo_setup_file} %{ooo_setup_path}%{ooo_setup_file}.rpmsave
-%{__patch} %{ooo_setup_path}%{ooo_setup_file} --input=%{patches_dir}/openoffice.org-2.0.3-skip-registration.patch
+
+# Hack - Silent patch 2: Bypass the openoffice registration nag screen.
+# This patch is hard to apply because we don't know which version of openoffice
+# will be installed on the system: openoffice RPM can came from Mandriva or
+# from OOo official project.
+# Because the origin is unknown, we have to calculate where openoffice is installed
+# and modify some configuration files. This is the goal of the code below.
+# Path for mandriva official RPMs: /usr/lib/ooo-2.0/share/registry/data/org/openoffice
+# Path for ooo project official RPMs: /opt/openoffice.org2.0/share/registry/data/org/openoffice
+MDV_PATH=`find -P /usr/lib -depth -maxdepth 3 -mount -name "soffice" | cut -d '/' -f -4`
+OOO_PATH=`find -P /opt -depth -maxdepth 3 -mount -name "soffice" | cut -d '/' -f -3`
+if test "x$MDV_PATH" != "x"; then
+ OOO_ROOT=$MDV_PATH
+fi
+if test "x$OOO_PATH" != "x"; then
+ OOO_ROOT=$OOO_PATH
+fi
+%define ooo_setup_file share/registry/data/org/openoffice/Setup.xcu
+%define ooo_file_to_patch $OOO_PATH/%{ooo_setup_file}
+%{__cp} -a %{ooo_file_to_patch} %{ooo_file_to_patch}.rpmsave
+%{__patch} %{ooo_file_to_patch} --input=%{patches_dir}/openoffice.org-2.0.3-skip-registration.patch
+
+# Update oood config to let it find where openoffice is installed
+sed 's/\/opt\/openoffice.org2.0/$OOO_PATH/g' %{config_dir}/config.py > %{config_dir}/config.py
+
# Add service and start server
%_post_service oood
%__service oood restart
@@ -119,9 +141,13 @@
%postun
%_postun_userdel %{server_user}
-# Restore patched files
+# Unpatche XML-RPC server
%{__mv} %{py_libdir}/SimpleXMLRPCServer.py.rpmsave %{py_libdir}/SimpleXMLRPCServer.py
-%{__mv} %{ooo_setup_path}%{ooo_setup_file}.rpmsave %{ooo_setup_path}%{ooo_setup_file}
+
+# Unpatch OOo
+OOO_ROOT_2=`grep "uno_path" %{config_dir}/config.py | python -c "print '/'.join(raw_input().split(\"'\")[1].split(\"/\")[:-1])"`
+%define ooo_file_to_unpatch $OOO_ROOT_2/%{ooo_setup_file}
+%{__mv} %{ooo_file_to_unpatch}.rpmsave %{ooo_file_to_unpatch}
%files
@@ -143,6 +169,11 @@
#----------------------------------------------------------------------
%changelog
+* Wed Jan 10 2007 Kevin Deldycke <kevin at nexedi.com> 0.1.9-3mdk
+- Dynamic patch of OpenOffice depending of installed version
+- Dynamic oood configuration depending of OpenOffice version
+- OpenOffice.org package naming was moved to standard lower-case starting from 2.0 branch, so require at v2.0 of openoffice for oood (this void strange behaviour on Mandriva 2006 where both v1 and v2 are present).
+
* Thu Nov 30 2006 Kevin Deldycke <kevin at nexedi.com> 0.1.9-2mdk
- Even if it's recommanded to use OpenOffice.org 2.0.3, don't force the requirement of this particular version of OpenOffice.
More information about the Erp5-report
mailing list