ooo-build r12099 - in trunk: . patches/src680



Author: szalaik
Date: Thu Apr  3 19:48:48 2008
New Revision: 12099
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12099&view=rev

Log:
2008-04-03  Kalman Szalai - KAMI <kamihir freemail hu>

	* patches/src680/extensions_shellscripts.diff: Patch shellscript for
	extension installation - hacky script, for OxygenOffice Professional
	this time. I will improve it soon.



Modified:
   trunk/ChangeLog
   trunk/patches/src680/extensions_shellscripts.diff

Modified: trunk/patches/src680/extensions_shellscripts.diff
==============================================================================
--- trunk/patches/src680/extensions_shellscripts.diff	(original)
+++ trunk/patches/src680/extensions_shellscripts.diff	Thu Apr  3 19:48:48 2008
@@ -1,52 +1,395 @@
---- setup_native/source/packinfo/shellscripts_extensions.txt.orig	2007-09-06 12:03:18.000000000 +0200
-+++ setup_native/source/packinfo/shellscripts_extensions.txt	2008-03-22 09:52:34.000000000 +0100
-@@ -28,7 +28,7 @@
- fi
- 
- if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
--  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
-+  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
- fi
- 
- if [ -n "$$INSTDIR" ]; then
-@@ -61,7 +61,7 @@
- fi
- 
- if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
--  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
-+  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
- fi
- 
- if [ -n "$$INSTDIR" ]; then
-@@ -99,7 +99,7 @@
- fi
- 
- if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
--  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
-+  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
- fi
- 
- if [ -n "$$INSTDIR" ]; then
-@@ -109,6 +109,122 @@
- exit 0
- END
- 
-+# Start of deb package script #################
+--- setup_native/source/packinfo/shellscripts_extensions.txt.orig	2008-04-03 20:41:51.000000000 +0200
++++ setup_native/source/packinfo/shellscripts_extensions.txt	2008-04-03 20:41:47.000000000 +0200
+@@ -1,208 +1,414 @@
+-%system linux
+-
+-# As remove does not need the oxt file, this could potentially 
+-# be done in the postinstall script as well.
+-%preinstall << END
+-# if this is an update, remove the old package instance first
+-test "$$1" = "2" || exit 0
+-
+-#Find the temp dir
+-if [ -n "$$TMPDIR" ]; then
+-  UNOPKGTMP="$$TMPDIR"
+-elif [ -n "$$TMP" ]; then
+-  UNOPKGTMP="$$TMP"
+-elif [ -d "/tmp" ]; then
+-  UNOPKGTMP="/tmp"
+-else
+-  echo "No tmp directory found!"
+-  exit 1
+-fi
+-
+-#Create the command which creates a temporary directory
+-if [ -x "/bin/mktemp" ]
+-then
+-  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
+-else
+-  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
+-  mkdir "$$INSTDIR"
+-fi
+-
+-if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
+-  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
+-fi
+-
+-if [ -n "$$INSTDIR" ]; then
+-  rm -rf "$$INSTDIR"
+-fi
+-
+-exit 0
+-END
+-
+-%postinstall << END
+-#Find the temp dir
+-if [ -n "$$TMPDIR" ]; then
+-  UNOPKGTMP="$$TMPDIR"
+-elif [ -n "$$TMP" ]; then
+-  UNOPKGTMP="$$TMP"
+-elif [ -d "/tmp" ]; then
+-  UNOPKGTMP="/tmp"
+-else
+-  echo "No tmp directory found!"
+-  exit 1
+-fi
+-
+-#Create the command which creates a temporary directory
+-if [ -x "/bin/mktemp" ]
+-then
+-  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
+-else
+-  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
+-  mkdir "$$INSTDIR"
+-fi
+-
+-if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
+-  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
+-fi
+-
+-if [ -n "$$INSTDIR" ]; then
+-  rm -rf "$$INSTDIR"
+-fi
+-
+-exit 0
+-
+-
+-END
+-
+-%preremove << END
+-# if this is an update, just do nothing
+-test "$$1" = "0" || exit 0
+-
+-#Find the temp dir
+-if [ -n "$$TMPDIR" ]; then
+-  UNOPKGTMP="$$TMPDIR"
+-elif [ -n "$$TMP" ]; then
+-  UNOPKGTMP="$$TMP"
+-elif [ -d "/tmp" ]; then
+-  UNOPKGTMP="/tmp"
+-else
+-  echo "No tmp directory found!"
+-  exit 1
+-fi
+-
+-#Create the command which creates a temporary directory
+-if [ -x "/bin/mktemp" ]
+-then
+-  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
+-else
+-  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
+-  mkdir "$$INSTDIR"
+-fi
+-
+-if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
+-  "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
+-fi
+-
+-if [ -n "$$INSTDIR" ]; then
+-  rm -rf "$$INSTDIR"
+-fi
+-
+-exit 0
+-END
+-
+-%system solaris
+-
+-%postinstall << END
+-
+-if [ -n "$$TMPDIR" ]; then
+-  UNOPKGTMP="$$TMPDIR"
+-elif [ -n "$$TMP" ]; then
+-  UNOPKGTMP="$$TMP"
+-elif [ -d "/tmp" ]; then
+-  UNOPKGTMP="/tmp"
+-else
+-  echo "No tmp directory found!"
+-  exit 1
+-fi
+-
+-#Create the command which creates a temporary directory
+-if [ -x "/usr/bin/mktemp" ]
+-then
+-  INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
+-else
+-  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
+-  mkdir "$$INSTDIR"
+-fi
+-
+-# Use postrun command on Solaris where available (OpenSolaris)
+-if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
+-( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
+-  echo "umask 022"
+-  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
+-) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
+-else
+-  # No postrun available, try running unopkg directly
+-  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
+-  if [ "$$?" != "0" ]; then
+-    echo "\nERROR: Installation of UNO extension ${OXTFILENAME} failed."
+-    test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed"
+-    echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
+-    exit 1
+-  fi
+-fi
+-
+-if [ -n "$$INSTDIR" ]; then
+-  rm -rf "$$INSTDIR"
+-fi
+-
+-exit 0  
+-END
+-
+-%preremove << END
+-if [ -n "$$TMPDIR" ]; then
+-  UNOPKGTMP="$$TMPDIR"
+-elif [ -n "$$TMP" ]; then
+-  UNOPKGTMP="$$TMP"
+-elif [ -d "/tmp" ]; then
+-  UNOPKGTMP="/tmp"
+-else
+-  echo "No tmp directory found!"
+-  exit 1
+-fi
+-
+-#Create the command which creates a temporary directory
+-if [ -x "/usr/bin/mktemp" ]
+-then
+-  INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
+-else
+-  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
+-  mkdir "$$INSTDIR"
+-fi
+-
+-# Use postrun command on Solaris where available (OpenSolaris)
+-if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
+-( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
+-  echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
+-  echo "umask 022"
+-  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared \"${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
+-  echo "rm -rf \"$$INSTDIR\""
+-) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
+-else
+-  # No postrun available, try running unopkg directly
+-  test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0  
+-  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
+-  if [ "$$?" != "0" ]; then
+-    echo "\nERROR: Removal of UNO extension ${OXTFILENAME} failed."
+-    test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed"
+-    echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
+-    exit 1
+-  fi
+-fi
+-
+-if [ -n "$$INSTDIR" ]; then
+-  rm -rf "$$INSTDIR"
+-fi
+-
+-exit 0  
+-END
+-
+-%system all
++%format rpm
++# As remove does not need the oxt file, this could potentially 
++# bee done in the postinstall script as well.
++%preinstall << END
++# if this is an update, remove the old package instance first
++
++if [ "$$1" != "2" ]
++then
++  exit 0
++fi
++
++#Find the temp dir
++if [ -n "$$TMPDIR" ]
++then
++  UNOPKGTMP="$$TMPDIR"
++elif [ -n "$$TMP" ]
++then
++  UNOPKGTMP="$$TMP"
++elif [ -d "/tmp" ]
++then
++  UNOPKGTMP="/tmp"
++else
++  echo "No tmp directory found!"
++  exit 1
++fi
++
++#Create the command which creates a temporary directory
++if [ -x "/bin/mktemp" ]
++then
++  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++else
++  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
++  mkdir "$$INSTDIR"
++fi
 +
-+%system deb
++echo "Searching unopkg...\n\n"
++#possible OOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++if [ -x "$${OOOPATH}/program/unopkg" ]
++then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++  echo "."
++fi
++
++echo "\nDone\n."
++
++if [ -n "$$INSTDIR" ]
++then
++  rm -rf "$$INSTDIR"
++fi
++
++exit 0
++END
++
++%postinstall << END
++#Find the temp dir
++if [ -n "$$TMPDIR" ]
++then
++  UNOPKGTMP="$$TMPDIR"
++elif [ -n "$$TMP" ]
++then
++  UNOPKGTMP="$$TMP"
++elif [ -d "/tmp" ]
++then
++  UNOPKGTMP="/tmp"
++else
++  echo "No tmp directory found!"
++  exit 1
++fi
++
++#Create the command which creates a temporary directory
++
++if [ -x "/bin/mktemp" ]
++then
++  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++else
++  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
++  mkdir "$$INSTDIR"
++fi
++
++echo "Searching unopkg...\n\n"
++#possible OOOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++
++if [ -x "$${OOOPATH}/program/unopkg" ]
++then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" add --shared "$${OOOPATH}/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++echo "."
++fi
++
++echo "\nDone\n."
++
++if [ -n "$$INSTDIR" ]
++then
++  rm -rf "$$INSTDIR"
++fi
++
++exit 0
++
++END
++
++%preremove << END
++# if this is an update, just do nothing
++
++if [ "$$1" = "1" ]
++then
++  exit 0
++fi
++
++#Find the temp dir
++if [ -n "$$TMPDIR" ]
++then
++  UNOPKGTMP="$$TMPDIR"
++elif [ -n "$$TMP" ]
++then
++  UNOPKGTMP="$$TMP"
++elif [ -d "/tmp" ]
++then
++  UNOPKGTMP="/tmp"
++else
++  echo "No tmp directory found!"
++  exit 1
++fi
++
++#Create the command which creates a temporary directory
++if [ -x "/bin/mktemp" ]
++then
++  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++else
++  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
++  mkdir "$$INSTDIR"
++fi
++
++echo "Searching unopkg...\n\n"
++#possible OOOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++
++if [ -x "$${OOOPATH}/program/unopkg" ]
++then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++  echo "."
++fi
++echo "\nDone\n."
++
++if [ -n "$$INSTDIR" ]
++then
++  rm -rf "$$INSTDIR"
++fi
++
++exit 0
++END
++
++
++%format deb
++#Start DEB
 +
 +# As remove does not need the oxt file, this could potentially 
 +# be done in the postinstall script as well.
 +%preinstall << END
 +# if this is an update, remove the old package instance first
-+test "$$1" = "upgrade" || exit 0
++
++if [ "$$1" != "upgrade" ]
++then
++  exit 0
++fi
 +
 +#Find the temp dir
-+if [ -n "$$TMPDIR" ]; then
++if [ -n "$$TMPDIR" ]
++then
 +  UNOPKGTMP="$$TMPDIR"
-+elif [ -n "$$TMP" ]; then
++elif [ -n "$$TMP" ]
++then
 +  UNOPKGTMP="$$TMP"
-+elif [ -d "/tmp" ]; then
++elif [ -d "/tmp" ]
++then
 +  UNOPKGTMP="/tmp"
 +else
 +  echo "No tmp directory found!"
@@ -62,11 +405,20 @@
 +  mkdir "$$INSTDIR"
 +fi
 +
-+if [ -x "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
-+  "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
++echo "Searching unopkg...\n\n"
++#possible OOOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++if [ -x "$${OOOPATH}/program/unopkg" ]
++then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++  echo "."
 +fi
++echo "\nDone\n."
 +
-+if [ -n "$$INSTDIR" ]; then
++if [ -n "$$INSTDIR" ]
++then
 +  rm -rf "$$INSTDIR"
 +fi
 +
@@ -75,11 +427,14 @@
 +
 +%postinstall << END
 +#Find the temp dir
-+if [ -n "$$TMPDIR" ]; then
++if [ -n "$$TMPDIR" ]
++then
 +  UNOPKGTMP="$$TMPDIR"
-+elif [ -n "$$TMP" ]; then
++elif [ -n "$$TMP" ]
++then
 +  UNOPKGTMP="$$TMP"
-+elif [ -d "/tmp" ]; then
++elif [ -d "/tmp" ]
++then
 +  UNOPKGTMP="/tmp"
 +else
 +  echo "No tmp directory found!"
@@ -95,11 +450,20 @@
 +  mkdir "$$INSTDIR"
 +fi
 +
-+if [ -x "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
-+  "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
++echo "Searching unopkg...\n\n"
++#possible OOOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++
++if [ -x "$${OOOPATH}/program/unopkg" ]; then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" add --shared "$${OOOPATH}/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++  echo "."
 +fi
++echo "\nDone\n."
 +
-+if [ -n "$$INSTDIR" ]; then
++if [ -n "$$INSTDIR" ]
++then
 +  rm -rf "$$INSTDIR"
 +fi
 +
@@ -110,9 +474,62 @@
 +
 +%preremove << END
 +# if this is an update, just do nothing
-+test "$$1" = "upgrade" || exit 0
++
++if [ "$$1" = "upgrade" ]
++then
++  exit 0
++fi
 +
 +#Find the temp dir
++if [ -n "$$TMPDIR" ]
++then
++  UNOPKGTMP="$$TMPDIR"
++elif [ -n "$$TMP" ]
++then
++  UNOPKGTMP="$$TMP"
++elif [ -d "/tmp" ]
++then
++  UNOPKGTMP="/tmp"
++else
++  echo "No tmp directory found!"
++  exit 1
++fi
++
++#Create the command which creates a temporary directory
++if [ -x "/bin/mktemp" ]
++then
++  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++else
++  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
++  mkdir "$$INSTDIR"
++fi
++
++echo "Searching unopkg...\n\n"
++#possible OOOPATHs ( /opt/openoffice.org2.4/ /usr/lib/openoffice/ /usr/lib/openoffice.org/ /usr/lib/ooo-2.4/ /usr/lib/ooo-2.2/ /usr/lib/ooo-2.0/ /opt/openoffice/ /usr/lib64/openoffice/)
++OOOPATH="/opt/openoffice.org2.4/"
++
++if [ -x "$${OOOPATH}/program/unopkg" ]
++then
++  echo "Found here: $${OOOPATH}\n"
++  "$${OOOPATH}/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++else
++  echo "."
++fi
++echo "\nDone\n."
++
++if [ -n "$$INSTDIR" ]
++then
++  rm -rf "$$INSTDIR"
++fi
++
++exit 0
++END
++
++### End of DEB
++%system solaris
++
++%postinstall << END
++
 +if [ -n "$$TMPDIR" ]; then
 +  UNOPKGTMP="$$TMPDIR"
 +elif [ -n "$$TMP" ]; then
@@ -125,63 +542,84 @@
 +fi
 +
 +#Create the command which creates a temporary directory
-+if [ -x "/bin/mktemp" ]
++if [ -x "/usr/bin/mktemp" ]
 +then
-+  INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++  INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
 +else
 +  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
 +  mkdir "$$INSTDIR"
 +fi
 +
-+if [ -x "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
-+  "PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
++# Use postrun command on Solaris where available (OpenSolaris)
++if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
++( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
++  echo "umask 022"
++  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
++) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
++else
++  # No postrun available, try running unopkg directly
++  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++  if [ "$$?" != "0" ]; then
++    echo "\nERROR: Installation of UNO extension ${OXTFILENAME} failed."
++    test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed"
++    echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
++    exit 1
++  fi
 +fi
 +
 +if [ -n "$$INSTDIR" ]; then
 +  rm -rf "$$INSTDIR"
 +fi
 +
-+exit 0
++exit 0  
 +END
 +
-+# End of deb package script #################
++%preremove << END
++if [ -n "$$TMPDIR" ]; then
++  UNOPKGTMP="$$TMPDIR"
++elif [ -n "$$TMP" ]; then
++  UNOPKGTMP="$$TMP"
++elif [ -d "/tmp" ]; then
++  UNOPKGTMP="/tmp"
++else
++  echo "No tmp directory found!"
++  exit 1
++fi
 +
++#Create the command which creates a temporary directory
++if [ -x "/usr/bin/mktemp" ]
++then
++  INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
++else
++  INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
++  mkdir "$$INSTDIR"
++fi
 +
- %system solaris
- 
- %postinstall << END
-@@ -137,11 +253,16 @@
- if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
- ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
-   echo "umask 022"
--  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
-+  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'"
- ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
++# Use postrun command on Solaris where available (OpenSolaris)
++if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
++( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
++  echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
++  echo "umask 022"
++  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared \"${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
++  echo "rm -rf \"$$INSTDIR\""
++) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
++else
++  # No postrun available, try running unopkg directly
++  test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0  
++  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
 +  if [ "$$?" != "0" ]; then
-+    echo "\nERROR: Installation of UNO extension ${OXTFILENAME}"
-+    echo " through $$PKG_INSTALL_ROOT/usr/lib/postrun failed."
++    echo "\nERROR: Removal of UNO extension ${OXTFILENAME} failed."
++    test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed"
++    echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
 +    exit 1
 +  fi
- else
-   # No postrun available, try running unopkg directly
--  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
-+  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" add --shared "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
-   if [ "$$?" != "0" ]; then
-     echo "\nERROR: Installation of UNO extension ${OXTFILENAME} failed."
-     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed"
-@@ -183,13 +304,13 @@
- ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
-   echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
-   echo "umask 022"
--  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared \"${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$ORIGIN/../share/config/javasettingsunopkginstall.xml'"
-+  echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared \"${OXTFILENAME}\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'"
-   echo "rm -rf \"$$INSTDIR\""
- ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -b -c UNOPKG
- else
-   # No postrun available, try running unopkg directly
-   test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0  
--  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
-+  "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared "${OXTFILENAME}" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml'
-   if [ "$$?" != "0" ]; then
-     echo "\nERROR: Removal of UNO extension ${OXTFILENAME} failed."
-     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed"
++fi
++
++if [ -n "$$INSTDIR" ]; then
++  rm -rf "$$INSTDIR"
++fi
++
++exit 0  
++END
++
++%system all



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]