Version 1.9 :
[macros-openoffice.git] / auf-poste-client-reflets / debian / postinst
index 483c8e0..05dcad2 100644 (file)
@@ -1,16 +1,24 @@
 #!/bin/sh
 
-exit 0
-
 set -e
 
 add_extension() {
   echo -n "Adding extension $1..."
   INSTDIR=`mktemp -d`
-  /usr/lib/openoffice/program/unopkg add --shared $1 \
-    "-env:UserInstallation=file:///$INSTDIR" \
-    '-env:UNO_JAVA_JFW_INSTALL_DATA=$ORIGIN/../share/config/javasettingsunopkginstall.xml' \
-    "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
+  if test -d "/usr/lib/openoffice/basis3.1"
+  then
+    export PYTHONPATH="/usr/lib/openoffice/basis3.1/program"
+    basis=`readlink /usr/lib/openoffice/basis-link`
+    /usr/lib/openoffice/program/unopkg add --shared $1 \
+      "-env:UserInstallation=file:///$INSTDIR" \
+      "-env:UNO_JAVA_JFW_INSTALL_DATA=file:///var/lib/openoffice/$basis/share/config/javasettingsunopkginstall.xml" \
+      "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
+  else
+    /usr/lib/openoffice/program/unopkg add --shared $1 \
+      "-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"
+  fi
   if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
   echo " done."
 }