Update ooo320-m1
[ooovba.git] / setup_native / source / packinfo / shellscripts_extensions.txt
blob2d9056b6b15363bf4403a5fbd333494537365e2a
1 %system solaris
3 %postinstall << END
5 if [ -n "$$TMPDIR" ]; then
6   UNOPKGTMP="$$TMPDIR"
7 elif [ -n "$$TMP" ]; then
8   UNOPKGTMP="$$TMP"
9 elif [ -d "/tmp" ]; then
10   UNOPKGTMP="/tmp"
11 else
12   echo "No tmp directory found!"
13   exit 1
16 #Create the command which creates a temporary directory
17 if [ -x "/usr/bin/mktemp" ]
18 then
19   INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
20 else
21   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
22   mkdir "$$INSTDIR"
26 # Need to check diskless service install and make sure use the correct unpkg 
28 DISKLESS_SRVC=`echo $$BASEDIR | /usr/bin/grep export/Solaris_[1-9][0-9]/usr_$${ARCH}.all`
29 if [  "$$DISKLESS_SRVC" ]; then
30         UNOPKG=/export/Solaris_11/usr_`uname -p`.all/opt/staroffice9/program/unopkg
31         POSTRUN=$$PKG_INSTALL_ROOT/usr_`uname -p`.all/usr/lib/postrun
32         CLIENT_BASEDIR=$$PKG_INSTALL_ROOT/usr_$${ARCH}.all
33 else
34         UNOPKG=$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg
35         POSTRUN=$$PKG_INSTALL_ROOT/usr/lib/postrun
37 # Use postrun command on Solaris where available (OpenSolaris)
38 if [ -x $$POSTRUN ]; then
39 ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
40   echo "umask 022"
41   echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" add --shared --bundled \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}\" \"-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'"
42 ) | $$POSTRUN -b -c UNOPKG
43   if [ "$$?" != "0" ]; then
44     echo "\nERROR: Installation of UNO extension ${OXTFILENAME}"
45     echo " through $$POSTRUN failed."
46     exit 1
47   fi
48 else
49   # No postrun available, try running unopkg directly
50   "$$UNOPKG" add --shared --bundled "$$BASEDIR/PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-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'
51   if [ "$$?" != "0" ]; then
52     echo "\nERROR: Installation of UNO extension ${OXTFILENAME} failed."
53     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed"
54     echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
55     exit 1
56   fi
59 if [ -n "$$INSTDIR" ]; then
60   rm -rf "$$INSTDIR"
63 exit 0
64 END
66 %preremove << END
67 if [ -n "$$TMPDIR" ]; then
68   UNOPKGTMP="$$TMPDIR"
69 elif [ -n "$$TMP" ]; then
70   UNOPKGTMP="$$TMP"
71 elif [ -d "/tmp" ]; then
72   UNOPKGTMP="/tmp"
73 else
74   echo "No tmp directory found!"
75   exit 1
78 #Create the command which creates a temporary directory
79 if [ -x "/usr/bin/mktemp" ]
80 then
81   INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
82 else
83   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
84   mkdir "$$INSTDIR"
87 # Use postrun command on Solaris where available (OpenSolaris)
88 if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
89 ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
90   echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
91   echo "umask 022"
92   echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" remove --shared --bundled \"${OXTFILENAME}\" \"-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'"
93   echo "rm -rf \"$$INSTDIR\""
94 ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG
95 else
96   # No postrun available, try running unopkg directly
97   test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0  
98   "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-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'
99   if [ "$$?" != "0" ]; then
100     echo "\nERROR: Removal of UNO extension ${OXTFILENAME} failed."
101     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed"
102     echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
103     exit 1
104   fi
107 if [ -n "$$INSTDIR" ]; then
108   rm -rf "$$INSTDIR"
111 exit 0  
114 %system linux
116 %format rpm
118 # As remove does not need the oxt file, this could potentially 
119 # be done in the postinstall script as well.
120 %preinstall << END
121 # if this is an update, remove the old package instance first
122 test "$$1" = "2" || exit 0
124 #Find the temp dir
125 if [ -n "$$TMPDIR" ]; then
126   UNOPKGTMP="$$TMPDIR"
127 elif [ -n "$$TMP" ]; then
128   UNOPKGTMP="$$TMP"
129 elif [ -d "/tmp" ]; then
130   UNOPKGTMP="/tmp"
131 else
132   echo "No tmp directory found!"
133   exit 1
136 #Create the command which creates a temporary directory
137 if [ -x "/bin/mktemp" ]
138 then
139   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
140 else
141   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
142   mkdir "$$INSTDIR"
145 if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
146   "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-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'
149 if [ -n "$$INSTDIR" ]; then
150   rm -rf "$$INSTDIR"
153 exit 0
156 %postinstall << END
157 #Find the temp dir
158 if [ -n "$$TMPDIR" ]; then
159   UNOPKGTMP="$$TMPDIR"
160 elif [ -n "$$TMP" ]; then
161   UNOPKGTMP="$$TMP"
162 elif [ -d "/tmp" ]; then
163   UNOPKGTMP="/tmp"
164 else
165   echo "No tmp directory found!"
166   exit 1
169 #Create the command which creates a temporary directory
170 if [ -x "/bin/mktemp" ]
171 then
172   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
173 else
174   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
175   mkdir "$$INSTDIR"
178 if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
179   "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" add --shared --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' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
182 if [ -n "$$INSTDIR" ]; then
183   rm -rf "$$INSTDIR"
186 exit 0
191 %preremove << END
192 # if this is an update, just do nothing
193 test "$$1" = "0" || exit 0
195 #Find the temp dir
196 if [ -n "$$TMPDIR" ]; then
197   UNOPKGTMP="$$TMPDIR"
198 elif [ -n "$$TMP" ]; then
199   UNOPKGTMP="$$TMP"
200 elif [ -d "/tmp" ]; then
201   UNOPKGTMP="/tmp"
202 else
203   echo "No tmp directory found!"
204   exit 1
207 #Create the command which creates a temporary directory
208 if [ -x "/bin/mktemp" ]
209 then
210   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
211 else
212   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
213   mkdir "$$INSTDIR"
216 if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
217   "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-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'
220 if [ -n "$$INSTDIR" ]; then
221   rm -rf "$$INSTDIR"
224 exit 0
227 %format deb
229 # As remove does not need the oxt file, this could potentially 
230 # be done in the postinstall script as well.
231 %preinstall << END
232 # if this is an update, remove the old package instance first
233 if [ "$$1" != "upgrade" ]
234 then
235   exit 0
238 #Find the temp dir
239 if [ -n "$$TMPDIR" ]
240 then
241   UNOPKGTMP="$$TMPDIR"
242 elif [ -n "$$TMP" ]
243 then
244   UNOPKGTMP="$$TMP"
245 elif [ -d "/tmp" ]
246 then
247   UNOPKGTMP="/tmp"
248 else
249   echo "No tmp directory found!"
250   exit 1
254 #Create the command which creates a temporary directory
255 if [ -x "/bin/mktemp" ]
256 then
257   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
258 else
259   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
260   mkdir "$$INSTDIR"
263 if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]
264 then
265   "PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-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'
268 if [ -n "$$INSTDIR" ]
269 then
270   rm -rf "$$INSTDIR"
273 exit 0
276 %postinstall << END
277 #Find the temp dir
278 if [ -n "$$TMPDIR" ]
279 then
280   UNOPKGTMP="$$TMPDIR"
281 elif [ -n "$$TMP" ]
282 then
283   UNOPKGTMP="$$TMP"
284 elif [ -d "/tmp" ]
285 then
286   UNOPKGTMP="/tmp"
287 else
288   echo "No tmp directory found!"
289   exit 1
292 #Create the command which creates a temporary directory
293 if [ -x "/bin/mktemp" ]
294 then
295   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
296 else
297   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
298   mkdir "$$INSTDIR"
301 if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then
302   "PRODUCTDIRECTORYNAME/program/unopkg" add --shared --bundled "PRODUCTDIRECTORYNAME/share/extension/install/${OXTFILENAME}" "-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'
305 if [ -n "$$INSTDIR" ]
306 then
307   rm -rf "$$INSTDIR"
310 exit 0
315 %preremove << END
316 # if this is an update, just do nothing
318 if [ "$$1" = "upgrade" ]
319 then
320   exit 0
323 #Find the temp dir
324 if [ -n "$$TMPDIR" ]
325 then
326   UNOPKGTMP="$$TMPDIR"
327 elif [ -n "$$TMP" ]
328 then
329   UNOPKGTMP="$$TMP"
330 elif [ -d "/tmp" ]
331 then
332   UNOPKGTMP="/tmp"
333 else
334   echo "No tmp directory found!"
335   exit 1
338 #Create the command which creates a temporary directory
339 if [ -x "/bin/mktemp" ]
340 then
341   INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
342 else
343   INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
344   mkdir "$$INSTDIR"
347 if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]
348 then
349   "PRODUCTDIRECTORYNAME/program/unopkg" remove --shared --bundled "${OXTFILENAME}" "-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'
352 if [ -n "$$INSTDIR" ]
353 then
354   rm -rf "$$INSTDIR"
357 exit 0
360 %system all