Update ooo320-m1
[ooovba.git] / setup_native / source / packinfo / shellscripts_core01.txt
blob623e5e901be2d918acb838af8b1e73eb90e08ec3
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-ure
12   UREDIR=`pkginfo -r $$UREPACKAGE`
13   PRODUCTINSTALLLOCATION="$$BASEDIR"
14   ;;
15 Linux)
16   UREPACKAGE=UREPACKAGEPREFIX-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/openoffice.org/ure ]
27 then
28       ln -s $$UREDIR/openoffice.org/ure $$PRODUCTINSTALLLOCATION/openoffice.org/basisBASISDIRECTORYVERSION/ure-link >/dev/null 2>&1
29 else
30       ln -s ../ure $$PRODUCTINSTALLLOCATION/openoffice.org/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/openoffice.org/basisBASISDIRECTORYVERSION/ure-link -a $$LASTUNINSTALL -eq 1 ]
63 then
64   rm -f $$PRODUCTINSTALLLOCATION/openoffice.org/basisBASISDIRECTORYVERSION/ure-link 2>/dev/null
65   rmdir $$PRODUCTINSTALLLOCATION/openoffice.org/basisBASISDIRECTORYVERSION 2>/dev/null
66   rmdir $$PRODUCTINSTALLLOCATION/openoffice.org 2>/dev/null
69 exit 0
70 END