]> git.sur5r.net Git - openldap/blob - build/install.sh
b9ac07f89a0d9ca9c4aa4ddc115acd2418895e56
[openldap] / build / install.sh
1 #!/bin/sh
2 # simple BSD-like install replacement
3 #
4 # Copyright (c) 1994 The Regents of the University of Michigan
5 #
6
7 MODE=0755
8 USAGE="usage: $0 [-c] [-m mode] file dir"
9
10 while [ $# != 0 ]; do
11     case "$1" in
12     -c)
13         ;;
14     -m)
15         MODE=$2
16         shift
17         ;;
18     -*)
19         echo "$USAGE"
20         exit 1
21         ;;
22     *)
23         break
24         ;;
25     esac
26     shift
27 done
28
29 if [ $# != 2 ]; then
30     echo "$USAGE"
31     exit 1
32 fi
33
34 FILE=$1
35 DIR=$2
36
37 cp $FILE $DIR
38 if [ -d $DIR ]; then
39     chmod $MODE $DIR/`basename $FILE`
40 else
41 #
42 # DIR is really the destination file
43 #
44     chmod $MODE $DIR
45 fi