home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2008 February / MAC_easy_02_08.iso / Software / Top-Ten-Programme / NeoOffice-2.2.3-Intel.dmg / NeoOffice-2.2.3-Intel.pkg / Contents / Resources / preflight < prev    next >
Encoding:
Text File  |  2008-03-14  |  2.9 KB  |  109 lines

  1. #!/bin/bash -x
  2. ##########################################################################
  3. #   $RCSfile: preflight,v $
  4. #   $Revision: 1.27 $
  5. #   last change: $Author: pluby $ $Date: 2008/01/26 07:01:18 $
  6. #   The Contents of this file are made available subject to the terms of
  7. #   either of the following licenses
  8. #         - GNU General Public License Version 2.1
  9. #   Patrick Luby, June 2003
  10. #   GNU General Public License Version 2.1
  11. #   =============================================
  12. #   Copyright 2003 Planamesa Inc.
  13. #   This library is free software; you can redistribute it and/or
  14. #   modify it under the terms of the GNU General Public
  15. #   License version 2.1, as published by the Free Software Foundation.
  16. #   This library is distributed in the hope that it will be useful,
  17. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19. #   General Public License for more details.
  20. #   You should have received a copy of the GNU General Public
  21. #   License along with this library; if not, write to the Free Software
  22. #   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. #   MA  02111-1307  USA
  24. ##########################################################################
  25.  
  26. PATH=/bin:/sbin:/usr/bin:/usr/sbin
  27. export PATH
  28.  
  29. umask 022
  30.  
  31. if [ -d "$2" ] ; then
  32.  
  33.     # Fix Apple installer bug described in bug 1373
  34.     if [ "$2" = "/" -o "$2" = "$3" -o `cd "$2" ; pwd` = "/" -o `cd "$2" ; pwd` = "$3" ]; then
  35.         exit 1;
  36.     fi
  37.  
  38. fi
  39.  
  40. if [ -d "$2/Contents" ] ; then
  41.  
  42.     # Save dictionary files for postflight scripts
  43.     if [ -d "$2/Contents/share/dict/ooo" -a ! -e "$2/ooo" ]; then
  44.         mv -f "$2/Contents/share/dict/ooo" "$2" || exit 1
  45.     fi
  46.  
  47.     # Save jar files for postflight scripts
  48.     if [ -d "$2/Contents/MacOS/classes" -a ! -e "$2/classes" ]; then
  49.         mv -f "$2/Contents/MacOS/classes" "$2" || exit 1
  50.     fi
  51.  
  52.     # Save font files for postflight scripts
  53.     if [ -d "$2/Contents/share/fonts/truetype" -a ! -e "$2/truetype" ]; then
  54.         mv -f "$2/Contents/share/fonts/truetype" "$2" || exit 1
  55.     fi
  56.  
  57.     scriptdir=`dirname "$0"`
  58.     if [ -d "$scriptdir" -a -f "$scriptdir/installutils" ] ; then
  59.  
  60.         . "$scriptdir/installutils"
  61.  
  62.         if check_installation "$2" ; then
  63.             # Save help files for postflight scripts
  64.             if [ -d "$2/Contents/help" -a ! -e "$2/help" ]; then
  65.                 mv -f "$2/Contents/help" "$2" || exit 1
  66.             fi
  67.  
  68.             # Save resource files for postflight scripts
  69.             if [ -d "$2/Contents/MacOS/resource" -a ! -e "$2/resource" ]; then
  70.                 mv -f "$2/Contents/MacOS/resource" "$2" || exit 1
  71.             fi
  72.  
  73.             # Save localization files
  74.             if [ -d "$2/Contents/share" -a ! -e "$2/share" ]; then
  75.                 mv -f "$2/Contents/share" "$2" || exit 1
  76.             fi
  77.         else
  78.             if [ -e "$2/help" ]; then
  79.                 rm -Rf "$2/help" || exit 1
  80.             fi
  81.  
  82.             if [ -e "$2/resource" ]; then
  83.                 rm -Rf "$2/resource" || exit 1
  84.             fi
  85.  
  86.             if [ -e "$2/share" ]; then
  87.                 rm -Rf "$2/share" || exit 1
  88.             fi
  89.         fi
  90.  
  91.     fi
  92.  
  93.     rm -Rf "$2/Contents" || exit 1
  94.  
  95. fi
  96.  
  97. exit 0
  98.