diff options
author | Andreas Proschofsky <suka@gentoo.org> | 2005-09-27 19:43:26 +0000 |
---|---|---|
committer | Andreas Proschofsky <suka@gentoo.org> | 2005-09-27 19:43:26 +0000 |
commit | ae4458ea56186a161cefa33a34f26b9231d969a6 (patch) | |
tree | 0d9d24ca01a954b9de4899a87d12619ec0436d0e /app-office/openoffice-bin/files/2.0.0 | |
parent | add glade 2.12 to the gnome 2.12 mask (diff) | |
download | gentoo-2-ae4458ea56186a161cefa33a34f26b9231d969a6.tar.gz gentoo-2-ae4458ea56186a161cefa33a34f26b9231d969a6.tar.bz2 gentoo-2-ae4458ea56186a161cefa33a34f26b9231d969a6.zip |
First release Candidate for OpenOffice.org 2.0
(Portage version: 2.0.52-r1)
Diffstat (limited to 'app-office/openoffice-bin/files/2.0.0')
-rwxr-xr-x | app-office/openoffice-bin/files/2.0.0/ooo-wrapper2 | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/app-office/openoffice-bin/files/2.0.0/ooo-wrapper2 b/app-office/openoffice-bin/files/2.0.0/ooo-wrapper2 new file mode 100755 index 000000000000..8222add9ae93 --- /dev/null +++ b/app-office/openoffice-bin/files/2.0.0/ooo-wrapper2 @@ -0,0 +1,130 @@ +#!/usr/bin/perl -w +#***************************************************************************** +# +# ooffice - Wrapper script for OpenOffice.org +# +# Based on the Mandrake work. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#***************************************************************************** + +use strict; +use IO::Handle; +use Fcntl ':flock'; + +my $Debug = $ENV{OOO_DEBUG}; +my $DebugRH = $ENV{OOO_RH_DEBUG}; + +# Define the vendor of this particular OOo pacakge +my $VendorName = 'Gentoo'; +# Define system installation directory +# Autoconf totally sucks for @libdir@ type substitution +my $SystemInstallDir = '/usr/lib/openoffice'; +# Suffix for parallel installable versioning +my $BinSuffix = '2'; +# ooo-build version +my $OOO_BUILDVERSION = 'PV'; +# Debugging + +if ( $DebugRH ) { + $Debug = 1; + $VendorName = "RedHat"; +} +if ($Debug && $BinSuffix =~ /^\@/) { + $SystemInstallDir = "/usr/lib/ooo-1.9"; + $BinSuffix = '1.9'; +} + +#============================================================================= +# Main +#============================================================================= + +# Parse command line arguments +my @ooo_argv; +my $session_quickstart; +my $widgets_set; +while ($ARGV[0]) { + $_ = shift; + if (m/^--session-quickstart/) { + $session_quickstart = 1; + } elsif (m/^--widgets-set/) { + $widgets_set = shift; + (defined $widgets_set) || die "Error: The option --widgets-set requires a value\n" . + "For example: --widgets-set gtk\n"; + } elsif (m/^--version/) { + print "This is OpenOffice.org built with ooo-build-$OOO_BUILDVERSION\n"; + exit 0; + } else { + push @ooo_argv, $_; + } +} + +if (!@ooo_argv) { + my $arg; + if ($0 =~ m/\/oo(calc|draw|impress|math|web|writer|base)$BinSuffix$/) { + $arg = "-$1"; + } elsif ($0 =~ m/\/oofromtemplate$BinSuffix$/) { + $arg = "slot:5500"; + } + + if ($arg) { + push @ooo_argv, "$arg"; + $Debug && print "Append arg: $arg\n"; + } +} else { + $Debug && print "Ignoring type - since have filenames\n"; +} + +if (defined $widgets_set) { + $ENV{SAL_USE_VCLPLUGIN} = $widgets_set; +} + +# overcome ghastly up-stream evilness +$ENV{SAL_NOEXPANDFPICKER}='TRUE'; + +if ($session_quickstart) { + $Debug && print "Execute quickstarter\n"; + push @ooo_argv, '-quickstart'; +} + +# FIXME: the following two fixes should be done by OOo itself +# create the user config directory with safe rights 700 if it we find +# the right path and the directory does not exist +if (open BOOTSTRAPRC, "/usr/lib/openoffice/program/bootstraprc") { + while (my $line = <BOOTSTRAPRC>) { + chomp $line; + if (($line =~ m/^\s*UserInstallation\s*=\s*([^\s]*)\s*$/) && ($1)) { + my $userConfDir=$1; + $userConfDir =~ s|\$SYSUSERCONFIG|$ENV{HOME}|; + $userConfDir =~ s|file://||; + mkdir ($userConfDir,0700) unless (-d $userConfDir); + last; + } + } + close BOOTSTRAPRC; +} +# touch ~/.recently-used with safe rights 700 if it does not exist +if (! -f "$ENV{HOME}/.recently-used") { + open (RECENTLY_USED, ">$ENV{HOME}/.recently-used") && + close RECENTLY_USED && + chmod 0600, "$ENV{HOME}/.recently-used"; +} + +if (!(-f '/proc/version')) { + print STDERR "\n\n --- Warning - OO.o will not work without a mounted /proc filesystem --- \n\n\n"; +} + +# And here we go. +exec "$SystemInstallDir/program/soffice", @ooo_argv |