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