Update ooo320-m1
[ooovba.git] / setup_native / scripts / langpackscript.sh
blob9ea5a9a70550ee5062f76cec6006a37339acef66
1 #!/bin/sh
3 MYUID=`id | sed "s/(.*//g" | sed "s/.*=//"`
5 if [ $MYUID -ne 0 ]
6 then
7 echo You need to have super-user rights to install this language package
8 exit 1
9 fi
11 linenum=LINENUMBERPLACEHOLDER
13 # Determining current platform
15 platform=`uname -s`
17 case $platform in
18 SunOS)
19 tail_prog="tail"
21 Linux)
22 tail_prog="tail -n"
25 tail_prog="tail"
27 esac
29 more << "EOF"
30 LICENSEFILEPLACEHOLDER
31 EOF
33 agreed=
34 while [ x$agreed = x ]; do
35 echo
36 echo "Do you agree to the above license terms? [yes or no] "
37 read reply leftover
38 case $reply in
39 y* | Y*)
40 agreed=1;;
41 n* | N*)
42 echo "If you don't agree to the license you can't install this software";
43 exit 1;;
44 esac
45 done
47 case $platform in
48 SunOS)
49 SEARCHPACKAGENAME="BASISPACKAGEPREFIXPLACEHOLDEROOOBASEVERSIONPLACEHOLDER-core01"
50 echo
51 echo "Searching for the FULLPRODUCTNAMELONGPLACEHOLDER installation ..."
52 PACKAGENAME=`pkginfo -x | grep $SEARCHPACKAGENAME | sed "s/ .*//"`
53 if [ "x$PACKAGENAME" != "x" ]
54 then
55 PRODUCTINSTALLLOCATION="`pkginfo -r $PACKAGENAME`"
56 else
57 echo "FULLPRODUCTNAMELONGPLACEHOLDER not installed (no package $SEARCHPACKAGENAME installed)"
58 exit 1
61 Linux)
62 SEARCHPACKAGENAME="BASISPACKAGEPREFIXPLACEHOLDEROOOBASEVERSIONPLACEHOLDER-core01"
63 FIXPATH="/openoffice.org"
64 echo
65 echo "Searching for the FULLPRODUCTNAMELONGPLACEHOLDER installation ..."
66 RPMNAME=`rpm -qa | grep $SEARCHPACKAGENAME`
67 if [ "x$RPMNAME" != "x" ]
68 then
69 PRODUCTINSTALLLOCATION="`rpm -ql $RPMNAME | head -n 1`"
70 else
71 echo "FULLPRODUCTNAMELONGPLACEHOLDER not installed (no package $SEARCHPACKAGENAME installed)"
72 exit 1
74 PRODUCTINSTALLLOCATION=`echo $PRODUCTINSTALLLOCATION | sed "s#${FIXPATH}##"`
77 echo "Unsupported platform"
78 exit 1
80 esac
82 # Asking for the installation directory
84 # echo
85 # echo "Where do you want to install the language pack ? [$PRODUCTINSTALLLOCATION] "
86 # read reply leftover
87 # if [ "x$reply" != "x" ]
88 # then
89 # PRODUCTINSTALLLOCATION="$reply"
90 # fi
92 # Unpacking
94 outdir=/var/tmp/install_$$
95 mkdir $outdir
97 #diskSpace=`df -k $outdir | $tail_prog -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
98 #if [ $diskSpace -lt $diskSpaceRequired ]; then
99 # printf "You will need atleast %s kBytes of Disk Free\n" $diskSpaceRequired
100 # printf "Please free up the required Disk Space and try again\n"
101 # exit 3
104 trap 'rm -rf $outdir; exit 1' HUP INT QUIT TERM
105 echo "Unpacking and installing..."
107 #if [ -x /usr/bin/sum ] ; then
108 # echo "Checksumming..."
110 # sum=`/usr/bin/sum $outdir/$outname`
111 # index=1
112 # for s in $sum
113 # do
114 # case $index in
115 # 1) sum1=$s;
116 # index=2;
117 # ;;
118 # 2) sum2=$s;
119 # index=3;
120 # ;;
121 # esac
122 # done
123 # if expr $sum1 != <sum1replace> || expr $sum2 != <sum2replace> ; then
124 # echo "The download file appears to be corrupted. Please refer"
125 # echo "to the Troubleshooting section of the Installation"
126 # exit 1
127 # fi
128 #else
129 # echo "Can't find /usr/bin/sum to do checksum. Continuing anyway."
132 case $platform in
133 SunOS)
134 $tail_prog +$linenum $0 | gunzip | (cd $outdir; tar xvf -)
135 adminfile=$outdir/admin.$$
136 echo "basedir=$PRODUCTINSTALLLOCATION" > $adminfile
137 INSTALLLINES
139 Linux)
140 $tail_prog +$linenum $0 | gunzip | (cd $outdir; tar xvf -)
141 INSTALLLINES
144 echo "Unsupported platform"
145 exit 1
147 esac
149 rm -rf $outdir
151 echo "Done..."
153 exit 0