File: install_systemwide

package info (click to toggle)
dosemu 1.4.0%2Bsvn.2080-1
  • links: PTS
  • area: contrib
  • in suites: wheezy
  • size: 15,500 kB
  • sloc: ansic: 136,982; asm: 4,107; sh: 1,606; perl: 1,411; makefile: 956; tcl: 599; awk: 404; yacc: 300; lex: 157
file content (138 lines) | stat: -rwxr-xr-x 3,697 bytes parent folder | download | duplicates (5)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#! /bin/bash
#
# (C) Copyright 1992, ..., 2007 the "DOSEMU-Development-Team".
#
# for details see file COPYING.DOSEMU in the DOSEMU distribution
#
# Make a systemwide installation of dosemu.
#
# NOTEs:
#
#	1. 'make' and 'make dosbin' must have been done prior to this
#
#	2. You must have available dosemu-freedos-bin.tgz somewhere
#
#	3. This installs a non-suid-root DOSEMU, which is almost fullfeature
#	   when running under X. If you want graphics on the console
#	   or want to access hardware (such as ports and IRQ passing), you
#	   need a suid-root installation. However, because this is
#	   inherently insecure and dangerous (you may lock your machine)
#	   we won't support/recommend it for normal usage and expect only
#	   skilled people (and those respecting 'RTFM';-) being able to use
#	   it properly. Hence, no 'automagical' suid-root install any more.
#
#
# this script is obsolete, but just keep it as a "make install" front end
# for now

function usage {
  echo "USAGE:

 ./install_systemwide [-fd FD_tarball] [-r root] [ -i instpath] [-b binpath]

 where is

  FD_tarball	Tarball containing FreeDos part of the DOSEMU binary
		distribution as available on the official DOSEMU site:
		       ftp://ftp.dosemu/org/dosemu/dosemu-freedos-bin.tgz
		(give the local filename where you downloaded it)
		If this argument is ommitted, the script assumes you have
		already put it to <instpath>/dosemu-freedos-bin.tgz, if it
		is not in place, the script aborts.

  root		optional prefix for 'instpath' and 'binpath', so you can make
		packages out of the installation without messing up your
		running system setup. 'root' will only be taken for copying,
		not for configuring and this tree is not useable until
		it gets moved to the proper instpath/binpath.

  instpath	Path in the (installed) system where the DOSEMU templates,
		binaries and docs will reside. Default is /opt/dosemu.

  binpath	Path where symlinks of the executables are placed.
		Default is /usr/bin.
"
  exit 1
}

FDTARBALL=""
ROOT=""
INSTPATH=/opt/dosemu
BINPATH=/usr/bin

while [ ! -z "$1" ]; do
  if [ "$1" = '-r' ]; then
    if [ -z "$2" ]; then usage; fi
    ROOT=$2;
    shift; shift
    continue
  fi
  if [ "$1" = '-i' ]; then
    if [ -z "$2" ]; then usage; fi
    INSTPATH=$2;
    shift; shift
    continue
  fi
  if [ "$1" = '-b' ]; then
    if [ -z "$2" ]; then usage; fi
    BINPATH=$2;
    shift; shift
    continue
  fi
  if [ "$1" = '-fd' ]; then
    if [ -z "$2" ]; then usage; fi
    FDTARBALL=$2;
    shift; shift
    continue
  fi
  usage
done

if [ -z "$FDTARBALL" ]; then
  FDTARBALL="$INSTPATH/dosemu-freedos-bin.tgz"
  if [ -n "$ROOT" ]; then
    FDTARBALL="$ROOT/$FDTARBALL"
  fi
fi

#echo "$FDTARBALL,$ROOT,$INSTPATH,$BINPATH"; exit

# check if FDTARBALL is valid
#
if [ ! -f $FDTARBALL ]; then
  echo "
  You failed to give -fd option or the file you gave is not accessible.
  The default file for this option doesn't exist either.
  Type 'install_systemwide -help' for details
  ... giving up.
"
  exit 1
fi
if ! tar -tzf $FDTARBALL >/dev/null 2>&1; then
  echo "
  $FDTARBALL seems broken (broken download?),
  ... giving up
"
  exit 1
fi
if ! tar -tzf $FDTARBALL |grep dosemu/freedos/dosemu/lcd.exe >/dev/null; then
  echo "
  $FDTARBALL seems not to have correct content,
  ... giving up
"
fi

# ok, we now now have all we need

INST=$INSTPATH
BIN=$BINPATH
if [ -n "$ROOT" ]; then
  INST="$ROOT/$INST"
  BIN="$ROOT/$BIN"
fi

rm -f bin/dosemu
make dosemu_script syshdimagedir=$INSTPATH dosemudir=$INSTPATH x11fontdir=$INSTPATH/Xfonts
make install syshdimagedir=$INST dosemudir=$INST mandir=$INST/man bindir=$BIN \
	x11fontdir=$INST/Xfonts docdir=$INST/doc fdtarball=$FDTARBALL