path: root/setup_native
diff options
authorIvo Hinkelmann <>2009-10-27 18:23:06 +0000
committerIvo Hinkelmann <>2009-10-27 18:23:06 +0000
commitd9e6f47543d2cc8b9478c52be27e87c5f71d1b7b (patch)
treedc52e8a10a33533233e2e6606caeb0ff542931cd /setup_native
parent9af6f6a5b1b86dd39da0ed3031d73496d23f4efd (diff)
CWS-TOOLING: integrate CWS jl133
2009-10-20 11:47:23 +0200 jl r277045 : CWS-TOOLING: rebase CWS jl133 to branches/OOO320@276942 (milestone: OOO320:m2) 2009-09-30 12:23:43 +0200 jl r276551 : #i103747# added dependency to local filesystem service 2009-09-14 14:12:18 +0200 jl r276113 : #i103747# 2009-09-14 14:09:41 +0200 jl r276112 : #i103747# 2009-09-14 13:24:20 +0200 jl r276108 : #i103747# 2009-09-11 08:27:43 +0200 jl r276049 : #i103747# changes for opensolaris bundled extensions 2009-09-11 08:21:36 +0200 jl r276048 : #i103747# changes for opensolaris bundled extensions
Diffstat (limited to 'setup_native')
6 files changed, 286 insertions, 0 deletions
diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst
index a573b94fd5cb..9d429454ebba 100644
--- a/setup_native/prj/d.lst
+++ b/setup_native/prj/d.lst
@@ -8,6 +8,7 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\%__SRC%\bin\uninstall %_DEST%\bin%_EXT%\userscripts\uninstall
..\%__SRC%\bin\noarch\fake-db-1.0-0.noarch.rpm %_DEST%\bin%_EXT%\
+mkdir: %_DEST%\bin%_EXT%\osolsmf
..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv
..\%__SRC%\bin\ %_DEST%\bin%_EXT%\
..\%__SRC%\bin\ %_DEST%\bin%_EXT%\
@@ -33,6 +34,10 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif
..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat
..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat
+..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed
+..\source\opensolaris\bundledextensions\README %_DEST%\bin%_EXT%\osolsmf\README
+..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml
+..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions
..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile
..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt
..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp
diff --git a/setup_native/source/opensolaris/bundledextensions/README b/setup_native/source/opensolaris/bundledextensions/README
new file mode 100644
index 000000000000..f64c225d9df9
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/README
@@ -0,0 +1,80 @@
+Installation information
+In order to properly install the bundled extensions, such as dictionaries, it is
+necessary that the files
+are part of the IPS package. They must be added to the package
+after all other files have been added. Those other files are the SVR4 packages
+of OOo which can be imported by pkg (pkg import).
+The files have to be uploaded this way:
+pkgsend -s url_to_pkg_server add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s url_to_pkg_server add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s url_to_pkg_server add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+${EXTENSIONPATH} must be replaced by the path to the folder containing the
+bundled extensions. This path changes with every major release of OOo because of
+the version number which is part of a folder name. The
+current value is:
+The service was tested with OpenSolaris release 2009.6 and may not work with a
+previous release.
+What do these files do
+The three files constitute a SMF service. When this service is started, then it
+installes the bundled extensions which are contained in
+/opt/openoffice.org3/share/extension/install. To install them, the service calls
+"unopkg add --shared ..." with the appropriate arguments.
+The service is started initially after the installation of
+ooo_bundled_extensions.xml. At this time, all files of OOo, including the
+extensions, have been copied to their destination. The service calls unopkg on
+behalf of every extension and adds the path to that extension to the file
+'installed'. The file 'installed' is used to remember what extensions have
+already been installed with unopkg. This will prevent to reinstall those
+extensions whenever the service is restarted.
+When a new version of OOo becomes available, then the respective OOo package
+containes a new version of 'installed'. That is, it contains a version string,
+such as 3.2.0. The sole reason for that string is, to change the content of this
+file in every release. Otherwise IPS would not replace the installed version of
+'installed' with the one contained in the package.
+The update procedure of OOo will replace 'installed'. 'installed' is associated
+with a restart_fmri of the service ooo_bundled_extensions. That is after
+copying 'installed' the service will be restarted. It then installes all
+extensions contained in /opt/openoffice.org3/share/extension/install, because
+the newly installed 'installed' file does not contain any entries yet, except
+for the version string.
+Known issues
+If OOo, which contains this service, is uninstalled and later it is installed
+again, then the bundled extensions are not installed. That is, unopkg is not
+called to install them with OOo's Extensions Manager. The reasons is a bug in
+To work around this, one can call after uninstalling OOo
+svccfg delete -f ooo_bundled_extensions
+svccfg delete smf/manifest
diff --git a/setup_native/source/opensolaris/bundledextensions/installed b/setup_native/source/opensolaris/bundledextensions/installed
new file mode 100644
index 000000000000..0c8d8df5ae26
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/installed
@@ -0,0 +1 @@
diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
new file mode 100644
index 000000000000..66acd508c281
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="ooo_bundled_extensions">
+ name="application/ooo_bundled_extensions"
+ type="service"
+ version="1">
+ <create_default_instance enabled="true" />
+ <single_instance/>
+ <dependency name="service_available"
+ grouping="require_all"
+ restart_on="none"
+ type="service">
+ <service_fmri value="svc:/system/filesystem/local:default" />
+ </dependency>
+ <exec_method
+ type="method" name="start"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions start"
+ timeout_seconds="160">
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+ <exec_method
+ type="method" name="stop"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions stop"
+ timeout_seconds="160" >
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring"
+ value="transient" />
+ <propval name="ignore_error"
+ type="astring" value="core,signal" />
+ </property_group>
+ <stability value="Unstable" />
+ <template>
+ <common_name>
+ <loctext xml:lang="C">
+ Installation of's bundled extensions.
+ </loctext>
+ </common_name>
+ </template>
diff --git a/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
new file mode 100644
index 000000000000..696277011133
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
@@ -0,0 +1,108 @@
+. /lib/svc/share/
+#The start method is used for installing and updating the
+#extensions. The service keeps a list
+#(share/extensions/install/installed) of the extensions which were
+#already installed. During installation, the bundled extensions are
+#copied to the install folder (share/extensions/install). Finally this
+#service, which is part of the office installation package, will be
+#started and the start "method" of this script is called. Then all
+#extensions in the "install" folder are checked if they are already
+#installed by reading the list "installed". Because the list is empty
+#at this time, all the extensions will be installed.
+#If this service is restarted then the script checks if there is an
+#extensions which is not yet installed, that is there is no entry for
+#it in the 'installed' file. Only if this is the case then that
+#extensions will be installed and its path is added to 'installed'.
+#In case of an update, new versions of existing extensions and
+#completely new extensions may be copied to the 'install' folder. Also
+#a new 'installed' file will be copied which replaces the existing
+#file. The new 'installed' file does not contain any entries of
+#installed extensions. Therefore the next time when the start method is
+#run all extensions contained in share/extensions/install will be
+#Create the folder which contains the temporary user installation
+INSTDIR=`/usr/bin/mktemp -d "/tmp/userinstall.XXXXXX"`
+case "$1" in
+ EXTENSIONDIR=/opt/${OOOBRANDPACKAGEVERSION}/share/extension/install
+ for FILE in $EXTENSIONDIR/*.oxt
+ do
+ #We check if the file exist, because if there is no extension
+ #then $FILE will contain "<..>/*.oxt"
+ if [ -f "$FILE" ]; then
+ #Determine if this extension is already installed. We do
+ #that by checking the file "installed" which contains a
+ #list of all installed extensions including the full path
+ if [ -z "$INSTALLED" ]; then
+ #We have not found the name of the extension in the
+ #list. That is, it has not been installed (with unopkg) yet.
+ #Therefore we do it now.
+ echo installing $FILE
+ /opt/${OOOBRANDPACKAGEVERSION}/program/unopkg add --shared --bundled "$FILE" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ #Let us remember that this extensions has been installed
+ #by adding the path name of the extension to the file
+ #installed
+ echo $FILE >> $EXTENSIONDIR/installed
+ fi
+ fi
+ done
+ #Now check for extensions which need to be uninstalled
+ #(unopkg). This is the case if the list of extensions in the file
+ #installed contains the name of an extension which does not exist
+ #in the the folder <..>/share/extension/install.
+# LINE=""
+# LIST=`cat $EXTENSIONDIR/installed`
+# #remove blank lines
+# LIST=`echo "$LIST" | sed '/^[:blank:]*$/d'`
+# echo "$LIST" | while [ 1 ]
+# do
+# read LINE || break
+# if [ ! -f "$LINE" ]; then
+# #The extension file has been removed from
+# #share/extension/install. Now we remove the installed
+# #extension
+# echo removing `basename $LINE`
+# /opt/${OOOBRANDPACKAGEVERSION}/program/unopkg remove --shared --bundled "`basename $LINE`" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+# else
+# fi
+# done
+# #Write the new list to the file "installed". It now has all names
+# #remove which refered to previously removed extensions (removed
+# #from .../share/extension/install)
+# if [ "$REMOVED" ]; then
+# #remove the last empty line
+# NEWCONTENT=`echo "$NEWCONTENT" | sed '/^[:space:]*$/d'`
+# echo "$NEWCONTENT" > $EXTENSIONDIR/installed
+# fi
+ ;;
+ 'stop')
+ echo "#### stop ####"
+ ;;
+ *)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+exit $SMF_EXIT_OK
diff --git a/setup_native/tests/opensolaris/bundledextensions/send_ooo b/setup_native/tests/opensolaris/bundledextensions/send_ooo
new file mode 100644
index 000000000000..669e63ceda1b
--- /dev/null
+++ b/setup_native/tests/opensolaris/bundledextensions/send_ooo
@@ -0,0 +1,32 @@
+#! /bin/bash
+if [ $# = 0 ]
+echo "usage: send_ooo path_to_pkg_folder
+The files
+must be in the current directory. The pkg.depotd or the service
+application/pkg/server must listen to port 80"
+eval `pkgsend -s http://localhost:80 open ooo_test@3.2-1`
+pkgsend -s http://localhost:80 import $1/openofficeorg-ure
+pkgsend -s http://localhost:80 import $1/ooobasis*
+pkgsend -s http://localhost:80 import $1/openofficeorg3*
+pkgsend -s http://localhost:80 add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s http://localhost:80 add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s http://localhost:80 add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+pkgsend -s http://localhost:80 add set name=description value="OOo 3.2 with dictionaries: en fr es da de"
+pkgsend -s http://localhost:80 close