3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 linenum
=LINENUMBERPLACEHOLDER
22 UNPACKDIR
=/var
/tmp
/unpack_PRODUCTNAMEPLACEHOLDER
23 diskSpaceRequired
=DISCSPACEPLACEHOLDER
24 checksum
=CHECKSUMPLACEHOLDER
32 # Determining current platform
48 # Asking for the unpack directory
51 echo "Select the directory in which to save the unpacked files. [$UNPACKDIR] "
53 if [ "x$reply" != "x" ]
58 if [ -d $UNPACKDIR ]; then
59 printf "Directory $UNPACKDIR already exists.\n"
60 printf "Please select a new directory name.\n"
66 mkdir
-m 700 $UNPACKDIR
68 diskSpace
=`df -k $UNPACKDIR | $tail_prog -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
69 if [ $diskSpace -lt $diskSpaceRequired ]; then
70 printf "The selected drive does not have enough disk space available.\n"
71 printf "PRODUCTNAMEPLACEHOLDER requires at least %s kByte.\n" $diskSpaceRequired
75 trap 'rm -rf $UNPACKDIR; exit 1' HUP INT QUIT TERM
77 if [ -x /usr
/bin
/sum ] ; then
78 echo "File is being checked for errors ..."
80 sum=`$tail_prog +$linenum $0 | /usr/bin/sum`
81 sum=`echo $sum | awk '{ print $1 }'`
83 if [ $sum != $checksum ]; then
84 echo "The download file appears to be corrupted. Please download PRODUCTNAMEPLACEHOLDER again."
91 $tail_prog +$linenum $0 |
(cd $UNPACKDIR; tar xf
-)
93 echo "All files have been successfully unpacked."
95 if [ "$EXTRACTONLY" != "yes" ]
97 if [ -f $UNPACKDIR/setup
]
99 chmod 775 $UNPACKDIR/setup