source: branches/samba-3.0/source/install-sh@ 112

Last change on this file since 112 was 1, checked in by Paul Smedley, 19 years ago

Initial code import

File size: 4.7 KB
Line 
1#! /bin/sh
2#
3# install - install a program, script, or datafile
4# This comes from X11R5.
5#
6# Calling this script install-sh is preferred over install.sh, to prevent
7# `make' implicit rules from creating a file called install from it
8# when there is no Makefile.
9#
10# This script is compatible with the BSD install script, but was written
11# from scratch.
12#
13
14
15# set DOITPROG to echo to test this script
16
17# Don't use :- since 4.3BSD and earlier shells don't like it.
18doit="${DOITPROG-}"
19
20
21# put in absolute paths if you don't have them in your path; or use env. vars.
22
23mvprog="${MVPROG-mv}"
24cpprog="${CPPROG-cp}"
25chmodprog="${CHMODPROG-chmod}"
26chownprog="${CHOWNPROG-chown}"
27chgrpprog="${CHGRPPROG-chgrp}"
28stripprog="${STRIPPROG-strip}"
29rmprog="${RMPROG-rm}"
30mkdirprog="${MKDIRPROG-mkdir}"
31
32transformbasename=""
33transform_arg=""
34instcmd="$mvprog"
35chmodcmd="$chmodprog 0755"
36chowncmd=""
37chgrpcmd=""
38stripcmd=""
39rmcmd="$rmprog -f"
40mvcmd="$mvprog"
41src=""
42dst=""
43dir_arg=""
44
45while [ x"$1" != x ]; do
46 case $1 in
47 -c) instcmd="$cpprog"
48 shift
49 continue;;
50
51 -d) dir_arg=true
52 shift
53 continue;;
54
55 -m) chmodcmd="$chmodprog $2"
56 shift
57 shift
58 continue;;
59
60 -o) chowncmd="$chownprog $2"
61 shift
62 shift
63 continue;;
64
65 -g) chgrpcmd="$chgrpprog $2"
66 shift
67 shift
68 continue;;
69
70 -s) stripcmd="$stripprog"
71 shift
72 continue;;
73
74 -t=*) transformarg=`echo $1 | sed 's/-t=//'`
75 shift
76 continue;;
77
78 -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
79 shift
80 continue;;
81
82 *) if [ x"$src" = x ]
83 then
84 src=$1
85 else
86 # this colon is to work around a 386BSD /bin/sh bug
87 :
88 dst=$1
89 fi