1%preinstall << END 2END 3 4%postinstall << END 5 6# echo Command after installing 7# searching for the PRODUCTINSTALLLOCATION for the different platforms 8platform=`uname -s` 9case $$platform in 10SunOS) 11 BASISPACKAGE=openofficeorg-core01 12 BASISDIR=`pkginfo -r $$BASISPACKAGE` 13 PRODUCTINSTALLLOCATION="$$BASEDIR" 14 ;; 15Linux) 16 BASISPACKAGE=openoffice.org-core01 17 BASISDIR=`rpm -q --queryformat "%{INSTALLPREFIX}" $$BASISPACKAGE` 18 PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX" 19 ;; 20*) 21 PRODUCTINSTALLLOCATION="$$BASEDIR" 22 ;; 23esac 24 25# creating link to basis layer 26if [ -d $$BASISDIR/openoffice.org/basisBASISDIRECTORYVERSION ] 27then 28 ln -s $$BASISDIR/openoffice.org/basisBASISDIRECTORYVERSION $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/basis-link >/dev/null 2>&1 29else 30 ln -s ../openoffice.org/basisBASISDIRECTORYVERSION $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/basis-link >/dev/null 2>&1 31fi 32 33exit 0 34END 35 36%preremove << END 37END 38 39%postremove << END 40# echo Command after removing 41 42LASTUNINSTALL=1 # important for RPM deinstallation 43 44# searching for the PRODUCTINSTALLLOCATION for the different platforms 45platform=`uname -s` 46case $$platform in 47SunOS) 48 PRODUCTINSTALLLOCATION="$$BASEDIR" 49 ;; 50Linux) 51 PRODUCTINSTALLLOCATION="$$RPM_INSTALL_PREFIX" 52 if [ "$$1" = 1 ] # one package left after deinstallation -> update 53 then 54 LASTUNINSTALL=0 55 fi 56 ;; 57*) 58 PRODUCTINSTALLLOCATION="$$BASEDIR" 59 ;; 60esac 61 62if [ -h $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/basis-link -a $$LASTUNINSTALL -eq 1 ] 63then 64 rm -f $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME/basis-link 2>/dev/null 65 rmdir $$PRODUCTINSTALLLOCATION/PRODUCTDIRECTORYNAME 2>/dev/null 66fi 67 68exit 0 69END 70