"Fossies" - the Fresh Open Source Software Archive

Member "dosemu-1.4.0/install_systemwide" (4 May 2007, 3697 Bytes) of package /linux/misc/old/dosemu-1.4.0.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/bash
    2 #
    3 # (C) Copyright 1992, ..., 2007 the "DOSEMU-Development-Team".
    4 #
    5 # for details see file COPYING.DOSEMU in the DOSEMU distribution
    6 #
    7 # Make a systemwide installation of dosemu.
    8 #
    9 # NOTEs:
   10 #
   11 #   1. 'make' and 'make dosbin' must have been done prior to this
   12 #
   13 #   2. You must have available dosemu-freedos-bin.tgz somewhere
   14 #
   15 #   3. This installs a non-suid-root DOSEMU, which is almost fullfeature
   16 #      when running under X. If you want graphics on the console
   17 #      or want to access hardware (such as ports and IRQ passing), you
   18 #      need a suid-root installation. However, because this is
   19 #      inherently insecure and dangerous (you may lock your machine)
   20 #      we won't support/recommend it for normal usage and expect only
   21 #      skilled people (and those respecting 'RTFM';-) being able to use
   22 #      it properly. Hence, no 'automagical' suid-root install any more.
   23 #
   24 #
   25 # this script is obsolete, but just keep it as a "make install" front end
   26 # for now
   27 
   28 function usage {
   29   echo "USAGE:
   30 
   31  ./install_systemwide [-fd FD_tarball] [-r root] [ -i instpath] [-b binpath]
   32 
   33  where is
   34 
   35   FD_tarball    Tarball containing FreeDos part of the DOSEMU binary
   36         distribution as available on the official DOSEMU site:
   37                ftp://ftp.dosemu/org/dosemu/dosemu-freedos-bin.tgz
   38         (give the local filename where you downloaded it)
   39         If this argument is ommitted, the script assumes you have
   40         already put it to <instpath>/dosemu-freedos-bin.tgz, if it
   41         is not in place, the script aborts.
   42 
   43   root      optional prefix for 'instpath' and 'binpath', so you can make
   44         packages out of the installation without messing up your
   45         running system setup. 'root' will only be taken for copying,
   46         not for configuring and this tree is not useable until
   47         it gets moved to the proper instpath/binpath.
   48 
   49   instpath  Path in the (installed) system where the DOSEMU templates,
   50         binaries and docs will reside. Default is /opt/dosemu.
   51 
   52   binpath   Path where symlinks of the executables are placed.
   53         Default is /usr/bin.
   54 "
   55   exit 1
   56 }
   57 
   58 FDTARBALL=""
   59 ROOT=""
   60 INSTPATH=/opt/dosemu
   61 BINPATH=/usr/bin
   62 
   63 while [ ! -z "$1" ]; do
   64   if [ "$1" = '-r' ]; then
   65     if [ -z "$2" ]; then usage; fi
   66     ROOT=$2;
   67     shift; shift
   68     continue
   69   fi
   70   if [ "$1" = '-i' ]; then
   71     if [ -z "$2" ]; then usage; fi
   72     INSTPATH=$2;
   73     shift; shift
   74     continue
   75   fi
   76   if [ "$1" = '-b' ]; then
   77     if [ -z "$2" ]; then usage; fi
   78     BINPATH=$2;
   79     shift; shift
   80     continue
   81   fi
   82   if [ "$1" = '-fd' ]; then
   83     if [ -z "$2" ]; then usage; fi
   84     FDTARBALL=$2;
   85     shift; shift
   86     continue
   87   fi
   88   usage
   89 done
   90 
   91 if [ -z "$FDTARBALL" ]; then
   92   FDTARBALL="$INSTPATH/dosemu-freedos-bin.tgz"
   93   if [ -n "$ROOT" ]; then
   94     FDTARBALL="$ROOT/$FDTARBALL"
   95   fi
   96 fi
   97 
   98 #echo "$FDTARBALL,$ROOT,$INSTPATH,$BINPATH"; exit
   99 
  100 # check if FDTARBALL is valid
  101 #
  102 if [ ! -f $FDTARBALL ]; then
  103   echo "
  104   You failed to give -fd option or the file you gave is not accessible.
  105   The default file for this option doesn't exist either.
  106   Type 'install_systemwide -help' for details
  107   ... giving up.
  108 "
  109   exit 1
  110 fi
  111 if ! tar -tzf $FDTARBALL >/dev/null 2>&1; then
  112   echo "
  113   $FDTARBALL seems broken (broken download?),
  114   ... giving up
  115 "
  116   exit 1
  117 fi
  118 if ! tar -tzf $FDTARBALL |grep dosemu/freedos/dosemu/lcd.exe >/dev/null; then
  119   echo "
  120   $FDTARBALL seems not to have correct content,
  121   ... giving up
  122 "
  123 fi
  124 
  125 # ok, we now now have all we need
  126 
  127 INST=$INSTPATH
  128 BIN=$BINPATH
  129 if [ -n "$ROOT" ]; then
  130   INST="$ROOT/$INST"
  131   BIN="$ROOT/$BIN"
  132 fi
  133 
  134 rm -f bin/dosemu
  135 make dosemu_script syshdimagedir=$INSTPATH dosemudir=$INSTPATH x11fontdir=$INSTPATH/Xfonts
  136 make install syshdimagedir=$INST dosemudir=$INST mandir=$INST/man bindir=$BIN \
  137     x11fontdir=$INST/Xfonts docdir=$INST/doc fdtarball=$FDTARBALL
  138