summaryrefslogtreecommitdiff
path: root/doc-build/mate-doc-common.in
blob: b2216daa96d920bac47c9f63fb15e37d5f8bc025 (plain)
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
#!/bin/sh

progname=`echo "$0" | sed 's%^.*/%%'`

PROGRAM=mate-doc-common
PACKAGE=@PACKAGE@
VERSION=@VERSION@

prefix=@prefix@
datarootdir=@datarootdir@
datadir=@datadir@

# options
docdir=.
copy=no

while test $# -gt 0; do
  case "$1" in
  --help)
    echo "usage: $progname [--version|--help]" 1>&2
    exit 1 ;;
  --version)
    echo "$PROGRAM ($PACKAGE) $VERSION"
    exit 0 ;;
  --copy)
    copy=yes
    shift ;;
  -*)
    echo "$progname: unrecognised option '$1'" 1>&2
    echo "usage: $progname [--version|--help]" 1>&2
    exit 1 ;;
  *)
    echo "$progname: too many arguments" 1>&2
    echo "usage: $progname [--version|--help]" 1>&2
    exit 1 ;;
  esac
done

for file in omf.make xmldocs.make; do
  rm -f $docdir/$file
  if test "$copy" = yes; then
    cp -f $datadir/$PACKAGE/data/$file $docdir/ ||
      exit 1
  else
    ln -sf $datadir/$PACKAGE/data/$file $docdir/ ||
      cp -f $datadir/$PACKAGE/data/$file $docdir/ ||
      exit 1
  fi
done