Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / packinfo / shellscripts_extensions.txt
blob3ab47f9258022954032f1c3e13e0fbb36bd61663
1 %system solaris
3 %postinstall << END
6 # Need to check diskless service install and make sure use the correct unpkg 
8 DISKLESS_SRVC=`echo $$BASEDIR | /usr/bin/grep export/Solaris_[1-9][0-9]/usr_$${ARCH}.all`
9 if [  "$$DISKLESS_SRVC" ]; then
10         UNOPKG=/export/Solaris_11/usr_`uname -p`.allPRODUCTDIRECTORYNAME/program/unopkg
11         POSTRUN=$$PKG_INSTALL_ROOT/usr_`uname -p`.all/usr/lib/postrun
12         CLIENT_BASEDIR=$$PKG_INSTALL_ROOT/usr_$${ARCH}.all
13 else
14         UNOPKG=$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg
15         POSTRUN=$$PKG_INSTALL_ROOT/usr/lib/postrun
17 # Use postrun command on Solaris where available (OpenSolaris)
18 if [ -x $$POSTRUN ]; then
19 ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
20   echo "umask 022"
21   echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
22   echo  "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
23 ) | $$POSTRUN -b -c UNOPKG
24   if [ "$$?" != "0" ]; then
25     echo "\nERROR: Installation of UNO extensions"
26     echo " through $$POSTRUN failed."
27     exit 1
28   fi
29 else
30   # No postrun available, try running unopkg directly
31   "$$UNOPKG" sync
32  find "$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
33   if [ "$$?" != "0" ]; then
34     echo "\nERROR: Installation of UNO extensions failed."
35     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root install requires SUNWpostrun package to be installed"
36     echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
37     exit 1
38   fi
41 exit 0
42 END
44 %postremove << END
46 # Use postrun command on Solaris where available (OpenSolaris)
47 if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
48 ( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
49   echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
50   echo "umask 022"
51   echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
52   echo  "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
53 ) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG
54 else
55   # No postrun available, try running unopkg directly
56   test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0  
57   "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync
58   echo  "find \"$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
59   if [ "$$?" != "0" ]; then
60     echo "\nERROR: Removal of UNO extension failed."
61     test "$$BASEDIR" = "$$CLIENT_BASEDIR" || echo "ERROR: alternate root uninstall requires SUNWpostrun package to be installed"
62     echo 'ERROR: Make sure the runtime requirements (operating system, patch level, architecture) are met.'
63     exit 1
64   fi
68 exit 0  
69 END
71 %system linux
73 %format rpm
75 %postinstall << END
77 if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
78   "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync 
79   if [ "$$?" != "0" ]; then
80     echo "ERROR: Registration of extensions failed!"
81     exit 1
82   else
83     echo "SUCCESS: unopkg returns successful!"
84   fi
85   find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
88 exit 0
90 END
92 %postremove << END
94 if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
95   "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync 
96   if [ "$$?" != "0" ]; then
97     echo "ERROR: Registration of extensions failed!"
98     exit 1
99   else
100     echo "SUCCESS: unopkg returns successful!"
101   fi
102   find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
105 exit 0
108 %format deb
110 %postinstall << END
112 if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then
113   "PRODUCTDIRECTORYNAME/program/unopkg" sync 
114   if [ "$$?" != "0" ]; then
115     echo "ERROR: Registration of extensions failed!"
116     exit 1
117   else
118     echo "SUCCESS: unopkg returns successful!"
119   fi
120   find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
123 exit 0
127 %postremove << END
129 if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]
130 then
131   "PRODUCTDIRECTORYNAME/program/unopkg" sync 
132   if [ "$$?" != "0" ]; then
133     echo "ERROR: Registration of extensions failed!"
134     exit 1
135   else
136     echo "SUCCESS: unopkg returns successful!"
137   fi
138  find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
141 exit 0
144 %system all