summaryrefslogtreecommitdiff
path: root/sysui/desktop/share
diff options
context:
space:
mode:
Diffstat (limited to 'sysui/desktop/share')
-rw-r--r--sysui/desktop/share/add_specfile_triggers.sed4
-rw-r--r--sysui/desktop/share/brand.pl127
-rw-r--r--sysui/desktop/share/create_mime_xml.pl89
-rw-r--r--sysui/desktop/share/create_tree.sh111
-rw-r--r--sysui/desktop/share/documents.ulf107
-rw-r--r--sysui/desktop/share/launcher_comment.ulf21
-rw-r--r--sysui/desktop/share/launcher_genericname.ulf23
-rw-r--r--sysui/desktop/share/launcher_name.ulf3
-rw-r--r--sysui/desktop/share/makefile.mk263
-rw-r--r--sysui/desktop/share/openoffice.sh2
-rw-r--r--sysui/desktop/share/printeradmin.sh3
-rw-r--r--sysui/desktop/share/translate.pl145
12 files changed, 898 insertions, 0 deletions
diff --git a/sysui/desktop/share/add_specfile_triggers.sed b/sysui/desktop/share/add_specfile_triggers.sed
new file mode 100644
index 000000000000..a8d9d2932a0c
--- /dev/null
+++ b/sysui/desktop/share/add_specfile_triggers.sed
@@ -0,0 +1,4 @@
+/#include<symlink_triggers>/ {
+r ../share/symlink_triggers
+d
+}
diff --git a/sysui/desktop/share/brand.pl b/sysui/desktop/share/brand.pl
new file mode 100644
index 000000000000..ebb5df19d549
--- /dev/null
+++ b/sysui/desktop/share/brand.pl
@@ -0,0 +1,127 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#*********************************************************************
+#
+# main
+#
+
+$destdir = pop @ARGV;
+mkdir $destdir,0777;
+
+$productname = "OpenOffice.org";
+$productfilename = "openoffice";
+$prefix = "";
+$iconprefix = "";
+
+while ($_ = $ARGV[0], /^-/) {
+ shift;
+ last if /^--$/;
+ if (/^-p/) {
+ $productname = $ARGV[0];
+ shift;
+ }
+ if (/^-u/) {
+ $productfilename = $ARGV[0];
+ shift;
+ }
+ if (/^--prefix/) {
+ $prefix = $ARGV[0];
+ shift;
+ }
+ if (/^--iconprefix/) {
+ $iconprefix = $ARGV[0];
+ shift;
+ }
+ if (/^--category/) {
+ $category = $ARGV[0];
+ shift;
+ }
+}
+
+
+while (<>) {
+ unless (open INFILE,$ARGV) {
+ print STDOUT "Can't open input file $ARGV: $!\n";
+ exit 1;
+ }
+
+ $srcfile = substr($ARGV, rindex($ARGV, "/") + 1);
+
+ unless (open OUTFILE,"> $destdir/$prefix$srcfile") {
+ print STDOUT "Can't open output file $destdir/$prefix$srcfile: $!\n";
+ exit 1;
+ }
+
+ while (<INFILE>) {
+ # remove possible Windows line-ends
+ chomp;
+
+ # patch all occurances of openoffice in ICON line with
+ # $prefix
+ s/Icon=/Icon=$iconprefix/;
+
+ # patch all occurances of openoffice in icon_filename
+ # line with $prefix
+ s/icon_filename=/icon_filename=$iconprefix/;
+
+ # patch all occurances of openoffice in EXEC line with
+ # $productfilename
+ if ( /Exec/ ) {
+ s/openoffice/$productfilename/;
+ }
+
+ # if $productfilename != "openoffice, add it to the list
+ # of applications.
+ if ( /user_level=$/ ) {
+ $_ = $_ . $productfilename;
+ } elsif ( /user_level/ ) {
+ s/$productfilename,//;
+ s/user_level=/user_level=$productfilename,/
+ }
+
+ # append special category if specified
+ if ( /Categories/ ) {
+ if ( length($category) > 0 ) {
+ $_ = "$_$category;";
+ }
+ }
+
+ # replace %PRODUCTNAME placeholders
+ s/%PRODUCTNAME/$productname/g;
+
+ print OUTFILE "$_\n";
+ }
+
+ close(OUTFILE);
+ close(INFILE);
+}
diff --git a/sysui/desktop/share/create_mime_xml.pl b/sysui/desktop/share/create_mime_xml.pl
new file mode 100644
index 000000000000..c6b8e4f0b44c
--- /dev/null
+++ b/sysui/desktop/share/create_mime_xml.pl
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+use File::Basename;
+$basedir = dirname($0);
+$productname = 'OpenOffice.org';
+$mimedir = $basedir.'/../mimetypes';
+
+$FS= ' '; # field seperator (space) - for documents.ulf
+$, = "\n"; # set output field separator (newline)
+$\ = "\n"; # set output record separator (newline)
+
+## get list of components and corresponding translations from documents.ulf
+open(DOCUMENTS_ULF, $ARGV[0]) || die 'Cannot open "documents.ulf".';
+while (<DOCUMENTS_ULF>) {
+ if (/^\[/) {
+ # section starts
+ s/^\[(.*)]/$1/;
+ chomp;
+ $module = $_;
+ } else {
+ # translated strings
+ ($lang,$junk,$comment) = split($FS, $_, 3);
+ $comment =~ s/^"(.*)"$/$1/;
+ $comment =~ s/%PRODUCTNAME/$productname/;
+ chomp $lang;
+ chomp $comment;
+ if ($lang eq "en-US") {
+ $value = " <comment>$comment</comment>";
+ } else {
+ $value = ' <comment xml:lang="'.$lang.'">'.$comment.'</comment>';
+ }
+ push(@{$mimehash{$module}}, $value) unless $lang eq "";
+ }
+}
+close DOCUMENTS_ULF;
+
+## creating the xml on stdout
+print '<?xml version="1.0" encoding="UTF-8"?>';
+print '<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">';
+
+foreach $component (sort(keys %mimehash)) {
+ print STDERR "Processing entries for $component";
+ # mimetype and glob
+ getMimedata($component);
+ print ' <mime-type type="'.$mimetype.'">';
+ print (sort({customsort($a) cmp customsort($b)} @{$mimehash{$component}}));
+ print ' <glob pattern="'.$glob.'"/>';
+ if ( $component =~ /oasis/ ) {
+ print ' <magic'.( $mimetype =~ /-/ ? ' priority="60"' : '').'>';
+ print ' <match type="string" offset="38" value="'.$mimetype.'"/>';
+ print ' </magic>';
+ }
+ print ' </mime-type>';
+}
+print '</mime-info>';
+
+sub customsort {
+ # sort <comment> before <comment xml:lang...>
+ $in = shift;
+ $in =~ tr/>/A/;
+ $in =~ tr/ /Z/;
+ return $in;
+}
+
+## get mime-type and glob from ../mimetype/*.desktop
+sub getMimedata {
+ $desktop_name = shift;
+ $desktop_file = $mimedir.'/'.$desktop_name.'.desktop';
+ $mimetype = "";
+ $glob = "";
+ open(DESKTOP_FILE, $desktop_file) || die 'Cannot open "desktop"-file.'.$!;
+ while (<DESKTOP_FILE>) {
+ ## get mimetype
+ if (/^MimeType=/) {
+ s/^MimeType=(.*)\n$/$1/;
+ $mimetype = "$_";
+ }
+ ## get glob
+ if (/^Patterns=/) {
+ s/^Patterns=(.*)\n$/\1/;
+ $glob = "$_";
+ }
+ }
+ close DESKTOP_FILE;
+ # die if we cannot determine the glob-pattern or mimtetype
+ die "Could not get mime-type fom $desktop_file" if ($mimetype eq "");
+ die "Could not get glob-pattern fom $desktop_file" if ($glob eq "");
+}
+
+## END vim: set ts=4:
diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh
new file mode 100644
index 000000000000..e04825df2019
--- /dev/null
+++ b/sysui/desktop/share/create_tree.sh
@@ -0,0 +1,111 @@
+umask 022
+
+if [ "${KDEMAINDIR}" ]
+then
+ echo Copying icons ..
+ for i in `cd ${ICON_SOURCE_DIR}; find ${ICON_THEMES:-hicolor/??x?? locolor} -name "*.png"`
+ do
+ targetdir=${DESTDIR}/${KDEMAINDIR}/share/icons/`dirname $i`
+ mkdir -p $targetdir
+ destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename $i`
+ cp ${ICON_SOURCE_DIR}/$i $destfile
+ chmod 0644 $destfile
+ done
+
+ mkdir -p ${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application
+ for i in `cat mimelnklist`; do
+ cp $i ${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application/${PREFIX}-$i
+ done
+ chmod 0644 ${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application/*
+fi
+
+if [ "${GNOMEDIR}" ]
+then
+ echo Copying GNOME icons ..
+ for i in `cd ${ICON_SOURCE_DIR}/hicolor; find ??x?? -name "*.png"`
+ do
+ targetdir=${DESTDIR}/${GNOMEDIR}/share/icons/gnome/`dirname $i`
+ mkdir -p $targetdir
+ destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename $i`
+ cp ${ICON_SOURCE_DIR}/hicolor/$i $destfile
+ chmod 0644 $destfile
+ done
+
+ mkdir -p ${DESTDIR}/${GNOMEDIR}/share/mime-info
+ cp openoffice.mime ${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.mime
+ cp openoffice.keys ${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.keys
+ chmod 0644 ${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.*
+
+ mkdir -p ${DESTDIR}/${GNOMEDIR}/share/application-registry
+ cp openoffice.applications ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.applications
+ chmod 0644 ${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.*
+
+ if [ "${GNOME_MIME_THEME}" ]
+ then
+ echo "Creating legacy mimetype symlinks for GNOME .."
+ # add symlinks so that nautilus can identify the mime-icons
+ # not strictly freedesktop-stuff but there is no common naming scheme yet.
+ # One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png"
+ # for e.g. application/vnd.oasis.opendocument.spreadsheet
+ link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}"
+ if [ ! -d "${link_target_root}" ]
+ then
+ link_target_root="${DESTDIR}/${GNOMEDIR}/share/icons/gnome"
+ fi
+
+ for subdir in `cd ${link_target_root}; ls -d *`
+ do
+ link_target_dir=""
+ link_dir="${DESTDIR}/${GNOMEDIR}/share/icons/${GNOME_MIME_THEME}/$subdir/mimetypes"
+ if [ ! -d "${link_dir}" ]
+ then
+ mkdir -p "${link_dir}"
+ link_target_dir="../../../gnome/$subdir/mimetypes/"
+ fi
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}drawing-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}formula.png ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}master-document.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-database.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-drawing-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-formula.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-master-document.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-presentation-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-text-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}oasis-web-template.png ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}presentation-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}spreadsheet-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}text-template.png ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png
+ ln -sf $link_target_dir${ICON_PREFIX:-}${ICON_PREFIX:+-}extension.png ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png
+ done
+ fi
+fi
+
+mkdir -p ${DESTDIR}/usr/bin
+
+office_root=/opt/${PREFIX}
+
+ln -sf ${office_root}/program/soffice ${DESTDIR}/usr/bin/soffice
+
+cp openoffice.sh ${DESTDIR}/usr/bin/${PREFIX}
+cp printeradmin.sh ${DESTDIR}/usr/bin/${PREFIX}-printeradmin
+chmod 0755 ${DESTDIR}/usr/bin/${PREFIX} ${DESTDIR}/usr/bin/${PREFIX}-printeradmin
+
+mkdir -p ${DESTDIR}/usr/share/mime/packages
+cp openoffice.org.xml ${DESTDIR}/usr/share/mime/packages/
+chmod 0644 ${DESTDIR}/usr/share/mime/packages/openoffice.org.xml
+
+mkdir -p ${DESTDIR}/usr/share/applications
+for i in `cat launcherlist`; do
+ ln -sf ${office_root}/share/xdg/$i ${DESTDIR}/usr/share/applications/${PREFIX}-$i
+done
+
diff --git a/sysui/desktop/share/documents.ulf b/sysui/desktop/share/documents.ulf
new file mode 100644
index 000000000000..88fd05c879d2
--- /dev/null
+++ b/sysui/desktop/share/documents.ulf
@@ -0,0 +1,107 @@
+[text]
+en-US = "%PRODUCTNAME Text Document"
+
+[text-template]
+en-US = "%PRODUCTNAME Text Document Template"
+
+[master-document]
+en-US = "%PRODUCTNAME Master Document"
+
+[formula]
+en-US = "%PRODUCTNAME Formula"
+
+[presentation]
+en-US = "%PRODUCTNAME Presentation"
+
+[presentation-template]
+en-US = "%PRODUCTNAME Presentation Template"
+
+[drawing]
+en-US = "%PRODUCTNAME Drawing"
+
+[drawing-template]
+en-US = "%PRODUCTNAME Drawing Template"
+
+[spreadsheet]
+en-US = "%PRODUCTNAME Spreadsheet"
+
+[spreadsheet-template]
+en-US = "%PRODUCTNAME Spreadsheet Template"
+
+[oasis-text]
+en-US = "OpenDocument Text"
+
+[oasis-text-template]
+en-US = "OpenDocument Text Template"
+
+[oasis-master-document]
+en-US = "OpenDocument Master Document"
+
+[oasis-formula]
+en-US = "OpenDocument Formula"
+
+[oasis-presentation]
+en-US = "OpenDocument Presentation"
+
+[oasis-presentation-template]
+en-US = "OpenDocument Presentation Template"
+
+[oasis-drawing]
+en-US = "OpenDocument Drawing"
+
+[oasis-drawing-template]
+en-US = "OpenDocument Drawing Template"
+
+[oasis-spreadsheet]
+en-US = "OpenDocument Spreadsheet"
+
+[oasis-spreadsheet-template]
+en-US = "OpenDocument Spreadsheet Template"
+
+[oasis-database]
+en-US = "OpenDocument Database"
+
+[oasis-web-template]
+en-US = "HTML Document Template"
+
+[extension]
+en-US = "%PRODUCTNAME Extension"
+
+[ms-excel-sheet-12]
+en-US = "Microsoft Excel Worksheet"
+
+[ms-excel-template-12]
+en-US = "Microsoft Excel Worksheet Template"
+
+[ms-powerpoint-presentation-12]
+en-US = "Microsoft PowerPoint Presentation"
+
+[ms-powerpoint-template-12]
+en-US = "Microsoft PowerPoint Presentation Template"
+
+[ms-word-document-12]
+en-US = "Microsoft Word Document"
+
+[ms-word-template-12]
+en-US = "Microsoft Word Document Template"
+
+[openxmlformats-officedocument-presentationml-presentation]
+en-US = "Microsoft PowerPoint Presentation"
+
+[openxmlformats-officedocument-presentationml-template]
+en-US = "Microsoft PowerPoint Presentation Template"
+
+[openxmlformats-officedocument-spreadsheetml-sheet]
+en-US = "Microsoft Excel Worksheet"
+
+[openxmlformats-officedocument-spreadsheetml-template]
+en-US = "Microsoft Excel Worksheet Template"
+
+[openxmlformats-officedocument-wordprocessingml-document]
+en-US = "Microsoft Word Document"
+
+[openxmlformats-officedocument-wordprocessingml-template]
+en-US = "Microsoft Word Document Template"
+
+[ms-excel-sheet-binary-12]
+en-US = "Microsoft Excel Worksheet"
diff --git a/sysui/desktop/share/launcher_comment.ulf b/sysui/desktop/share/launcher_comment.ulf
new file mode 100644
index 000000000000..6aeab6d94c36
--- /dev/null
+++ b/sysui/desktop/share/launcher_comment.ulf
@@ -0,0 +1,21 @@
+[writer]
+en-US = "Create and edit text and graphics in letters, reports, documents and Web pages by using Writer."
+
+[impress]
+en-US = "Create and edit presentations for slideshows, meeting and Web pages by using Impress."
+
+[draw]
+en-US = "Create and edit drawings, flow charts, and logos by using Draw."
+
+[calc]
+en-US = "Perform calculation, analyze information and manage lists in spreadsheets by using Calc."
+
+[math]
+en-US = "Create and edit scientific formulas and equations by using Math."
+
+[base]
+en-US = "Manage databases, create queries and reports to track and manage your information by using Base."
+
+[startcenter]
+en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Oracle."
+
diff --git a/sysui/desktop/share/launcher_genericname.ulf b/sysui/desktop/share/launcher_genericname.ulf
new file mode 100644
index 000000000000..ff8041a155fc
--- /dev/null
+++ b/sysui/desktop/share/launcher_genericname.ulf
@@ -0,0 +1,23 @@
+[writer]
+en-US = "Word Processor"
+
+[impress]
+en-US = "Presentation"
+
+[calc]
+en-US = "Spreadsheet"
+
+[base]
+en-US = "Database Development"
+
+[math]
+en-US = "Formula Editor"
+
+[draw]
+en-US = "Drawing Program"
+
+[startcenter]
+en-US = "Office"
+
+[javafilter]
+en-US = "Small Device Format Importer"
diff --git a/sysui/desktop/share/launcher_name.ulf b/sysui/desktop/share/launcher_name.ulf
new file mode 100644
index 000000000000..db97e2686d47
--- /dev/null
+++ b/sysui/desktop/share/launcher_name.ulf
@@ -0,0 +1,3 @@
+[printeradmin]
+en-US = "%PRODUCTNAME Printer Administration"
+
diff --git a/sysui/desktop/share/makefile.mk b/sysui/desktop/share/makefile.mk
new file mode 100644
index 000000000000..e1e47648b077
--- /dev/null
+++ b/sysui/desktop/share/makefile.mk
@@ -0,0 +1,263 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sysui
+TARGET=desktopshare
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Product Version Information ----------------------------------
+
+.INCLUDE : ../productversion.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(WITH_LANG)"!=""
+ULFDIR:=$(COMMONMISC)$/$(TARGET)
+.ELSE # "$(WITH_LANG)"!=""
+ULFDIR:=.
+.ENDIF # "$(WITH_LANG)"!=""
+
+ULFFILES= \
+ documents.ulf \
+ launcher_comment.ulf \
+ launcher_genericname.ulf \
+ launcher_name.ulf
+
+LAUNCHERLIST = writer calc draw impress math base printeradmin qstart startcenter javafilter
+LAUNCHERDEPN = ../menus/{$(LAUNCHERLIST)}.desktop
+
+LAUNCHERFLAGFILE = $(COMMONMISC)/$(TARGET)/xdg.flag
+
+MIMELIST = \
+ text \
+ text-template \
+ spreadsheet \
+ spreadsheet-template \
+ drawing \
+ drawing-template \
+ presentation \
+ presentation-template \
+ formula \
+ master-document \
+ oasis-text \
+ oasis-text-template \
+ oasis-spreadsheet \
+ oasis-spreadsheet-template \
+ oasis-drawing \
+ oasis-drawing-template \
+ oasis-presentation \
+ oasis-presentation-template \
+ oasis-formula \
+ oasis-master-document \
+ oasis-database \
+ oasis-web-template \
+ ms-excel-sheet-12 \
+ ms-excel-sheet \
+ ms-excel-template-12 \
+ ms-powerpoint-presentation-12 \
+ ms-powerpoint-presentation \
+ ms-powerpoint-template-12 \
+ ms-word-document-12 \
+ ms-word-document \
+ ms-word-document2 \
+ ms-word-template-12 \
+ openxmlformats-officedocument-presentationml-presentation \
+ openxmlformats-officedocument-presentationml-template \
+ openxmlformats-officedocument-spreadsheetml-sheet \
+ openxmlformats-officedocument-spreadsheetml-template \
+ openxmlformats-officedocument-wordprocessingml-document \
+ openxmlformats-officedocument-wordprocessingml-template \
+ ms-excel-sheet-binary-12 \
+ extension
+
+MIMEICONLIST = \
+ oasis-text \
+ oasis-text-template \
+ oasis-spreadsheet \
+ oasis-spreadsheet-template \
+ oasis-drawing \
+ oasis-drawing-template \
+ oasis-presentation \
+ oasis-presentation-template \
+ oasis-formula \
+ oasis-master-document \
+ oasis-database \
+ oasis-web-template \
+ text \
+ text-template \
+ spreadsheet \
+ spreadsheet-template \
+ drawing \
+ drawing-template \
+ presentation \
+ presentation-template \
+ formula \
+ master-document \
+ database \
+ extension
+
+ICONDEPN = \
+ ../icons/hicolor/{16x16 32x32 48x48}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
+ ../icons/hicolor/{16x16 32x32 48x48}/mimetypes/{$(MIMEICONLIST)}.png \
+ ../icons/locolor/{16x16 32x32}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
+ ../icons/locolor/{16x16 32x32}/mimetypes/{$(MIMEICONLIST)}.png
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+.IF "$(GUI)"=="UNX"
+ALLTAR : $(LAUNCHERFLAGFILE) $(SPECFILES) $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
+
+.ENDIF # "$(GUI)"=="UNIX"
+
+#
+# Copy/patch the .desktop files to the output tree and
+# merge-in the translations.
+#
+
+$(LAUNCHERFLAGFILE) : ../productversion.mk brand.pl translate.pl $(ULFDIR)$/launcher_name.ulf $(ULFDIR)$/launcher_comment.ulf $(ULFDIR)/launcher_genericname.ulf
+$(LAUNCHERFLAGFILE) : $(LAUNCHERDEPN)
+ @@-$(MKDIRHIER) $(@:db).$(INPATH).$(@:f)
+ @echo Creating desktop entries for $(@:f) ..
+ @echo ---------------------------------
+ @$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) --iconprefix '$${{WITHOUTDOTUNIXPRODUCTNAME}}${ICONVERSION}-' $< $(@:db).$(INPATH).$(@:f)
+ @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Name" $(ULFDIR)$/launcher_name.ulf
+ @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Comment" $(ULFDIR)$/launcher_comment.ulf
+ @$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "GenericName" $(ULFDIR)$/launcher_genericname.ulf
+.IF "$(WITH_LIBSN)"=="YES"
+ @noop x$(foreach,i,$(LAUNCHERLIST) $(shell @echo "StartupNotify=true" >> $(@:db).$(INPATH).$(@:f)/$i.desktop))x
+.ENDIF
+ @$(MV) -f $(@:db).$(INPATH).$(@:f)/* $(@:d)
+ @rmdir $(@:db).$(INPATH).$(@:f)
+ @touch $@
+
+#
+# Create shared mime info xml file
+#
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : ../mimetypes/{$(MIMELIST)}.desktop create_mime_xml.pl
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : $(ULFDIR)$/documents.ulf
+ @echo Create shared mime info xml file ..
+ @echo ---------------------------------
+ @$(PERL) create_mime_xml.pl $< > $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+#
+# Create GNOME mime-info files
+#
+
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/openoffice.mime brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/{$(MIMELIST)}.keys
+ @@-$(MKDIRHIER) $(@:d)
+ @echo Creating GNOME .keys file for $(@:d:d:f) ..
+ @echo ---------------------------------
+ @$(PERL) brand.pl -p $(PRODUCTNAME.$(@:d:d:f)) -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(MISC)/$(@:d:d:f)
+ @$(PERL) translate.pl -p $(PRODUCTNAME.$(@:d:d:f)) -d $(MISC)/$(@:d:d:f) --ext "keys" --key "description" $(ULFDIR)$/documents.ulf
+ @cat $(MISC)/$(@:d:d:f)/{$(MIMELIST)}.keys > $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime : ../mimetypes/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ @echo Creating GNOME .mime file for $(@:d:d:f) ..
+ @echo ---------------------------------
+ @cat $< | tr -d "\015" > $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../productversion.mk
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../mimetypes/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ @echo Creating GNOME .applications file for $(@:d:d:f) ..
+ @echo ---------------------------------
+ @cat $< | tr -d "\015" | sed -e "s/OFFICENAME/$(UNIXFILENAME.$(@:d:d:f))/" -e "s/%PRODUCTNAME/$(PRODUCTNAME.$(@:d:d:f)) $(PRODUCTVERSION.$(@:d:d:f))/" > $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+#
+# Create KDE mimelnk files
+#
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : ../mimetypes/{$(MIMELIST)}.desktop
+ @@-$(MKDIRHIER) $(@:db).$(INPATH)
+ @echo Creating KDE mimelnk entries for $(@:d:d:f) ..
+ @echo ---------------------------------
+ @$(PERL) brand.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(@:db).$(INPATH)
+ @$(PERL) ../share/translate.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -d $(@:db).$(INPATH) --ext "desktop" --key "Comment" $(ULFDIR)$/documents.ulf
+ @mv -f $(@:db).$(INPATH)/* $(@:d)
+ @rmdir $(@:db).$(INPATH)
+ @echo "{$(MIMELIST)}.desktop" > $@
+
+#
+# Generate customized install scripts
+#
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : makefile.mk
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : $$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ @echo "#\!/bin/bash" > $@.$(INPATH)
+ @echo "PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.$(INPATH)
+ @echo "ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.$(INPATH)
+ @echo "ICON_SOURCE_DIR=../../../desktop/icons" >> $@.$(INPATH)
+ @cat $< >> $@.$(INPATH)
+ @chmod 774 $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+#
+# Create skript files
+#
+
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : ../productversion.mk
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : $$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(@:d:d:f))/g" > $@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+#
+# Launcher list
+#
+
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist : $(LAUNCHERDEPN)
+ @@-$(MKDIRHIER) $(@:d)
+ @echo "{$(LAUNCHERLIST:s/qstart//)}.desktop" >$@.$(INPATH)
+ @mv -f $@.$(INPATH) $@
+
+#
+# Flagfile
+#
+$(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag : $(ICONDEPN) \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications \
+ $(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh
+ @touch $@
+
diff --git a/sysui/desktop/share/openoffice.sh b/sysui/desktop/share/openoffice.sh
new file mode 100644
index 000000000000..d3ecf978ee8f
--- /dev/null
+++ b/sysui/desktop/share/openoffice.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /opt/%PREFIX/program/soffice "$@"
diff --git a/sysui/desktop/share/printeradmin.sh b/sysui/desktop/share/printeradmin.sh
new file mode 100644
index 000000000000..0eb631f345f0
--- /dev/null
+++ b/sysui/desktop/share/printeradmin.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /opt/%PREFIX/program/spadmin
diff --git a/sysui/desktop/share/translate.pl b/sysui/desktop/share/translate.pl
new file mode 100644
index 000000000000..0c3ee55b10ce
--- /dev/null
+++ b/sysui/desktop/share/translate.pl
@@ -0,0 +1,145 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#*********************************************************************
+#
+# main
+#
+
+my ($prefix, $ext, $key);
+$productname = "OpenOffice.org";
+$workdir = ".";
+
+while ($_ = $ARGV[0], /^-/) {
+ shift;
+ last if /^--$/;
+ if (/^-p/) {
+ $productname = $ARGV[0];
+ shift;
+ }
+ if (/^-d/) {
+ $workdir = $ARGV[0];
+ shift;
+ }
+ if (/^--key/) {
+ $key = $ARGV[0];
+ shift;
+ }
+ if (/^--prefix/) {
+ $prefix = $ARGV[0];
+ shift;
+ }
+ if (/^--ext/) {
+ $ext = $ARGV[0];
+ shift;
+ }
+}
+
+# open input file
+unless (open(SOURCE, $ARGV[0])) {
+ print STDERR "Can't open $ARGV[0] file: $!\n";
+ return;
+}
+
+
+# For every section in the specified ulf file there should exist
+# a template file in $workdir ..
+while (<SOURCE>) {
+ $line = $_;
+
+ if ( "[" eq substr($line, 0, 1) ) {
+ # Pass the tail of the template to the output file
+ while (<TEMPLATE>) {
+ print OUTFILE;
+ }
+
+ close(TEMPLATE);
+
+ if (close(OUTFILE)) {
+ system "mv -f $outfile.tmp $outfile\n";
+ }
+
+ $_ = substr($line, 1, index($line,"]")-1);
+ $outfile = "$workdir/$prefix$_.$ext";
+
+ # open the template file - ignore sections for which no
+ # templates exist
+ unless(open(TEMPLATE, $outfile)) {
+ print STDERR "Warning: No template found for item $_: $outfile: $!\n";
+ next;
+ }
+
+ # open output file
+ unless (open(OUTFILE, "> $outfile.tmp")) {
+ print STDERR "Can't create output file $outfile.tmp: $!\n";
+ exit -1;
+ }
+
+ # Pass the head of the template to the output file
+KEY: while (<TEMPLATE>) {
+ print OUTFILE;
+ last KEY if (/$key/);
+ }
+
+ } else {
+ # split locale = "value" into 2 strings
+ ($locale, $value) = split(' = ', $line);
+
+ if ( $locale ne $line ) {
+ # replace en-US with en
+ $locale=~s/en-US/en/;
+
+ # use just anything inside the ""
+ $value = substr($value, index($value, "\"") + 1, rindex($value, "\"") - 1);
+
+ # replace resource placeholder
+ $value=~s/%PRODUCTNAME/$productname/g;
+
+ $locale=~s/-/_/;
+ if ($ext eq "desktop") {
+ print OUTFILE "$key\[$locale\]=$value\n";
+ } else {
+ print OUTFILE "\t\[$locale\]$key=$value\n";
+ }
+ }
+ }
+}
+
+while (<TEMPLATE>) {
+ print OUTFILE;
+}
+
+if (close(OUTFILE)) {
+ system "mv -f $outfile.tmp $outfile\n";
+}
+
+close(TEMPLATE);