Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / packinfo / shellscripts_core01.txt
blobdc74977669492cfffa3c3324dc37df4006a32062
1 %preinstall << END
2 END
4 %postinstall << END
6 # echo Command after installing
7 # searching for the PRODUCTINSTALLLOCATION for the different platforms
8 platform=`uname -s`
9 case $$platform in
10 SunOS)
11   UREPACKAGE=SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure
12   UREDIR=`pkginfo -r $$UREPACKAGE`
13   PRODUCTINSTALLLOCATION="$$BASEDIR"
14   ;;
15 Linux)
16   UREPACKAGE=UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure
17   UREDIR=`rpm -q --queryformat "%{INSTALLPREFIX}" $$UREPACKAGE`
18   PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX"
19   ;;
21   PRODUCTINSTALLLOCATION="$$BASEDIR" 
22   ;;
23 esac
25 # creating link to ure
26 if [ -d $$UREDIR/libreoffice/ure ]
27 then
28       ln -s $$UREDIR/libreoffice/ure $$PRODUCTINSTALLLOCATION/libreoffice/basisBASISDIRECTORYVERSION/ure-link >/dev/null 2>&1
29 else
30       ln -s ../ure $$PRODUCTINSTALLLOCATION/libreoffice/basisBASISDIRECTORYVERSION/ure-link >/dev/null 2>&1
33 exit 0
34 END
36 %preremove << END
37 END
39 %postremove << END
40 # echo Command after removing
42 LASTUNINSTALL=1 # important for RPM deinstallation
44 # searching for the PRODUCTINSTALLLOCATION for the different platforms
45 platform=`uname -s`
46 case $$platform in
47 SunOS)
48   PRODUCTINSTALLLOCATION="$$BASEDIR"
49   ;;
50 Linux)
51   PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX"
52   if [ "$$1" = 1 ]      # one package left after deinstallation -> update
53   then
54     LASTUNINSTALL=0
55   fi
56   ;;
58   PRODUCTINSTALLLOCATION="$$BASEDIR" 
59   ;;
60 esac
62 if [ -h $$PRODUCTINSTALLLOCATION/libreoffice/basisBASISDIRECTORYVERSION/ure-link -a $$LASTUNINSTALL -eq 1 ]
63 then
64   rm -f $$PRODUCTINSTALLLOCATION/libreoffice/basisBASISDIRECTORYVERSION/ure-link 2>/dev/null
65   rmdir $$PRODUCTINSTALLLOCATION/libreoffice/basisBASISDIRECTORYVERSION 2>/dev/null
68 exit 0
69 END